fix: 装备属性面板避让逻辑 + 多项功能更新
- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧 - inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域 - 包含其他累积的功能开发和测试文件
This commit is contained in:
@@ -11,6 +11,7 @@ const InventoryUI = preload("res://ui/inventory_ui.gd")
|
||||
const MouseController = preload("res://ui/mouse_controller.gd")
|
||||
|
||||
class FakeClient extends Node:
|
||||
signal quickslots_changed
|
||||
var inventory := [{"cell": 5, "vnum": 19, "count": 2}]
|
||||
var skills := [{"id": 1, "level": 5, "master": 0}, {"id": 16, "level": 3, "master": 0}]
|
||||
var quickslots := []
|
||||
@@ -28,12 +29,33 @@ class FakeClient extends Node:
|
||||
func get_quickslots() -> Array: return quickslots
|
||||
func use_skill(id: int, target: int) -> bool:
|
||||
calls.append(["use_skill", id, target]); return true
|
||||
func cast_skill(motion: int, heading: float, x: int, y: int) -> bool:
|
||||
func cast_skill(motion: int, heading: float, x: int, y: int, _arg: int = 0) -> bool:
|
||||
casts.append([motion, heading, x, y]); return true
|
||||
func quickslot_add(pos: int, kind: int, ref: int) -> bool:
|
||||
calls.append(["quickslot_add", pos, kind, ref]); return true
|
||||
calls.append(["quickslot_add", pos, kind, ref])
|
||||
quickslots = quickslots.filter(func(q): return int(q.get("pos", -1)) != pos)
|
||||
quickslots.append({"pos": pos, "type": kind, "ref": ref})
|
||||
quickslots_changed.emit()
|
||||
return true
|
||||
func quickslot_swap(a: int, b: int) -> bool:
|
||||
calls.append(["quickslot_swap", a, b]); return true
|
||||
calls.append(["quickslot_swap", a, b])
|
||||
var ai := -1
|
||||
var bi := -1
|
||||
for i in quickslots.size():
|
||||
if int(quickslots[i].get("pos", -1)) == a: ai = i
|
||||
if int(quickslots[i].get("pos", -1)) == b: bi = i
|
||||
if ai >= 0 and bi >= 0:
|
||||
var tmp: Dictionary = quickslots[ai]
|
||||
quickslots[ai] = quickslots[bi]
|
||||
quickslots[bi] = tmp
|
||||
quickslots[ai]["pos"] = a
|
||||
quickslots[bi]["pos"] = b
|
||||
elif ai >= 0:
|
||||
quickslots[ai]["pos"] = b
|
||||
elif bi >= 0:
|
||||
quickslots[bi]["pos"] = a
|
||||
quickslots_changed.emit()
|
||||
return true
|
||||
func use_item(window: int, cell: int) -> bool:
|
||||
calls.append(["use_item", window, cell]); return true
|
||||
func move_item(fw: int, fc: int, tw: int, tc: int, count: int) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user