NEO-122: Run gdformat on quest and economy HUD client scripts.

pull/161/head
VinPropane 2026-06-07 13:37:58 -04:00
parent 2bf4d325e1
commit 6397d81ca3
6 changed files with 8 additions and 21 deletions

View File

@ -41,7 +41,9 @@ func setup(
if _defs_client.has_signal("definitions_ready"):
_defs_client.connect("definitions_ready", Callable(self, "_on_definitions_ready"))
if _defs_client.has_signal("definitions_sync_failed"):
_defs_client.connect("definitions_sync_failed", Callable(self, "_on_definitions_sync_failed"))
_defs_client.connect(
"definitions_sync_failed", Callable(self, "_on_definitions_sync_failed")
)
_render_progress_label()
_render_accept_feedback_label()
if _defs_client.has_method("request_sync_from_server"):
@ -119,9 +121,7 @@ func _render_progress_label() -> void:
return
if _last_snapshot.is_empty():
if not _defs_error.is_empty():
_progress_label.text = (
"%s\ndefinitions error — %s\nLoading…" % [header, _defs_error]
)
_progress_label.text = ("%s\ndefinitions error — %s\nLoading…" % [header, _defs_error])
else:
_progress_label.text = "%s\nLoading…" % header
return

View File

@ -57,9 +57,7 @@ func request_accept(quest_id: String) -> bool:
_current_accept_quest_id = qid
_accept_busy = true
var payload: Dictionary = {"schemaVersion": SCHEMA_VERSION}
var url := (
"%s/game/players/%s/quests/%s/accept" % [_base_root(), _player_path_segment(), qid]
)
var url := "%s/game/players/%s/quests/%s/accept" % [_base_root(), _player_path_segment(), qid]
var headers := PackedStringArray(["Content-Type: application/json"])
var err: Error = _accept_http.request(
url, headers, HTTPClient.METHOD_POST, JSON.stringify(payload)

View File

@ -90,9 +90,7 @@ func test_populate_emits_craft_requested_for_row() -> void:
# Arrange
var panel := await _build_panel()
var captured: Array = []
panel.connect(
"craft_requested", func(recipe_id: String) -> void: captured.append(recipe_id)
)
panel.connect("craft_requested", func(recipe_id: String) -> void: captured.append(recipe_id))
panel.call("populate", _sample_recipes())
await get_tree().process_frame
var rows: VBoxContainer = panel.get_node("RecipeRows")

View File

@ -96,5 +96,3 @@ func test_viewport_layout_clamps_hud_root_scroll() -> void:
await get_tree().process_frame
# Assert
assert_that(hud_scroll.size.y).is_less(section.call("panel_top_y"))

View File

@ -17,12 +17,7 @@ func _build_controller() -> Node:
add_child(progress)
add_child(defs)
controller.call(
"setup",
progress,
defs,
progress_label,
accept_label,
Callable(self, "_noop_http_config")
"setup", progress, defs, progress_label, accept_label, Callable(self, "_noop_http_config")
)
await get_tree().process_frame
return controller

View File

@ -84,9 +84,7 @@ static func _accept_success_json() -> String:
static func _accept_deny_json() -> String:
return (
'{"schemaVersion":1,"accepted":false,"reasonCode":"prerequisite_incomplete"}'
)
return '{"schemaVersion":1,"accepted":false,"reasonCode":"prerequisite_incomplete"}'
func _make_client(sync_transport: Node, accept_transport: Node = null) -> Node: