Cleanup logs, make prints more uniform.
This commit is contained in:
@@ -7,7 +7,7 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func _on_game_state_changed(new_state: GameManager.GameState) -> void:
|
||||
SweetLogger.info("game_state_changed to {0}", [GameManager.GameState.keys()[new_state]], "build_mode_controller.gd", "_on_game_state_changed")
|
||||
SweetLogger.info("Game state changed to {0}", [GameManager.GameState.keys()[new_state]], "build_mode_controller.gd", "_on_game_state_changed")
|
||||
if new_state == GameManager.GameState.BUILDING:
|
||||
despawn_unheld_pickables()
|
||||
|
||||
@@ -25,7 +25,7 @@ func despawn_unheld_pickables():
|
||||
NetworkManager.despawn_item(pickable)
|
||||
continue
|
||||
if not held_by.is_in_group("persistent_inventory"):
|
||||
SweetLogger.debug("despawn_unheld_pickables held_by: {0}, pickable: {1}", [held_by, pickable])
|
||||
SweetLogger.debug("Despawn unheld pickable held_by: {0}, pickable: {1}", [held_by, pickable])
|
||||
NetworkManager.despawn_item(pickable)
|
||||
|
||||
|
||||
|
||||
@@ -10,16 +10,16 @@ var _food_item: FoodItem
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
SweetLogger.debug("_ready(): {0}", [_pickable.name])
|
||||
SweetLogger.debug("{0} ready", [_pickable.name])
|
||||
_food_item = get_parent().get_node_or_null("FoodItem") as FoodItem
|
||||
if not _food_item:
|
||||
push_error("CombinableItem is missing FoodItem reference. must be a sibling of a FoodItem on ", get_parent().name, ".")
|
||||
SweetLogger.warning("{0} missing FoodItem reference, must be a sibling of a FoodItem", [get_parent().name])
|
||||
|
||||
if not _pickable:
|
||||
push_error("CombineZone must be a grand child of an XRToolsPickable.")
|
||||
SweetLogger.error("{0} must be a grandchild of an XRToolsPickable", [get_parent().name])
|
||||
return
|
||||
if not _food_item:
|
||||
push_error("CombineZone requires a FoodItem sibling on ", _pickable.name, ".")
|
||||
SweetLogger.warning("{0} requires a FoodItem sibling", [_pickable.name])
|
||||
return
|
||||
|
||||
# Detect items whether held (layer 17 "Held Objects") or loose
|
||||
@@ -52,12 +52,12 @@ func _on_body_entered(body: Node3D) -> void:
|
||||
if not NetworkManager.owns_world():
|
||||
return
|
||||
if _combining or body == _pickable:
|
||||
SweetLogger.debug("other is our own pickable")
|
||||
SweetLogger.debug("Other is our own pickable")
|
||||
return
|
||||
|
||||
var other := Helper.find_food_item(body)
|
||||
if not other:
|
||||
SweetLogger.debug("other is not a foodItem")
|
||||
SweetLogger.debug("Other is not a FoodItem")
|
||||
return
|
||||
|
||||
var result: PackedScene = RecipeManager.get_combination_result(_food_item.id, other.id)
|
||||
@@ -69,7 +69,7 @@ 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.debug("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()
|
||||
|
||||
@@ -6,4 +6,4 @@ extends Node
|
||||
|
||||
func _ready() -> void:
|
||||
if not turns_into:
|
||||
push_error("Cooking Error: 'turns_into' PackedScene is missing on ", name, ". Please assign a scene in the Inspector.")
|
||||
SweetLogger.warning("{0} missing turns_into reference", [name])
|
||||
|
||||
@@ -15,10 +15,10 @@ var _time_left: float = time_to_despawn
|
||||
|
||||
func _ready() -> void:
|
||||
if not _pickable:
|
||||
push_error("DespawningItem must be a grand child of an XRToolsPickable.")
|
||||
SweetLogger.error("{0} must be a grandchild of an XRToolsPickable", [name])
|
||||
return
|
||||
if not _rigid:
|
||||
push_error("DespawningItem must be a grand child of an RigidBody3D.")
|
||||
SweetLogger.error("{0} must be a grandchild of a RigidBody3D", [name])
|
||||
return
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ func _process(delta: float) -> void:
|
||||
# Count down to zero and despawn
|
||||
_time_left -= delta
|
||||
if _time_left <= 0:
|
||||
SweetLogger.debug("despawning {0}", [get_parent()])
|
||||
SweetLogger.debug("Despawning {0}", [get_parent()])
|
||||
NetworkManager.despawn_item(get_parent())
|
||||
# Stop counting: despawn_item() only queues the free, so without this we
|
||||
# keep re-reporting the same item every frame until it actually goes.
|
||||
|
||||
@@ -7,12 +7,12 @@ extends Node3D
|
||||
func _ready() -> void:
|
||||
|
||||
if not kitchen_scene:
|
||||
push_error("StationSpawner missing kitchen_scene")
|
||||
|
||||
SweetLogger.debug("initializing")
|
||||
SweetLogger.warning("{0} missing kitchen_scene reference", [name])
|
||||
|
||||
SweetLogger.debug("->[]")
|
||||
|
||||
if NetworkManager.owns_world():
|
||||
SweetLogger.debug("initializing on server")
|
||||
SweetLogger.debug("Initializing on server")
|
||||
# Later we will do procedural generation here.
|
||||
# For now we just load a scene.
|
||||
NetworkManager.call_deferred("spawn_item", kitchen_scene.resource_path, transform)
|
||||
|
||||
Reference in New Issue
Block a user