Exemple #1
0
        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;
        }
Exemple #2
0
        //---------------------------------------------------------------------------------------------

        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);
        }
Exemple #3
0
 public static void ShowSlotForm()
 {
     if (WindowManager.GetDefaultManager().OwnedWindows.OfType <SlotForm>().Count() == 0)
     {
         WindowManager.GetDefaultManager().CreateWindow(delegate()
         {
             var f = new SlotForm();
             return(f);
         });
     }
 }
Exemple #4
0
        //---------------------------------------------------------------------------------------------

        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);
        }