Hello,
I'm recreating a GD4 project from the original GD3 Inventory project. Right now I'm trying to get a tooltip to appear when mouse enters inventory item. Problem is on slot.mouse_entered.connect...
Inventory.gd
const ItemSlotClass = preload("res://Scripts/ItemSlot.gd");
func _ready():
var slots = get_node("Panel/ScrollContainer/GridContainer");
for _i in range(MAX_SLOTS):
var slot = ItemSlotClass.new();
slot.mouse_entered.connect(self.mouse_enter_slot.bind([slot]));
#Can't convert argument 1 from [missing argptr, type unknown] to Object
ItemSlot.gd
extends Panel
@export var slotType := Global.SlotType.SLOT_DEFAULT;
var slotIndex;
var item = null;
var style;
func _init():
mouse_filter = Control.MOUSE_FILTER_PASS;
custom_minimum_size = Vector2(34, 34);
style = StyleBoxFlat.new();
style.set_border_width_all(2);
set('custom_styles/panel', style);
func setItem(newItem):
add_child(newItem);
item = newItem;
item.itemSlot = self;
I don't know what to look for to fix this. What am I missing?
Note: I have Inventory.gd attach to a Control node while the original is attach to a Panel, not sure if it makes a difference.
Thank you.