Implement playable Mac client and rendering validation
This commit is contained in:
@@ -84,6 +84,36 @@ func start(assets_root: String = "", injected_client: Node = null) -> void:
|
||||
func state() -> int:
|
||||
return _state
|
||||
|
||||
# Read-only adapter for the packaged playable test. It deliberately returns
|
||||
# summaries rather than the private UI/game nodes so a report cannot retain a
|
||||
# stale scene reference across reconnect or map reload.
|
||||
func get_playable_snapshot() -> Dictionary:
|
||||
var stage := "LOGIN"
|
||||
match _state:
|
||||
SELECT: stage = "SELECT"
|
||||
GAME: stage = "GAME"
|
||||
var selected: Dictionary = {}
|
||||
for character in _chars:
|
||||
if int(character.get("index", -1)) == _selected_char_slot:
|
||||
selected = {"index": _selected_char_slot, "name_present": not String(character.get("name", "")).is_empty()}
|
||||
break
|
||||
var scene_ready := false
|
||||
var map_key := ""
|
||||
if _game != null and is_instance_valid(_game) and _game.has_method("get_playable_context"):
|
||||
var context: Dictionary = _game.get_playable_context()
|
||||
scene_ready = bool(context.get("scene_ready", false))
|
||||
map_key = String(context.get("map_path", ""))
|
||||
return {"stage": stage, "selected_character": selected,
|
||||
"character_count": _chars.size(), "scene_ready": scene_ready,
|
||||
"map_key": map_key, "reconnecting": _reconnecting_game}
|
||||
|
||||
# Internal test adapter: callers must treat returned Node references as
|
||||
# borrowed and reacquire them after every scene/reconnect transition.
|
||||
func get_playable_context() -> Dictionary:
|
||||
if _game == null or not is_instance_valid(_game) or not _game.has_method("get_playable_context"):
|
||||
return {}
|
||||
return _game.get_playable_context()
|
||||
|
||||
# --- client 信号 -------------------------------------------------------------
|
||||
|
||||
func _wire_client() -> void:
|
||||
|
||||
Reference in New Issue
Block a user