feat: complete mobile UI implementation
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
extends SceneTree
|
||||
|
||||
const GameScene = preload("res://game_scene.gd")
|
||||
const MobileUiRoot = preload("res://ui/mobile/mobile_ui_root.gd")
|
||||
|
||||
class FakeClient extends Node:
|
||||
signal entity_spawned(entity: Dictionary)
|
||||
@@ -122,3 +123,17 @@ func _run() -> void:
|
||||
_ck(true, "points_changed handled without error")
|
||||
|
||||
gs.queue_free()
|
||||
await process_frame
|
||||
|
||||
# Mobile profile uses the same scene assembly and NetPlay HUD contract, but
|
||||
# swaps only the presentation root. This also guards against accidentally
|
||||
# constructing the desktop HUD alongside the touch layer.
|
||||
ProjectSettings.set_setting("mt/ui/profile", "mobile")
|
||||
var mobile_gs: Node3D = GameScene.new()
|
||||
get_root().add_child(mobile_gs)
|
||||
await mobile_gs.setup(fc, "", "no_such_map")
|
||||
await process_frame
|
||||
_ck(mobile_gs.hud is MobileUiRoot, "mobile profile selects MobileUiRoot")
|
||||
_ck(mobile_gs.hud.input_overlay != null, "mobile profile creates touch overlay")
|
||||
mobile_gs.queue_free()
|
||||
ProjectSettings.set_setting("mt/ui/profile", "auto")
|
||||
|
||||
Reference in New Issue
Block a user