feat: complete mobile UI implementation
This commit is contained in:
@@ -97,8 +97,29 @@ func _run() -> void:
|
||||
_ck(iv._drop_mouse_item({"window": 1, "cell": 6, "vnum": 27, "count": 3}, 8),
|
||||
"mouse drop accepts inventory stack")
|
||||
_ck(fc.moved.size() == 2 and fc.moved[1] == [1, 6, 1, 8, 3],
|
||||
"mouse drop preserves attached stack count")
|
||||
"mouse drop preserves attached stack count")
|
||||
|
||||
iv.close()
|
||||
_ck(not iv.is_open(), "window closed")
|
||||
|
||||
# 移动端长按详情与数量输入:不依赖右键、悬停或 PC SpinBox 微小箭头。
|
||||
ui.set_mobile_mode(true)
|
||||
iv.set_mobile_mode(true)
|
||||
iv.open()
|
||||
var long_down := InputEventScreenTouch.new()
|
||||
long_down.index = 31
|
||||
long_down.pressed = true
|
||||
long_down.position = Vector2(20, 20)
|
||||
iv._on_cell_input(6, long_down)
|
||||
await create_timer(0.65).timeout
|
||||
_ck(iv._mobile_detail_dialog != null, "mobile long-press detail opens")
|
||||
_ck(ui.top() == iv._mobile_detail_dialog, "detail is a modal window above inventory")
|
||||
ui.close_top()
|
||||
_ck(iv._mobile_detail_dialog == null, "mobile detail closes with back")
|
||||
iv._ask_count("丢弃数量", 3, func(_amount): pass)
|
||||
var count_dialog: Control = ui.top()
|
||||
_ck(count_dialog != null and count_dialog.get_node_or_null("CountInput") is LineEdit,
|
||||
"mobile count dialog uses numeric LineEdit")
|
||||
ui.close_top()
|
||||
iv.close()
|
||||
ui.queue_free()
|
||||
|
||||
Reference in New Issue
Block a user