Envoi sur GitHub du projet updated

This commit is contained in:
Maurane
2026-01-07 12:47:48 +01:00
parent 34e887afd2
commit 3f1863f0c1
434 changed files with 16021 additions and 5685 deletions
+20 -13
View File
@@ -2,14 +2,11 @@
class_name DialogueLine extends RefCounted
const _DialogueConstants = preload("./constants.gd")
## The ID of this line
var id: String
## The internal type of this dialogue object. One of [code]TYPE_DIALOGUE[/code] or [code]TYPE_MUTATION[/code]
var type: String = _DialogueConstants.TYPE_DIALOGUE
var type: String = DMConstants.TYPE_DIALOGUE
## The next line ID after this line.
var next_id: String = ""
@@ -29,9 +26,6 @@ var text_replacements: Array[Dictionary] = []
## The key to use for translating this line.
var translation_key: String = ""
## A map for when and for how long to pause while typing out the dialogue text.
var pauses: Dictionary = {}
## A map for speed changes when typing out the dialogue text.
var speeds: Dictionary = {}
@@ -41,6 +35,9 @@ var inline_mutations: Array[Array] = []
## A list of responses attached to this line of dialogue.
var responses: Array = []
## A list of lines that are spoken simultaneously with this one.
var concurrent_lines: Array[DialogueLine] = []
## A list of any extra game states to check when resolving variables and mutations.
var extra_game_states: Array = []
@@ -65,33 +62,43 @@ func _init(data: Dictionary = {}) -> void:
extra_game_states = data.get("extra_game_states", [])
match type:
_DialogueConstants.TYPE_DIALOGUE:
DMConstants.TYPE_DIALOGUE:
character = data.character
character_replacements = data.get("character_replacements", [] as Array[Dictionary])
text = data.text
text_replacements = data.get("text_replacements", [] as Array[Dictionary])
translation_key = data.get("translation_key", data.text)
pauses = data.get("pauses", {})
speeds = data.get("speeds", {})
inline_mutations = data.get("inline_mutations", [] as Array[Array])
time = data.get("time", "")
tags = data.get("tags", [])
concurrent_lines = data.get("concurrent_lines", [] as Array[DialogueLine])
_DialogueConstants.TYPE_MUTATION:
DMConstants.TYPE_MUTATION:
mutation = data.mutation
func _to_string() -> String:
match type:
_DialogueConstants.TYPE_DIALOGUE:
DMConstants.TYPE_DIALOGUE:
return "<DialogueLine character=\"%s\" text=\"%s\">" % [character, text]
_DialogueConstants.TYPE_MUTATION:
DMConstants.TYPE_MUTATION:
return "<DialogueLine mutation>"
return ""
## Check if a dialogue line has a given tag.
func has_tag(tag_name: String) -> bool:
var wrapped: String = "%s=" % tag_name
for t in tags:
if t.begins_with(wrapped):
return true
return false
## Get the value of a tag if the tag is in the form of [code]tag=value[/code]
func get_tag_value(tag_name: String) -> String:
var wrapped := "%s=" % tag_name
var wrapped: String = "%s=" % tag_name
for t in tags:
if t.begins_with(wrapped):
return t.replace(wrapped, "").strip_edges()