protected virtual void ModifiySlot(ItemSlotBase item) { if (item is ItemSlot s) { s.SetCallbacks(GetSlotButtons, OnSlotRightClick, OnSlotEndDrag); } }
protected override bool OnClose(params object[] args) { itemSlot = null; Data = null; foreach (var window in windows) { window.Hide(true); } return(true); }
protected override bool OnOpen(params object[] args) { if (args.Length > 0 && args[0] is ItemSlotBase slot) { itemSlot = slot; Data = slot.Item; InitWindows(slot.Item, ItemUtility.GetContrast(slot.Item), args.Length > 1 ? args[1] as ButtonWithTextData[] : null); return(true); } return(false); }
static bool canSelect(ItemSlotBase slot) { return(slot && slot.Item && slot.Item.Model_old.DiscardAble); }