fix(ui): suppress native Godot tooltips to eliminate duplicate attribute panels
This commit is contained in:
@@ -29,6 +29,7 @@ const UiAssets = preload("res://ui/ui_assets.gd")
|
||||
const EquipRules = preload("res://equip_rules.gd")
|
||||
const ItemTooltip = preload("res://ui/item_tooltip.gd")
|
||||
const ItemTooltipView = preload("res://ui/item_tooltip_view.gd")
|
||||
const QuietPanel = preload("res://ui/quiet_panel.gd")
|
||||
const ChestSystem = preload("res://chest_system.gd")
|
||||
const ItemAttrSystem = preload("res://item_attr_system.gd")
|
||||
const MetinSocketSystem = preload("res://metin_socket_system.gd")
|
||||
@@ -260,6 +261,7 @@ func _index_cells(root: Node) -> void:
|
||||
func _wire_cells() -> void:
|
||||
for idx in _cells:
|
||||
var cell: Panel = _cells[idx]
|
||||
cell.set_script(QuietPanel)
|
||||
var cell_idx: int = int(idx)
|
||||
cell.gui_input.connect(func(e: InputEvent): _on_cell_input(cell_idx, e))
|
||||
cell.mouse_entered.connect(func(): _on_cell_mouse_entered(cell_idx))
|
||||
@@ -287,6 +289,7 @@ func _on_cell_mouse_entered(cell_idx: int) -> void:
|
||||
return
|
||||
var vnum := int(cell.get_meta("vnum", 0))
|
||||
if vnum <= 0:
|
||||
_hide_tooltip()
|
||||
return
|
||||
var count := int(cell.get_meta("count", 1))
|
||||
var instance_data: Dictionary = cell.get_meta("item_data", {})
|
||||
@@ -445,6 +448,7 @@ func _on_cell_input(ui_idx: int, e: InputEvent) -> void:
|
||||
item_context.emit(w[0], w[1])
|
||||
if context_consumer.is_valid() and bool(context_consumer.call(w[0], w[1])):
|
||||
return
|
||||
_hide_tooltip()
|
||||
use(ui_idx)
|
||||
elif e.button_index == MOUSE_BUTTON_LEFT:
|
||||
if e.pressed and vnum != 0:
|
||||
@@ -466,6 +470,7 @@ func _on_cell_input(ui_idx: int, e: InputEvent) -> void:
|
||||
if item_mouse.attach_item(wire[0], wire[1], vnum, _item_count(ui_idx),
|
||||
_icon(vnum), "inventory", metadata):
|
||||
_drag_from = -1
|
||||
_hide_tooltip()
|
||||
return
|
||||
_drag_from = ui_idx
|
||||
elif not e.pressed and _drag_from != -1:
|
||||
|
||||
Reference in New Issue
Block a user