From d2a4b62551d19e06350f2268b71dacc9a0f4671e Mon Sep 17 00:00:00 2001 From: Jowan <42868150+Jowan-Spooner@users.noreply.github.com> Date: Tue, 9 Jul 2024 12:06:52 +0200 Subject: [PATCH] Fix mirror and z_index not being saved on Join event (#2334) * Fix mirror and z-index not being saved on join event * Fix warning from Variant assignment --- addons/dialogic/Modules/Character/event_character.gd | 5 +++++ addons/dialogic/Modules/Core/subsystem_input.gd | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/dialogic/Modules/Character/event_character.gd b/addons/dialogic/Modules/Character/event_character.gd index c4cde0e6c..1294d51e0 100644 --- a/addons/dialogic/Modules/Character/event_character.gd +++ b/addons/dialogic/Modules/Character/event_character.gd @@ -238,6 +238,11 @@ func to_text() -> String: if action == Actions.JOIN or (action == Actions.UPDATE and set_transform): result_string += " " + str(transform) + # SETS: + if action == Actions.JOIN or action == Actions.LEAVE: + set_mirrored = mirrored != default_values.get("mirrored", false) + set_z_index = z_index != default_values.get("z_index", 0) + var shortcode := store_to_shortcode_parameters() if shortcode != "": diff --git a/addons/dialogic/Modules/Core/subsystem_input.gd b/addons/dialogic/Modules/Core/subsystem_input.gd index fe6beed71..1c21f695f 100644 --- a/addons/dialogic/Modules/Core/subsystem_input.gd +++ b/addons/dialogic/Modules/Core/subsystem_input.gd @@ -109,7 +109,7 @@ func _input(event:InputEvent) -> void: func is_input_pressed(event: InputEvent, exact := false) -> bool: - var action := ProjectSettings.get_setting(_SETTING_INPUT_ACTION, _SETTING_INPUT_ACTION_DEFAULT) + var action: String = ProjectSettings.get_setting(_SETTING_INPUT_ACTION, _SETTING_INPUT_ACTION_DEFAULT) return (event is InputEventAction and event.action == action) or Input.is_action_just_pressed(action, exact)