fix: 装备属性面板避让逻辑 + 多项功能更新
- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧 - inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域 - 包含其他累积的功能开发和测试文件
This commit is contained in:
@@ -177,9 +177,10 @@ func sell(inv_cell: int, count: int = -1) -> void:
|
||||
_request_sell(payload, amount)
|
||||
|
||||
func _drop_to_sell(payload: Dictionary) -> bool:
|
||||
if _mode != 2 and not (item_mouse and item_mouse.has_method("is_attached") and item_mouse.is_attached()):
|
||||
# 在购买模式下若直接拖拽道具到商店窗口,同样允许触发卖出
|
||||
pass
|
||||
# uishop.py only exposes the sell target after switching to sell mode. A
|
||||
# drag during buy mode must be rejected without sending CG_SHOP SELL/SELL2.
|
||||
if _mode != 2:
|
||||
return false
|
||||
if payload.is_empty() or int(payload.get("window", -1)) != 1:
|
||||
return false
|
||||
var cell := int(payload.get("cell", -1))
|
||||
@@ -419,9 +420,9 @@ func _slot(it: Dictionary, pos: int) -> Button:
|
||||
slot.add_child(count_lbl)
|
||||
|
||||
if _tooltip_builder:
|
||||
var pd: Dictionary = proto.item(vnum) if proto and proto.has_method("item") else {}
|
||||
slot.tooltip_text = _tooltip_builder.format(vnum, maxi(1, count), pd, it)
|
||||
slot.tooltip_text += "\n价格:%d" % int(it.get("price", 0))
|
||||
# The shared ItemTooltipView is the only item-attribute panel owner.
|
||||
# Keeping a native Control tooltip here creates a second popup on hover.
|
||||
slot.tooltip_text = ""
|
||||
|
||||
slot.mouse_entered.connect(func(): _show_slot_tooltip(vnum, maxi(1, count), it))
|
||||
slot.mouse_exited.connect(func(): _hide_slot_tooltip())
|
||||
|
||||
Reference in New Issue
Block a user