From 70a879529add049ccfd8f29adf91f4d0a1a67ddb Mon Sep 17 00:00:00 2001 From: tonydero Date: Mon, 21 Oct 2024 13:09:51 -0600 Subject: [PATCH] fix debug_print, other odds and ends --- scripts/AbilityPlayer.gd | 1 + scripts/Globals.gd | 4 ++-- scripts/Player.gd | 7 +++---- scripts/WorldArea.gd | 8 ++++---- scripts/combat_ui_scene.gd | 14 +++++--------- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/scripts/AbilityPlayer.gd b/scripts/AbilityPlayer.gd index 2d9dee9..b6db212 100644 --- a/scripts/AbilityPlayer.gd +++ b/scripts/AbilityPlayer.gd @@ -96,6 +96,7 @@ func _get_targets_in_range(enemies) -> Array: func _apply_status() -> void: # TODO: Try passing damage and status type to target for mods, e.g. burning or stunned, and use with singleton stats to add thread to target for damage or do other things depending on the case + # unnecessary... can just use await get_tree().create_timer(time).timeout pass diff --git a/scripts/Globals.gd b/scripts/Globals.gd index 96ad293..9939615 100644 --- a/scripts/Globals.gd +++ b/scripts/Globals.gd @@ -47,6 +47,6 @@ class Ability: DOTE } -func debug_print(value) -> void: +func debug_print(value : String) -> void: if OS.is_debug_build(): - debug_print(value) + print(value) diff --git a/scripts/Player.gd b/scripts/Player.gd index cd6d80b..2ff20d7 100644 --- a/scripts/Player.gd +++ b/scripts/Player.gd @@ -18,10 +18,9 @@ func _ready() -> void: func _on_enemy_died(enemyDifficulty, enemyTier, _enemyFaction) -> void: var kill_exp = pow(pow(enemyTier + 1, 3), enemyDifficulty) area_exp += kill_exp - # if Globals.debug: - # print("T: ", enemyTier, " D: ", enemyDifficulty) - # print("K: ", kill_exp) - # print("A: ",area_exp) + # Globals.debug_print("T: " + str(enemyTier) + " D: " + str(enemyDifficulty)) + # Globals.debug_print("K: " + str(kill_exp)) + # Globals.debug_print("A: " + str(area_exp)) # TODO: maybe show earned exp on bar, separate from current # use xp to next level and current level, subtract, figure out percentage per point exp, add to display? diff --git a/scripts/WorldArea.gd b/scripts/WorldArea.gd index b7b956f..6aca2b3 100644 --- a/scripts/WorldArea.gd +++ b/scripts/WorldArea.gd @@ -73,10 +73,10 @@ func _on_spawn_timer_timeout() -> void: func _on_area_continue_pressed() -> void: $SpawnTimer.stop() - Globals.debug_print("spawn timer stopped") + # Globals.debug_print("spawn timer stopped") while get_child_count() > 1: await get_tree().create_timer(1.0).timeout - Globals.debug_print("waiting for children to go to 1 or less") - Globals.debug_print(get_child_count()) + # Globals.debug_print("waiting for children to go to 1 or less") + # Globals.debug_print(get_child_count()) self.queue_free() - Globals.debug_print("area queued tor free") + # Globals.debug_print("area queued tor free") diff --git a/scripts/combat_ui_scene.gd b/scripts/combat_ui_scene.gd index de83cfd..b9d0f51 100644 --- a/scripts/combat_ui_scene.gd +++ b/scripts/combat_ui_scene.gd @@ -1,4 +1,3 @@ -# TODO: convert to just combat UI, instancing appropriate zone/area # BUG: elements not adjusting properly when moving to second monitor extends Control @@ -35,7 +34,6 @@ func _create_area() -> void: move_child(worldArea, 0) func _on_button_test_pressed() -> void: - %DebugMenu/ButtonTest.text = "pass" pass @@ -49,23 +47,21 @@ func _continue_show() -> void: func _go_next_area() -> void: var prevAreaQuest = currentAreaQuest - # FIXME: breaks at some point? SignalBus.area_continue_pressed.emit() - Globals.debug_print("gna signal emitted") + # Globals.debug_print("gna signal emitted") %QuestsContainer.remove_child(prevAreaQuest) - Globals.debug_print("gna quest removed") + # Globals.debug_print("gna quest removed") prevAreaQuest.queue_free() - Globals.debug_print("gna quest queued to free") + # Globals.debug_print("gna quest queued to free") _create_area() - Globals.debug_print("gna new area created") - + # Globals.debug_print("gna new area created") + func _on_quest_generated(quest) -> void: currentAreaQuest = quest %QuestsContainer.add_child(currentAreaQuest) -# TODO: move all quest stuff to quest class? func _on_quest_completed() -> void: if %UITop/AutoCheck.button_pressed: _go_next_area()