feat: complete mobile UI implementation
This commit is contained in:
@@ -15,6 +15,14 @@ class FakeClient extends Node:
|
||||
signal char_create_failed(reason: int)
|
||||
signal char_deleted(slot: int)
|
||||
signal char_delete_failed()
|
||||
var selects := []
|
||||
var reconnects := 0
|
||||
func select_character(index: int) -> bool:
|
||||
selects.append(index)
|
||||
return true
|
||||
func reconnect() -> bool:
|
||||
reconnects += 1
|
||||
return true
|
||||
|
||||
var _fail := 0
|
||||
|
||||
@@ -41,6 +49,25 @@ func _init() -> void:
|
||||
_ck(client.get_parent() == flow,
|
||||
"AppFlow keeps the same client beside lifecycle coordinator")
|
||||
|
||||
# A live game keeps its scene during a transient disconnect. ReconnectUI
|
||||
# owns the retry while the next character list silently re-enters the last
|
||||
# selected slot instead of flashing the character-select page.
|
||||
flow._game = Node.new()
|
||||
flow.add_child(flow._game)
|
||||
flow._state = AppFlow.GAME
|
||||
flow._selected_char_slot = 2
|
||||
client.disconnected.emit("wifi lost")
|
||||
_ck(flow.state() == AppFlow.GAME and flow._reconnecting_game,
|
||||
"game disconnect enters reconnecting state without leaving GAME")
|
||||
_ck(flow._reconnect != null and flow._reconnect.is_showing(),
|
||||
"game disconnect shows reconnect overlay")
|
||||
client.char_list.emit([{"index": 2, "name": "Hero"}])
|
||||
_ck(client.selects == [2], "reconnect re-enters remembered character slot")
|
||||
client.entered_game.emit()
|
||||
_ck(flow.state() == AppFlow.GAME and not flow._reconnecting_game
|
||||
and not flow._reconnect.is_showing(),
|
||||
"successful reconnect restores GAME and hides overlay")
|
||||
|
||||
flow.queue_free()
|
||||
await process_frame
|
||||
if _fail == 0:
|
||||
|
||||
Reference in New Issue
Block a user