Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix event fields not reseting #2441

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix event fields not reseting
salianifo committed Oct 15, 2024
commit aa9e5eac362d4c77e96c1332d4ac43ea35e6865c
3 changes: 3 additions & 0 deletions addons/dialogic/Modules/Character/event_character.gd
Original file line number Diff line number Diff line change
@@ -89,6 +89,9 @@ var character_identifier: String:
set(value):
character_identifier = value
character = DialogicResourceUtil.get_character_resource(value)
if not character.portraits.has(portrait):
portrait = ""
ui_update_needed.emit()

var regex := RegEx.create_from_string(r'(?<type>join|update|leave)\s*(")?(?<name>(?(2)[^"\n]*|[^(: \n]*))(?(2)"|)(\W*\((?<portrait>.*)\))?(\s*(?<transform>[^\[]*))?(\s*\[(?<shortcode>.*)\])?')

4 changes: 4 additions & 0 deletions addons/dialogic/Modules/Jump/event_jump.gd
Original file line number Diff line number Diff line change
@@ -26,6 +26,10 @@ var timeline_identifier := "":
set(value):
timeline_identifier = value
timeline = DialogicResourceUtil.get_timeline_resource(value)
if (not timeline_identifier in DialogicResourceUtil.get_label_cache().keys()
or not label_name in DialogicResourceUtil.get_label_cache()[timeline_identifier]):
label_name = ""
ui_update_needed.emit()


################################################################################
3 changes: 3 additions & 0 deletions addons/dialogic/Modules/Text/event_text.gd
Original file line number Diff line number Diff line change
@@ -32,6 +32,9 @@ var character_identifier: String:
set(value):
character_identifier = value
character = DialogicResourceUtil.get_character_resource(value)
if not character.portraits.has(portrait):
portrait = ""
ui_update_needed.emit()

var regex := RegEx.create_from_string(r'\s*((")?(?<name>(?(2)[^"\n]*|[^(: \n]*))(?(2)"|)(\W*(?<portrait>\(.*\)))?\s*(?<!\\):)?(?<text>(.|\n)*)')
var split_regex := RegEx.create_from_string(r"((\[n\]|\[n\+\])?((?!(\[n\]|\[n\+\]))(.|\n))+)")