fix: 装备属性面板避让逻辑 + 多项功能更新
- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧 - inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域 - 包含其他累积的功能开发和测试文件
This commit is contained in:
@@ -7,6 +7,7 @@ const InventoryUI = preload("res://ui/inventory_ui.gd")
|
||||
|
||||
class FakeClient extends Node:
|
||||
signal inventory_changed(window: int, cell: int)
|
||||
signal item_highlighted(window: int, cell: int)
|
||||
var inv := {} # cell -> {vnum,count}
|
||||
var equip := [] # 11 x {vnum,count}
|
||||
var used := []
|
||||
@@ -78,7 +79,9 @@ func _run() -> void:
|
||||
# 填充
|
||||
var c5: Panel = iv._cells[5]
|
||||
_ck(int(c5.get_meta("vnum", 0)) == 19, "cell 5 filled vnum 19")
|
||||
_ck(c5.tooltip_text.contains("物品19"), "cell 5 tooltip has locale name")
|
||||
_ck(c5.tooltip_text.is_empty(), "inventory item has no native duplicate tooltip panel")
|
||||
_ck(String(c5.get_meta("tooltip_body", "")).contains("物品19"),
|
||||
"inventory item keeps tooltip body for the single custom panel/mobile detail")
|
||||
var c6: Panel = iv._cells[6]
|
||||
_ck(c6.has_node("count") and (c6.get_node("count") as Label).text == "3", "cell 6 shows count 3")
|
||||
_ck(int(iv._cells[91].get_meta("vnum", 0)) == 11209, "equip wear1 -> ui cell 91 filled")
|
||||
@@ -87,6 +90,9 @@ func _run() -> void:
|
||||
fc.set_inv(8, 100, 1)
|
||||
await process_frame
|
||||
_ck(int(iv._cells[8].get_meta("vnum", 0)) == 100, "cell 8 filled after inventory_changed")
|
||||
fc.item_highlighted.emit(1, 5)
|
||||
await process_frame
|
||||
_ck(bool(c5.get_meta("highlighted", false)), "GC_ITEM_SET2 highlight reaches the matching UI slot")
|
||||
|
||||
# 右键用
|
||||
iv.use(5)
|
||||
|
||||
Reference in New Issue
Block a user