Exemplo n.º 1
0
 private void Event_KeyPressed(Keys key)
 {
     if (Data.SlotLockHotkey.ToBool)
     {
         SlotLock.Entry(key);
     }
     if (Data.SlotSwitchHotkey.ToBool)
     {
         SlotSwitch.Entry(key);
     }
     if (Data.SmartStorageHotkey.ToBool)
     {
         SmartStorage.Entry(key);
     }
     if (Data.QuickStackHotkey.ToBool)
     {
         QuickStack.Entry(key);
     }
     if (Data.ModMenuKeyHotkey.ToBool)
     {
         ModMenu.Entry(key);
     }
 }
Exemplo n.º 2
0
        public static void Clicked(ClickableButton button)
        {
            switch (button.Name)
            {
            case "Move Up":
            {
                var menu = (ItemGrabMenu)Menu.Get;
                if (menu.source != ItemGrabMenu.source_chest)
                {
                    return;
                }
                var invChest  = menu.GetPrivateField <InventoryMenu>("ItemsToGrabMenu");
                var invPlayer = menu.inventory;
                SmartStorage.TakeToChest(invPlayer, invChest);
                break;
            }

            case "Move Down":
            {
                var menu = (ItemGrabMenu)Menu.Get;
                if (menu.source != ItemGrabMenu.source_chest)
                {
                    return;
                }
                var invChest  = menu.GetPrivateField <InventoryMenu>("ItemsToGrabMenu");
                var invPlayer = menu.inventory;
                SmartStorage.TakeToPlayer(invPlayer, invChest);
                break;
            }

            case "Stack Up":
            {
                var menu = (ItemGrabMenu)Menu.Get;
                if (menu.source != ItemGrabMenu.source_chest)
                {
                    return;
                }
                var invChest  = menu.GetPrivateField <InventoryMenu>("ItemsToGrabMenu");
                var invPlayer = menu.inventory;
                SmartStorage.StockToChest(invPlayer, invChest);
                break;
            }

            case "Stack Down":
            {
                var menu = (ItemGrabMenu)Menu.Get;
                if (menu.source != ItemGrabMenu.source_chest)
                {
                    return;
                }
                var invChest  = menu.GetPrivateField <InventoryMenu>("ItemsToGrabMenu");
                var invPlayer = menu.inventory;
                SmartStorage.StockToPlayer(invPlayer, invChest);
                break;
            }

            case "Quick Stack":
            {
                QuickStack.Entry(Keys.None);
                break;
            }

            case "Display Menu":
            {
                ModMenu.Show();
                break;
            }

            case "Key":
            {
                break;
            }

            case "Warning":
            {
                break;
            }

            case "Lock":
            {
                SlotLock.Entry(Keys.None);
                break;
            }

            case "Tab Up":
            {
                SlotSwitch.MoveForward();
                break;
            }

            case "Tab Down":
            {
                break;
            }

            case "Tab 1":
            {
                SlotSwitch.MoveSecond();
                break;
            }

            case "Tab 2":
            {
                SlotSwitch.MoveThird();
                break;
            }
            }
        }