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.pull/171/head
parent
63156c353f
commit
89c8f3034c
|
|
@ -865,21 +865,14 @@ func _setup_quest_progress_sync() -> void:
|
||||||
_quest_accept_feedback_label,
|
_quest_accept_feedback_label,
|
||||||
Callable(self, "_apply_authority_http_config_to_client"),
|
Callable(self, "_apply_authority_http_config_to_client"),
|
||||||
_quest_reward_delivery_label,
|
_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:
|
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()
|
_request_inventory_refresh()
|
||||||
if (
|
if is_instance_valid(_skill_progression_client) and _skill_progression_client.has_method("request_sync_from_server"):
|
||||||
is_instance_valid(_skill_progression_client)
|
|
||||||
and _skill_progression_client.has_method("request_sync_from_server")
|
|
||||||
):
|
|
||||||
_skill_progression_client.call("request_sync_from_server")
|
_skill_progression_client.call("request_sync_from_server")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ var _previous_status_by_quest: Dictionary = {}
|
||||||
var _quest_was_active_in_session: Dictionary = {}
|
var _quest_was_active_in_session: Dictionary = {}
|
||||||
var _last_reward_quest_id: String = ""
|
var _last_reward_quest_id: String = ""
|
||||||
var _last_reward_summary: Dictionary = {}
|
var _last_reward_summary: Dictionary = {}
|
||||||
|
var _economy_refresh_callback: Callable = Callable()
|
||||||
|
|
||||||
|
|
||||||
func setup(
|
func setup(
|
||||||
|
|
@ -35,7 +36,8 @@ func setup(
|
||||||
accept_label: Label,
|
accept_label: Label,
|
||||||
apply_http_config: Callable,
|
apply_http_config: Callable,
|
||||||
reward_label: Label = null,
|
reward_label: Label = null,
|
||||||
item_defs_client: Node = null
|
item_defs_client: Node = null,
|
||||||
|
economy_refresh_callback: Callable = Callable()
|
||||||
) -> void:
|
) -> void:
|
||||||
_progress_client = progress_client
|
_progress_client = progress_client
|
||||||
_defs_client = defs_client
|
_defs_client = defs_client
|
||||||
|
|
@ -43,6 +45,7 @@ func setup(
|
||||||
_progress_label = progress_label
|
_progress_label = progress_label
|
||||||
_accept_label = accept_label
|
_accept_label = accept_label
|
||||||
_reward_label = reward_label
|
_reward_label = reward_label
|
||||||
|
_economy_refresh_callback = economy_refresh_callback
|
||||||
if apply_http_config.is_valid():
|
if apply_http_config.is_valid():
|
||||||
apply_http_config.call(progress_client)
|
apply_http_config.call(progress_client)
|
||||||
apply_http_config.call(defs_client)
|
apply_http_config.call(defs_client)
|
||||||
|
|
@ -210,6 +213,8 @@ func _detect_and_apply_completion_transitions(snapshot: Dictionary) -> void:
|
||||||
_last_reward_summary = {}
|
_last_reward_summary = {}
|
||||||
if not _last_reward_quest_id.is_empty() and not _last_reward_summary.is_empty():
|
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)
|
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:
|
func _quest_ids_in_render_order(snapshot: Dictionary) -> Array:
|
||||||
|
|
|
||||||
|
|
@ -297,4 +297,8 @@ func test_boot_completed_does_not_emit_economy_refresh_signal() -> void:
|
||||||
# Act
|
# Act
|
||||||
controller.call("_on_progress_received", _completed_gather_with_summary_snapshot())
|
controller.call("_on_progress_received", _completed_gather_with_summary_snapshot())
|
||||||
# Assert
|
# 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")
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue