diff --git a/Prefabs/combinable_item.gd b/Prefabs/combinable_item.gd index 0a42570..2b47aab 100644 --- a/Prefabs/combinable_item.gd +++ b/Prefabs/combinable_item.gd @@ -73,11 +73,12 @@ func _on_body_entered(body: Node3D) -> void: # Instantiate the result of combination and free the two ingredient items func _combine(other_body: Node3D, result: PackedScene) -> void: - SweetLogger.debug("Combining {0} + {1} into {2}", [_food_item.id, Helper.find_food_item(other_body).id, result.resource_path]) + SweetLogger.info("Combining {0} + {1} into {2}", [_food_item.id, Helper.find_food_item(other_body).id, result.resource_path]) # Get Snapzone var snap_zone := _pickable.get_picked_up_by() if not snap_zone or not snap_zone.has_method("pick_up_object"): + SweetLogger.warning("{0}: combine triggered but base item is not in a snap zone, aborting", [_pickable.name]) return # Spawn the result through the server (so it replicates to every peer, diff --git a/Scenes/day_controller.gd b/Scenes/day_controller.gd index a6d9a4f..5996905 100644 --- a/Scenes/day_controller.gd +++ b/Scenes/day_controller.gd @@ -50,7 +50,7 @@ func _process(delta: float) -> void: #print("DayController: customers_at_this_time: ", customers_at_this_time) if customers_spawned < customers_at_this_time: customers_spawned += 1 - SweetLogger.debug("Spawning customer") + SweetLogger.info("Spawning customer") Signals.request_customer_spawn.emit() # If day complete if GameManager.customers_per_day == customers_served and customers_spawned == GameManager.customers_per_day: diff --git a/Stations/table.gd b/Stations/table.gd index 224d203..45b0284 100644 --- a/Stations/table.gd +++ b/Stations/table.gd @@ -147,7 +147,7 @@ func _enter_tree() -> void: sync_config.add_property(property_path) sync_config.property_set_spawn(property_path, false) sync_config.property_set_replication_mode(property_path, SceneReplicationConfig.REPLICATION_MODE_ON_CHANGE) - SweetLogger.info("DEBUG sync_config properties: {0} | root_path: {1} | authority: {2} | peer: {3}", [sync_config.get_properties(), synchronizer.root_path, get_multiplayer_authority(), multiplayer.get_unique_id()]) # temp diagnostic + SweetLogger.debug("sync_config properties: {0} | root_path: {1} | authority: {2} | peer: {3}", [sync_config.get_properties(), synchronizer.root_path, get_multiplayer_authority(), multiplayer.get_unique_id()]) func _ready() -> void: @@ -241,7 +241,6 @@ func _absorb_item_if_correct(_item: Node) -> void: # Plate: Get plate controller in child of _item (hopefully a plate XRpickable) var plate_controller = _get_plate_controller_from_item(_item) SweetLogger.debug("Plate_controller ref: {0}", [plate_controller]) - _item.print_tree_pretty() if plate_controller: # Absorm items from the plate we want @@ -361,6 +360,7 @@ func _state_end(oldState: TableState): _set_state(TableState.EMPTY) TableState.ORDERING, TableState.WAITING_PRIMARY, TableState.WAITING_FRIEND: + SweetLogger.info("{0}: order timed out in state {1}, game over", [name, TableState.keys()[oldState]]) label_3d.text = lbl_gameover GameManager.game_over() diff --git a/UI/shop_station_button.gd b/UI/shop_station_button.gd index eba9a60..b8cff53 100644 --- a/UI/shop_station_button.gd +++ b/UI/shop_station_button.gd @@ -21,7 +21,7 @@ func _process(_delta: float) -> void: func _on_button_pressed() -> void: - SweetLogger.debug("Buy {0}", [station_name]) + SweetLogger.info("Buy {0}", [station_name]) _buy_station() diff --git a/abstract/station.gd b/abstract/station.gd index 6935604..6f7ba34 100644 --- a/abstract/station.gd +++ b/abstract/station.gd @@ -20,7 +20,7 @@ var sync_config: SceneReplicationConfig var enabled: bool: # When disabled the station only updated display and sounds. get: return snap_zone.enabled set(p_enabled): - SweetLogger.info("Set enabled {0} on station {1} on client {2}", [p_enabled, name, multiplayer.get_unique_id()]) + SweetLogger.debug("Set enabled {0} on station {1} on client {2}", [p_enabled, name, multiplayer.get_unique_id()]) snap_zone.enabled = p_enabled snap_zone.set_process(p_enabled) @@ -75,7 +75,7 @@ func _on_object_dropped_handler(item: Node3D) -> void: func _apply_object_picked_up(item: Node3D) -> void: - SweetLogger.debug("Pickup: {0}", [item.name]) + SweetLogger.info("{0}: Pickup: {1}", [name, item.name]) Helper.play_sound(notification_audio, pickup_sound) on_object_picked_up(item) var food_item = Helper.find_food_item(item) @@ -85,7 +85,7 @@ func _apply_object_picked_up(item: Node3D) -> void: func _apply_object_dropped(item: Node3D) -> void: Helper.play_sound(notification_audio, drop_sound, 0.8) - SweetLogger.debug("Drop: {0}", [item.name]) + SweetLogger.info("{0}: Drop: {1}", [name, item.name]) on_object_dropped(item) var food_item = Helper.find_food_item(item) if food_item: diff --git a/global/RecipeManager.gd b/global/RecipeManager.gd index ba0d6c3..72421bc 100644 --- a/global/RecipeManager.gd +++ b/global/RecipeManager.gd @@ -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() diff --git a/global/global_key_events.gd b/global/global_key_events.gd index 870e908..85f7dd8 100644 --- a/global/global_key_events.gd +++ b/global/global_key_events.gd @@ -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()