From 6013c08892ed66f31301aee2ad8dc6aa12d2c637 Mon Sep 17 00:00:00 2001 From: tonydero Date: Tue, 29 Oct 2024 11:39:24 -0600 Subject: [PATCH] race condition using global fade_node, removing and replacing with simple hide/show for now, will revisit --- project.godot | 12 +++++++++++- scripts/Globals.gd | 4 ++++ scripts/Quest.gd | 4 ++-- scripts/combat_ui_scene.gd | 10 ++++++---- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/project.godot b/project.godot index c6831ce..c77b3f5 100644 --- a/project.godot +++ b/project.godot @@ -40,11 +40,21 @@ enabled=PackedStringArray("res://addons/godot-vim/plugin.cfg") game_speed_fast={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":61,"key_label":0,"unicode":61,"location":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":61,"key_label":0,"unicode":43,"location":0,"echo":false,"script":null) ] } game_speed_normal={ "deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":48,"key_label":0,"unicode":48,"location":0,"echo":false,"script":null) +] +} +game_speed_faster={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":61,"key_label":0,"unicode":61,"location":0,"echo":false,"script":null) +] +} +game_speed_slower={ +"deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":45,"key_label":0,"unicode":45,"location":0,"echo":false,"script":null) ] } diff --git a/scripts/Globals.gd b/scripts/Globals.gd index 9c83f74..2274aa7 100644 --- a/scripts/Globals.gd +++ b/scripts/Globals.gd @@ -110,6 +110,10 @@ func _input(event: InputEvent) -> void: Engine.time_scale = 10.0 if event.is_action_pressed("game_speed_normal"): Engine.time_scale = 1.0 + if event.is_action_pressed("game_speed_faster"): + Engine.time_scale += 1.0 + if event.is_action_pressed("game_speed_slower"): + Engine.time_scale -= 1.0 func save_game() -> void: diff --git a/scripts/Quest.gd b/scripts/Quest.gd index d0d8cd9..9fd1ed8 100644 --- a/scripts/Quest.gd +++ b/scripts/Quest.gd @@ -34,8 +34,8 @@ func _quest_goal_check(enemyKillType: Globals.World.Faction) -> void: $QuestProgress/CompletedVal.text = str(self.goalCurrent) if self.goalCurrent == self.goalTotal: SignalBus.quest_completed.emit() - Globals.fade_node(%QuestComplete, "in", 0.1) - Globals.fade_node(%QuestProgress, "out", 0.1) + # Globals.fade_node(%QuestComplete, "in", 0.1) + # Globals.fade_node(%QuestProgress, "out", 0.1) func _generate_random_quest() -> void: diff --git a/scripts/combat_ui_scene.gd b/scripts/combat_ui_scene.gd index daf699c..0705195 100644 --- a/scripts/combat_ui_scene.gd +++ b/scripts/combat_ui_scene.gd @@ -16,7 +16,7 @@ var current_area_duration: float func _ready() -> void: if OS.is_debug_build(): %DebugMenu.show() - Engine.time_scale = 10.0 + Engine.time_scale = 60.0 SignalBus.quest_generated.connect(_on_quest_generated) SignalBus.quest_completed.connect(_on_quest_completed) @@ -57,14 +57,15 @@ func _go_next_area() -> void: %QuestsContainer.remove_child(prevAreaQuest) # Globals.debug_print("gna quest removed") # FIXME: rethink logic flow, memory/nodes leaking like a seive - # prevAreaQuest.queue_free() + prevAreaQuest.queue_free() totalAreas += 1 %AreaCountVal.text = str(totalAreas) # Globals.debug_print("gna quest queued to free") _create_area() # Globals.debug_print("gna new area created") # _continue_button_hide() - Globals.fade_node(%UITop/ContinueButton, "out", 0.1) + # Globals.fade_node(%UITop/ContinueButton, "out", 0.1) + %UITop/ContinueButton.hide() current_area_duration = 0 canContinue = false @@ -78,7 +79,8 @@ func _on_quest_completed() -> void: if %UITop/AutoCheck.button_pressed: _go_next_area() else: - Globals.fade_node(%UITop/ContinueButton, "in", 0.25) + # Globals.fade_node(%UITop/ContinueButton, "in", 0.25) + %UITop/ContinueButton.show() func _on_continue_button_pressed() -> void: