Skip to content

Commit

Permalink
Fix No One setting being ignored in text event (#1542)
Browse files Browse the repository at this point in the history
When having set a character for the text event (in visual editor), setting it to No One again didn't work, because character_from_directory didn't deal with an empty string correctly.
  • Loading branch information
Jowan-Spooner authored Apr 30, 2023
1 parent 069d1e1 commit ceeca00
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions addons/dialogic/Events/Text/event_text.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ var _character_from_directory: String:
return item
break
return _character_from_directory
set(value):
set(value):
_character_from_directory = value
if value in _character_directory.keys():
if value.is_empty():
character = null
elif value in _character_directory.keys():
character = _character_directory[value]['resource']

## Used by [_character_from_directory] to fetch the unique name_identifier or resource.
var _character_directory: Dictionary = {}

Expand Down Expand Up @@ -122,7 +125,7 @@ func to_text() -> String:
var text_to_use := text.replace('\n', '\\\n')
text_to_use = text_to_use.replace(':', '\\:')
if character:
var name = ""
var name := ""
for path in _character_directory.keys():
if _character_directory[path]['resource'] == character:
name = path
Expand Down

0 comments on commit ceeca00

Please sign in to comment.