public SlotForm(int slotsCount) { if (Current == null) { Current = this; } if (Slots == null) { SlotKeyList = new List <string>(); Slots = new Dictionary <string, SlotItem>(); } if (SyncRoot == null) { SyncRoot = new object(); } MouseLeave += StatusForm_MouseLeave; this.slotsCount = slotsCount; this.InitializeComponent(); World.Player.Backpack.Changed += Backpack_Changed; World.Player.Changed += Player_Changed; CalebConfig.LootChanged += CalebConfig_LootChanged; }
//--------------------------------------------------------------------------------------------- protected override void OnClosing(CancelEventArgs e) { World.Player.Backpack.Changed -= Backpack_Changed; World.Player.Changed -= Player_Changed; foreach (SlotItem sl in Slots.Values) { sl.DisposeCounter(); } Current = null; base.OnClosing(e); }
public static void ShowSlotForm() { if (WindowManager.GetDefaultManager().OwnedWindows.OfType <SlotForm>().Count() == 0) { WindowManager.GetDefaultManager().CreateWindow(delegate() { var f = new SlotForm(); return(f); }); } }
//--------------------------------------------------------------------------------------------- protected override void Dispose(bool disposing) { World.Player.Backpack.Changed -= Backpack_Changed; World.Player.Changed -= Player_Changed; foreach (SlotItem sl in Slots.Values) { sl.DisposeCounter(); } Current = null; base.Dispose(disposing); }