Exemple #1
0
        private void Hotbar_Dropped(HotbarSlot sender)
        {
            if (IoCManager.Resolve<IUserInterfaceManager>().DragInfo.IsEntity) return;

            foreach (PlayerActionButton comp in (from a in slots where a is PlayerActionButton select a).ToArray())
            {
                if (comp.assignedAction == IoCManager.Resolve<IUserInterfaceManager>().DragInfo.DragAction)
                    createEmpty((int) comp.UserData);
            }

            assignAction((int) sender.UserData, IoCManager.Resolve<IUserInterfaceManager>().DragInfo.DragAction);
            IoCManager.Resolve<IUserInterfaceManager>().DragInfo.Reset();
        }
Exemple #2
0
        private void Hotbar_Dropped(HotbarSlot sender)
        {
            if (IoCManager.Resolve <IUserInterfaceManager>().DragInfo.IsEntity)
            {
                return;
            }

            foreach (PlayerActionButton comp in (from a in slots where a is PlayerActionButton select a).ToArray())
            {
                if (comp.assignedAction == IoCManager.Resolve <IUserInterfaceManager>().DragInfo.DragAction)
                {
                    createEmpty((int)comp.UserData);
                }
            }

            assignAction((int)sender.UserData, IoCManager.Resolve <IUserInterfaceManager>().DragInfo.DragAction);
            IoCManager.Resolve <IUserInterfaceManager>().DragInfo.Reset();
        }
Exemple #3
0
 private void createEmpty(int slot)
 {
     slots[slot] = new HotbarSlot(_resourceManager);
     slots[slot].UserData = slot;
     ((HotbarSlot) slots[slot]).Dropped += Hotbar_Dropped;
 }
Exemple #4
0
 private void createEmpty(int slot)
 {
     slots[slot]          = new HotbarSlot(_resourceManager);
     slots[slot].UserData = slot;
     ((HotbarSlot)slots[slot]).Dropped += Hotbar_Dropped;
 }