Updated dialogic

This commit is contained in:
MaddoScientisto 2026-01-05 16:00:41 +01:00
commit cbb82512ee
483 changed files with 5743 additions and 2177 deletions

View file

@ -19,7 +19,7 @@ var label_name := ""
var timeline_identifier := "":
get:
if timeline:
var identifier := DialogicResourceUtil.get_unique_identifier(timeline.resource_path)
var identifier := timeline.get_identifier()
if not identifier.is_empty():
return identifier
return timeline_identifier
@ -95,7 +95,7 @@ func get_shortcode_parameters() -> Dictionary:
return {
#param_name : property_info
"timeline" : {"property": "timeline_identifier", "default": null,
"suggestions": get_timeline_suggestions},
"suggestions": get_timeline_suggestions, "ext_file":true},
"label" : {"property": "label_name", "default": ""},
}
@ -109,7 +109,7 @@ func build_event_editor() -> void:
'file_extension': '.dtl',
'mode' : 2,
'suggestions_func': get_timeline_suggestions,
'editor_icon' : ["TripleBar", "EditorIcons"],
'icon' : load("res://addons/dialogic/Editor/Images/Resources/timeline.svg"),
'empty_text' : '(this timeline)',
'autofocus' : true,
})
@ -134,6 +134,9 @@ func get_label_suggestions(_filter:String="") -> Dictionary:
if timeline_identifier in DialogicResourceUtil.get_label_cache().keys():
for label in DialogicResourceUtil.get_label_cache()[timeline_identifier]:
suggestions[label] = {'value': label, 'tooltip':label, 'editor_icon': ["ArrowRight", "EditorIcons"]}
if _filter.begins_with("{"):
for var_path in DialogicUtil.list_variables(DialogicUtil.get_default_variables()):
suggestions["{"+var_path+"}"] = {'value':"{"+var_path+"}", 'icon':load("res://addons/dialogic/Editor/Images/Pieces/variable.svg")}
return suggestions
@ -144,6 +147,8 @@ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:Str
if symbol == ' ' and line.count(' ') == 1:
CodeCompletionHelper.suggest_labels(TextNode, '', '\n', event_color.lerp(TextNode.syntax_highlighter.normal_color, 0.6))
CodeCompletionHelper.suggest_timelines(TextNode, CodeEdit.KIND_MEMBER, event_color.lerp(TextNode.syntax_highlighter.normal_color, 0.6))
if symbol == "{":
CodeCompletionHelper.suggest_variables(TextNode)
if symbol == '/':
CodeCompletionHelper.suggest_labels(TextNode, line.strip_edges().trim_prefix('jump ').trim_suffix('/'+String.chr(0xFFFF)).strip_edges(), '\n', event_color.lerp(TextNode.syntax_highlighter.normal_color, 0.6))

View file

@ -1 +1 @@
uid://cptoxigoty8kr
uid://ckayb5m8qyh0p

View file

@ -24,7 +24,7 @@ func _execute() -> void:
"identifier": name,
"display_name": get_property_translated("display_name"),
"display_name_orig": display_name,
"timeline": DialogicResourceUtil.get_unique_identifier(dialogic.current_timeline.resource_path)
"timeline": dialogic.current_timeline.get_identifier()
})
finish()

View file

@ -1 +1 @@
uid://doigeg6vvu0yd
uid://c87eqjyrb1mm0

View file

@ -11,7 +11,7 @@ extends DialogicEvent
################################################################################
func _execute() -> void:
if !dialogic.Jump.is_jump_stack_empty():
if not dialogic.Jump.is_jump_stack_empty():
dialogic.Jump.resume_from_last_jump()
else:
dialogic.end_timeline()

View file

@ -1 +1 @@
uid://cl6u17e7k7d8f
uid://dqc8e0tnb7qsc

View file

@ -1 +1 @@
uid://cxjpiba6v5ddc
uid://45g7pgoc6boa

View file

@ -2,11 +2,42 @@ extends DialogicSubsystem
## Subsystem that holds methods for jumping to specific labels, or return to the previous jump.
signal switched_timeline(info:Dictionary)
signal jumped_to_label(info:Dictionary)
signal returned_from_jump(info:Dictionary)
signal passed_label(info:Dictionary)
@warning_ignore("unused_signal") # this is emitted from the jump event
## Emitted when a jump event switches from one timeline to another. Gives a dictionary witht the keys:
## [br]
## Key | Value Type | Value [br]
## -------------------- | ----------------------- | ----- [br]
## `previous_timeline` | [type DialogicTimeline] | The timeline that we were in previously. [br]
## `timeline` | [type DialogicTimeline] | The timeline we are in now. [br]
## `label` | [type String] | The label we went to (empty if beginning). [br]
signal switched_timeline(info:Dictionary)
## Emitted when a jump event jumps to a label. Gives a dictionary witht the keys:
## [br]
## Key | Value Type | Value [br]
## ----------- | ----------------------- | ----- [br]
## `timeline` | [type DialogicTimeline] | The timeline we are in now. [br]
## `label` | [type String] | The label we went to (empty if beginning). [br]
signal jumped_to_label(info:Dictionary)
## Emitted when a return event is hit and there was a timeline to return to. Gives a dictionary witht the keys:
## [br]
## Key | Value Type | Value [br]
## --------------- | ----------------------- | ----- [br]
## `sub_timeline` | [type DialogicTimeline] | The timeline we were in before. [br]
## `label` | [type String] | The label we went back to (empty if beginning). [br]
signal returned_from_jump(info:Dictionary)
## Emitted when a label event is executed (usually does nothing else). Gives a dictionary witht the keys:
## [br]
## Key | Value Type | Value [br]
## ------------------- | ----------------------- | ----- [br]
## `identifier` | [type String] | The identifier of the label event. [br]
## `display_name` | [type String] | The display name, possibly translated. [br]
## `display_name_orig` | [type String] | The untranslated display name. [br]
## `timeline` | [type String] | The identifier of the timeline we are in. [br]
signal passed_label(info:Dictionary)
#region STATE
####################################################################################################
@ -29,8 +60,10 @@ func load_game_state(_load_flag:=LoadFlags.FULL_LOAD) -> void:
func jump_to_label(label:String) -> void:
if label.is_empty():
dialogic.current_event_idx = 0
jumped_to_label.emit({'timeline':dialogic.current_timeline, 'label':"TOP"})
jumped_to_label.emit({'timeline':dialogic.current_timeline, 'label':""})
return
## Allows label to be a variable, making the jump event dynamic
label = str(dialogic.VAR.parse_variables(label))
var idx: int = -1
while true:

View file

@ -1 +1 @@
uid://dpxn3c2bwclq7
uid://w5mnpl7oui4j