feat: complete mobile UI implementation
This commit is contained in:
@@ -117,6 +117,16 @@ func _run() -> void:
|
||||
_ck((go2._node("block_party_button") as BaseButton).button_pressed, "reload: block_party button reflects bit 1<<1")
|
||||
_ck(not (go2._node("block_exchange_button") as BaseButton).button_pressed, "reload: block_exchange button off")
|
||||
go2.close()
|
||||
ui.set_mobile_mode(true)
|
||||
go2.set_mobile_mode(true)
|
||||
go2.open()
|
||||
_ck(go2.is_open() and go2._mobile_root.size == Vector2(700, 360),
|
||||
"mobile game-option window uses landscape base size")
|
||||
_ck(go2._mobile_root.get_node_or_null("MobileGameOptionScroll") is ScrollContainer,
|
||||
"mobile game-option settings are scrollable")
|
||||
go2._toggle_block(1 << 0)
|
||||
_ck(fc.last_say() == "/setblockmode 3", "mobile block toggle keeps server command")
|
||||
go2.close()
|
||||
|
||||
# ---------------- SystemMenuUI ----------------
|
||||
fc.says.clear()
|
||||
@@ -154,5 +164,28 @@ func _run() -> void:
|
||||
(sm._node("cancel_button") as BaseButton).pressed.emit()
|
||||
_ck(not sm.is_open(), "cancel_button closes menu")
|
||||
|
||||
# 移动端使用独立横屏菜单,仍复用同一组设置、帮助和服务器命令入口。
|
||||
ui.set_mobile_mode(true)
|
||||
sm.set_mobile_mode(true)
|
||||
sm.open()
|
||||
_ck(sm.is_open() and sm._mobile_root.size == Vector2(700, 330),
|
||||
"mobile system menu uses landscape base size")
|
||||
for action in ["帮助", "商城", "系统设置", "游戏设置", "选择角色", "登出", "退出游戏", "取消"]:
|
||||
_ck(sm._mobile_buttons.has(action), "mobile system menu action: " + action)
|
||||
(sm._mobile_buttons["商城"] as Button).pressed.emit()
|
||||
_ck(_has_say(fc, "/in_game_mall"), "mobile mall action -> /in_game_mall")
|
||||
_ck(not sm.is_open(), "mobile action closes menu")
|
||||
sm.open()
|
||||
(sm._mobile_buttons["系统设置"] as Button).pressed.emit()
|
||||
_ck(sys_opt.opened == 2 and not sm.is_open(),
|
||||
"mobile system option opens feature and closes menu")
|
||||
sm.open()
|
||||
(sm._mobile_buttons["游戏设置"] as Button).pressed.emit()
|
||||
_ck(game_opt.opened == 2 and not sm.is_open(),
|
||||
"mobile game option opens feature and closes menu")
|
||||
sm.open()
|
||||
(sm._mobile_buttons["取消"] as Button).pressed.emit()
|
||||
_ck(not sm.is_open(), "mobile cancel closes menu")
|
||||
|
||||
if FileAccess.file_exists(_cfg_path()):
|
||||
DirAccess.remove_absolute(_cfg_path())
|
||||
|
||||
Reference in New Issue
Block a user