NEO-85: Apply gdformat to client scripts and tests.
parent
4d32d068dc
commit
bf9fd84b1c
|
|
@ -345,9 +345,7 @@ func _setup_cooldown_sync() -> void:
|
||||||
"snapshot_received", Callable(self, "_on_cooldown_snapshot_received")
|
"snapshot_received", Callable(self, "_on_cooldown_snapshot_received")
|
||||||
)
|
)
|
||||||
if _hotbar_client.has_signal("loadout_changed"):
|
if _hotbar_client.has_signal("loadout_changed"):
|
||||||
_hotbar_client.connect(
|
_hotbar_client.connect("loadout_changed", Callable(self, "_on_hotbar_loadout_changed"))
|
||||||
"loadout_changed", Callable(self, "_on_hotbar_loadout_changed")
|
|
||||||
)
|
|
||||||
_ensure_cooldown_poll_timer()
|
_ensure_cooldown_poll_timer()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -849,9 +847,7 @@ func _render_target_lock_label(world: Vector3) -> void:
|
||||||
_target_lock_label.text = "\n".join(lines)
|
_target_lock_label.text = "\n".join(lines)
|
||||||
|
|
||||||
|
|
||||||
func _on_cast_result_received(
|
func _on_cast_result_received(accepted: bool, reason_code: String, resolution: Dictionary) -> void:
|
||||||
accepted: bool, reason_code: String, resolution: Dictionary
|
|
||||||
) -> void:
|
|
||||||
if not is_instance_valid(_cast_feedback_label):
|
if not is_instance_valid(_cast_feedback_label):
|
||||||
return
|
return
|
||||||
if accepted:
|
if accepted:
|
||||||
|
|
@ -903,13 +899,17 @@ func _render_combat_target_hp_label() -> void:
|
||||||
return
|
return
|
||||||
var lock_id := _locked_target_id_from_state(_last_target_state)
|
var lock_id := _locked_target_id_from_state(_last_target_state)
|
||||||
if lock_id.is_empty():
|
if lock_id.is_empty():
|
||||||
_combat_target_hp_label.text = (
|
_combat_target_hp_label.text = ("Target HP: — (Tab → orange/purple dummy near spawn)")
|
||||||
"Target HP: — (Tab → orange/purple dummy near spawn)"
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
var row: Dictionary = {}
|
var row: Dictionary = {}
|
||||||
if is_instance_valid(_combat_targets_client) and _combat_targets_client.has_method("target_row"):
|
if (
|
||||||
row = _combat_targets_client.call("target_row", lock_id, _combat_targets_snapshot) as Dictionary
|
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():
|
if row.is_empty():
|
||||||
_combat_target_hp_label.text = "Target HP: %s …" % lock_id
|
_combat_target_hp_label.text = "Target HP: %s …" % lock_id
|
||||||
return
|
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)
|
push_warning("Hotbar cast ignored: slot %d empty_slot" % slot_index)
|
||||||
if is_instance_valid(_cast_feedback_label):
|
if is_instance_valid(_cast_feedback_label):
|
||||||
_cast_feedback_label.text = (
|
_cast_feedback_label.text = (
|
||||||
"Hotbar: slot %d empty (bind ability or wait for sync)"
|
"Hotbar: slot %d empty (bind ability or wait for sync)" % (slot_index + 1)
|
||||||
% (slot_index + 1)
|
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
var ability_id: String = outcome[HotbarCastSlotResolver.KEY_ABILITY_ID] as String
|
var ability_id: String = outcome[HotbarCastSlotResolver.KEY_ABILITY_ID] as String
|
||||||
|
|
|
||||||
|
|
@ -207,9 +207,7 @@ func test_cast_result_received_emits_combat_resolution_on_accept() -> void:
|
||||||
got.append([accepted, reason, resolution])
|
got.append([accepted, reason, resolution])
|
||||||
)
|
)
|
||||||
# Act
|
# Act
|
||||||
var started: bool = bool(
|
var started: bool = bool(c.call("request_cast", 0, "prototype_pulse", "prototype_target_alpha"))
|
||||||
c.call("request_cast", 0, "prototype_pulse", "prototype_target_alpha")
|
|
||||||
)
|
|
||||||
# Assert
|
# Assert
|
||||||
assert_that(started).is_true()
|
assert_that(started).is_true()
|
||||||
assert_that(got.size()).is_equal(1)
|
assert_that(got.size()).is_equal(1)
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,9 @@ func test_empty_slot0_triggers_pulse_bind_once() -> void:
|
||||||
# Assert
|
# Assert
|
||||||
assert_that(harness._hotbar_client.bind_calls.size()).is_equal(1)
|
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(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:
|
func test_slot0_already_bound_skips_bootstrap() -> void:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue