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

@ -7,7 +7,8 @@ extends DialogicEvent
enum ConditionTypes {IF, ELIF, ELSE}
### Settings
## condition type (see [ConditionTypes]). Defaults to if.
## Condition type (see [ConditionTypes]). Defaults to if.
var condition_type := ConditionTypes.IF
## The condition as a string. Will be executed as an Expression.
var condition := ""
@ -26,24 +27,12 @@ func _execute() -> void:
var result: bool = dialogic.Expressions.execute_condition(condition)
if not result:
var idx: int = dialogic.current_event_idx
var ignore := 1
while true:
idx += 1
if not dialogic.current_timeline.get_event(idx) or ignore == 0:
break
elif dialogic.current_timeline.get_event(idx).can_contain_events:
ignore += 1
elif dialogic.current_timeline.get_event(idx) is DialogicEndBranchEvent:
ignore -= 1
dialogic.current_event_idx = get_end_branch_index()
dialogic.current_event_idx = idx-1
finish()
## only called if the previous event was an end-branch event
## return true if this event should be executed if the previous event was an end-branch event
func should_execute_this_branch() -> bool:
func _is_branch_starter() -> bool:
return condition_type == ConditionTypes.IF
@ -60,7 +49,7 @@ func _init() -> void:
# return a control node that should show on the END BRANCH node
func get_end_branch_control() -> Control:
func _get_end_branch_control() -> Control:
return load(get_script().resource_path.get_base_dir().path_join('ui_condition_end.tscn')).instantiate()
################################################################################

View file

@ -1 +1 @@
uid://doeh3g7s7d4h8
uid://g8gaor7ewun6

View file

@ -1 +1 @@
uid://b1mfu6jjyirnm
uid://bsn2cv832qlam

View file

@ -1 +1 @@
uid://bkov88asfeg1j
uid://hiahx6lrlm17

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://c60oc5r1aj6me"]
[gd_scene load_steps=2 format=3 uid="uid://dpt6fwem03sqw"]
[ext_resource type="Script" uid="uid://bkov88asfeg1j" path="res://addons/dialogic/Modules/Condition/ui_condition_end.gd" id="1_sh52m"]
[ext_resource type="Script" uid="uid://hiahx6lrlm17" path="res://addons/dialogic/Modules/Condition/ui_condition_end.gd" id="1_sh52m"]
[node name="Condition_End" type="HBoxContainer"]
offset_right = 90.0