Change log levels and add more logging

This commit is contained in:
JonShard
2026-08-20 09:53:09 +02:00
parent 06dde91468
commit 655751e5bd
7 changed files with 34 additions and 25 deletions
+22 -16
View File
@@ -20,22 +20,28 @@ static func load_recipes() -> void:
return
var yaml_available := ClassDB.class_exists("YAML")
if yaml_available:
var result = ClassDB.class_call_static("YAML", "load_file", recipe_path)
if result != null and not result.has_error():
var data = result.get_data()
if typeof(data) != TYPE_DICTIONARY:
SweetLogger.warning("YAML addon parsed recipes.yaml but returned an unsupported structure")
_recipes = data
_build_scene_paths()
_build_combining_map()
_build_cooking_map()
_build_chopping_map()
_build_rolling_map()
_build_augmenting_map()
_loaded = true
if not yaml_available:
SweetLogger.error("YAML addon is not available, recipes.yaml can not be loaded")
return
var result = ClassDB.class_call_static("YAML", "load_file", recipe_path)
if result == null or result.has_error():
SweetLogger.error("Failed to parse recipes.yaml: {0}", [result.get_error_message() if result else "null result"])
return
var data = result.get_data()
if typeof(data) != TYPE_DICTIONARY:
SweetLogger.warning("YAML addon parsed recipes.yaml but returned an unsupported structure")
_recipes = data
_build_scene_paths()
_build_combining_map()
_build_cooking_map()
_build_chopping_map()
_build_rolling_map()
_build_augmenting_map()
_loaded = true
#print_all_recipes()
static func get_combination_result(first_id: StringName, second_id: StringName) -> PackedScene:
load_recipes()
+3 -1
View File
@@ -15,13 +15,15 @@ func _unhandled_input(event: InputEvent) -> void:
# Kill all clients
@rpc("any_peer", "call_local", "reliable")
func all_quit_game():
SweetLogger.info("Quit game requested, killing all clients")
get_tree().quit()
# Finds any node of class/type Table and calls satisfyAllOrders()
func satisfy_table_orders() -> void:
SweetLogger.info("Debug: satisfying all table orders")
# Searches all nodes in the current running scene matching the class "Table"
var table_nodes = get_tree().root.find_children("*", "Table", true, false)
for node in table_nodes:
if node.has_method("satisfyAllOrders"):
node.satisfyAllOrders()