NEO-85: Apply gdformat to client scripts and tests.

pull/120/head
VinPropane 2026-05-25 13:26:22 -04:00
parent 4d32d068dc
commit bf9fd84b1c
3 changed files with 16 additions and 17 deletions

View File

@ -345,9 +345,7 @@ func _setup_cooldown_sync() -> void:
"snapshot_received", Callable(self, "_on_cooldown_snapshot_received")
)
if _hotbar_client.has_signal("loadout_changed"):
_hotbar_client.connect(
"loadout_changed", Callable(self, "_on_hotbar_loadout_changed")
)
_hotbar_client.connect("loadout_changed", Callable(self, "_on_hotbar_loadout_changed"))
_ensure_cooldown_poll_timer()
@ -849,9 +847,7 @@ func _render_target_lock_label(world: Vector3) -> void:
_target_lock_label.text = "\n".join(lines)
func _on_cast_result_received(
accepted: bool, reason_code: String, resolution: Dictionary
) -> void:
func _on_cast_result_received(accepted: bool, reason_code: String, resolution: Dictionary) -> void:
if not is_instance_valid(_cast_feedback_label):
return
if accepted:
@ -903,13 +899,17 @@ func _render_combat_target_hp_label() -> void:
return
var lock_id := _locked_target_id_from_state(_last_target_state)
if lock_id.is_empty():
_combat_target_hp_label.text = (
"Target HP: — (Tab → orange/purple dummy near spawn)"
)
_combat_target_hp_label.text = ("Target HP: — (Tab → orange/purple dummy near spawn)")
return
var row: Dictionary = {}
if is_instance_valid(_combat_targets_client) and _combat_targets_client.has_method("target_row"):
row = _combat_targets_client.call("target_row", lock_id, _combat_targets_snapshot) as Dictionary
if (
is_instance_valid(_combat_targets_client)
and _combat_targets_client.has_method("target_row")
):
row = (
_combat_targets_client.call("target_row", lock_id, _combat_targets_snapshot)
as Dictionary
)
if row.is_empty():
_combat_target_hp_label.text = "Target HP: %s" % lock_id
return
@ -1034,8 +1034,7 @@ func _request_hotbar_cast_slot(slot_index: int) -> void:
push_warning("Hotbar cast ignored: slot %d empty_slot" % slot_index)
if is_instance_valid(_cast_feedback_label):
_cast_feedback_label.text = (
"Hotbar: slot %d empty (bind ability or wait for sync)"
% (slot_index + 1)
"Hotbar: slot %d empty (bind ability or wait for sync)" % (slot_index + 1)
)
return
var ability_id: String = outcome[HotbarCastSlotResolver.KEY_ABILITY_ID] as String

View File

@ -207,9 +207,7 @@ func test_cast_result_received_emits_combat_resolution_on_accept() -> void:
got.append([accepted, reason, resolution])
)
# Act
var started: bool = bool(
c.call("request_cast", 0, "prototype_pulse", "prototype_target_alpha")
)
var started: bool = bool(c.call("request_cast", 0, "prototype_pulse", "prototype_target_alpha"))
# Assert
assert_that(started).is_true()
assert_that(got.size()).is_equal(1)

View File

@ -60,7 +60,9 @@ func test_empty_slot0_triggers_pulse_bind_once() -> void:
# Assert
assert_that(harness._hotbar_client.bind_calls.size()).is_equal(1)
assert_that(int(harness._hotbar_client.bind_calls[0][0])).is_equal(0)
assert_that(str(harness._hotbar_client.bind_calls[0][1])).is_equal(DEV_BOOTSTRAP_CAST_ABILITY_ID)
assert_that(str(harness._hotbar_client.bind_calls[0][1])).is_equal(
DEV_BOOTSTRAP_CAST_ABILITY_ID
)
func test_slot0_already_bound_skips_bootstrap() -> void: