From 89c8f3034c43a2cad2b76bea5f8dee6b47d159a5 Mon Sep 17 00:00:00 2001 From: VinPropane Date: Sun, 14 Jun 2026 14:14:54 -0400 Subject: [PATCH] NEO-132: Fix pre-push lint (main.gd line budget, test line length). Wire economy refresh via setup callback instead of signal connect; wrap long GdUnit assert line. --- client/scripts/main.gd | 13 +++---------- client/scripts/quest_hud_controller.gd | 7 ++++++- client/test/quest_reward_hud_test.gd | 6 +++++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/client/scripts/main.gd b/client/scripts/main.gd index c470752..4c88edc 100644 --- a/client/scripts/main.gd +++ b/client/scripts/main.gd @@ -865,21 +865,14 @@ func _setup_quest_progress_sync() -> void: _quest_accept_feedback_label, Callable(self, "_apply_authority_http_config_to_client"), _quest_reward_delivery_label, - _item_defs_client + _item_defs_client, + Callable(self, "_on_quest_completion_reward_transition") ) - if _quest_hud.has_signal("quest_completion_reward_transition"): - _quest_hud.connect( - "quest_completion_reward_transition", Callable(self, "_on_quest_completion_reward_transition") - ) func _on_quest_completion_reward_transition(_quest_id: String, _summary: Dictionary) -> void: - # NEO-132: refresh economy HUD after server applies quest completion bundle. _request_inventory_refresh() - if ( - is_instance_valid(_skill_progression_client) - and _skill_progression_client.has_method("request_sync_from_server") - ): + if is_instance_valid(_skill_progression_client) and _skill_progression_client.has_method("request_sync_from_server"): _skill_progression_client.call("request_sync_from_server") diff --git a/client/scripts/quest_hud_controller.gd b/client/scripts/quest_hud_controller.gd index d92201c..fee6a64 100644 --- a/client/scripts/quest_hud_controller.gd +++ b/client/scripts/quest_hud_controller.gd @@ -26,6 +26,7 @@ var _previous_status_by_quest: Dictionary = {} var _quest_was_active_in_session: Dictionary = {} var _last_reward_quest_id: String = "" var _last_reward_summary: Dictionary = {} +var _economy_refresh_callback: Callable = Callable() func setup( @@ -35,7 +36,8 @@ func setup( accept_label: Label, apply_http_config: Callable, reward_label: Label = null, - item_defs_client: Node = null + item_defs_client: Node = null, + economy_refresh_callback: Callable = Callable() ) -> void: _progress_client = progress_client _defs_client = defs_client @@ -43,6 +45,7 @@ func setup( _progress_label = progress_label _accept_label = accept_label _reward_label = reward_label + _economy_refresh_callback = economy_refresh_callback if apply_http_config.is_valid(): apply_http_config.call(progress_client) apply_http_config.call(defs_client) @@ -210,6 +213,8 @@ func _detect_and_apply_completion_transitions(snapshot: Dictionary) -> void: _last_reward_summary = {} if not _last_reward_quest_id.is_empty() and not _last_reward_summary.is_empty(): quest_completion_reward_transition.emit(_last_reward_quest_id, _last_reward_summary) + if _economy_refresh_callback.is_valid(): + _economy_refresh_callback.call(_last_reward_quest_id, _last_reward_summary) func _quest_ids_in_render_order(snapshot: Dictionary) -> Array: diff --git a/client/test/quest_reward_hud_test.gd b/client/test/quest_reward_hud_test.gd index c656151..67f3421 100644 --- a/client/test/quest_reward_hud_test.gd +++ b/client/test/quest_reward_hud_test.gd @@ -297,4 +297,8 @@ func test_boot_completed_does_not_emit_economy_refresh_signal() -> void: # Act controller.call("_on_progress_received", _completed_gather_with_summary_snapshot()) # Assert - await assert_signal(controller).wait_until(200).is_not_emitted("quest_completion_reward_transition") + await ( + assert_signal(controller) + .wait_until(200) + .is_not_emitted("quest_completion_reward_transition") + )