feat: complete mobile UI implementation

This commit is contained in:
shenlei
2026-09-04 19:54:33 +09:00
parent 9a4a044da5
commit b19d5b5dd3
132 changed files with 6643 additions and 180 deletions
+13 -1
View File
@@ -42,6 +42,7 @@ var _quest_button_order: Array[int] = [] # 最新在前:BINARY_RecvQuest 的
var _party_shown := false
var _party_probe: Callable = Callable()
var _screen_size_override := Vector2.ZERO # >0 时覆盖 viewport 尺寸(离线回归用)
var _mobile_mode := false
var _clock_remaining: Dictionary = {}
var _clock_labels: Dictionary = {}
var _clock_accumulator := 0.0
@@ -66,6 +67,9 @@ func set_item_sources(proto_node: Node, item_list: RefCounted, assets_root: Stri
func is_open() -> bool:
return _root != null and _root.visible
func get_mobile_window() -> Control:
return _root
func close() -> void:
if _root:
_root.visible = false
@@ -120,6 +124,13 @@ func set_party_shown(shown: bool) -> void:
_party_shown = shown
_refresh_quest_buttons()
# MobileHud supplies one compact task entry at the right side of the
# landscape HUD. Keep the quest-letter data here, but hide the desktop
# absolute-positioned buttons while mobile mode is active.
func set_mobile_mode(enabled: bool) -> void:
_mobile_mode = enabled
_update_button_visibility()
func set_screen_size_override(size: Vector2) -> void:
_screen_size_override = size
_refresh_quest_buttons()
@@ -425,4 +436,5 @@ func _start_quest(index: int) -> void:
func _update_button_visibility() -> void:
if _button_root:
_button_root.visible = _quest_buttons_visible and not _quest_buttons_suppressed and not _quest_button_data.is_empty()
_button_root.visible = not _mobile_mode and _quest_buttons_visible \
and not _quest_buttons_suppressed and not _quest_button_data.is_empty()