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