From f7f4e22376fc14ab972b9392432347d5c7f374e9 Mon Sep 17 00:00:00 2001 From: Joey Pollack Date: Fri, 16 Aug 2024 13:20:54 -0400 Subject: [PATCH] minor adjustments to debug logging --- .gitignore | 3 ++- systems/combat/combatant/ui/combat_menu.gd | 10 ---------- systems/combat/common actions/action_attack.gd | 1 - systems/debug/debug logger/debug_logger.gd | 2 ++ testing/sandbox.gd | 5 +++++ 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index ca7d037..6d2dae5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ assets/binary files/elements_core_pack_2.14.24/ -*.zip \ No newline at end of file +*.zip +debug.log \ No newline at end of file diff --git a/systems/combat/combatant/ui/combat_menu.gd b/systems/combat/combatant/ui/combat_menu.gd index a1bbfe7..e07a0bf 100644 --- a/systems/combat/combatant/ui/combat_menu.gd +++ b/systems/combat/combatant/ui/combat_menu.gd @@ -1,11 +1 @@ extends Control - - -# Called when the node enters the scene tree for the first time. -func _ready(): - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta): - pass diff --git a/systems/combat/common actions/action_attack.gd b/systems/combat/common actions/action_attack.gd index 9b34d8d..22f1b68 100644 --- a/systems/combat/common actions/action_attack.gd +++ b/systems/combat/common actions/action_attack.gd @@ -6,7 +6,6 @@ var target: Combatant var damage: DamageSource func _init(): - print("Setting action name") name = "Attack" func execute(): diff --git a/systems/debug/debug logger/debug_logger.gd b/systems/debug/debug logger/debug_logger.gd index ef7fd57..5fee7bc 100644 --- a/systems/debug/debug logger/debug_logger.gd +++ b/systems/debug/debug logger/debug_logger.gd @@ -45,3 +45,5 @@ func dump_log_file(): var file = FileAccess.open("debug.log", FileAccess.WRITE) output.trim_suffix("\n") file.store_string(output) + file.flush() + file = null diff --git a/testing/sandbox.gd b/testing/sandbox.gd index 31282dc..fa0122e 100644 --- a/testing/sandbox.gd +++ b/testing/sandbox.gd @@ -27,3 +27,8 @@ func _ready(): # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): game_state.state_process(delta) + +func _exit_tree(): + + # TODO: Move this into the app main scene once it exists + $Debugger.debug_logger.dump_log_file()