fix(hand): scroll throttle, deselect on spin/click-outside for all card modes
- Throttle hand scroll to one step per 150 ms so each wheel tick advances exactly one card - Deselect selected card when clicking outside the hand area (deferred flag pattern so board clicks still play the card) - Extend spin and click-outside deselect to cover TERRAMORPHA_SELECT and card-triggered ABILITY_TARGET (Repentance/Instinct), not just CARD_FROM_HAND - Show Repentance/Instinct cards as visually selected in hand when in ABILITY_TARGET mode - Drop stale spectator state_update pushes from wrong sessions - Auto-create missing audio buses on Settings._ready to avoid bus-not-found errors Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -603,6 +603,12 @@ func _on_server_push(type: String, payload: Variant) -> void:
|
||||
var d := payload as Dictionary
|
||||
var s := d.get("state", {}) as Dictionary
|
||||
if not s.is_empty():
|
||||
# Drop stale spectator pushes that belong to a session we already left.
|
||||
var update_sid : String = str(s.get("sessionId", ""))
|
||||
if not session_id.is_empty() and update_sid != session_id:
|
||||
if debug_output:
|
||||
print("[Game] PUSH state_update IGNORED (wrong session): ", update_sid)
|
||||
return
|
||||
_state_version = int(s.get("stateVersion", -1))
|
||||
if debug_output:
|
||||
print("[Game] PUSH state_update phase=", s.get("phase","?"),
|
||||
|
||||
@@ -119,12 +119,22 @@ func clear_highlight_override(type: String) -> void:
|
||||
# ── Lifecycle ─────────────────────────────────────────────────────────────────
|
||||
|
||||
func _ready() -> void:
|
||||
_ensure_buses()
|
||||
_load()
|
||||
_apply_music()
|
||||
_apply_sfx()
|
||||
|
||||
# ── Internal ──────────────────────────────────────────────────────────────────
|
||||
|
||||
func _ensure_buses() -> void:
|
||||
for bus_name in [BUS_MUSIC, BUS_SFX]:
|
||||
if AudioServer.get_bus_index(bus_name) < 0:
|
||||
var idx := AudioServer.bus_count
|
||||
AudioServer.add_bus()
|
||||
AudioServer.set_bus_name(idx, bus_name)
|
||||
AudioServer.set_bus_send(idx, "Master")
|
||||
|
||||
|
||||
func _apply_music() -> void:
|
||||
var idx := AudioServer.get_bus_index(BUS_MUSIC)
|
||||
if idx < 0:
|
||||
|
||||
Reference in New Issue
Block a user