Esempio n. 1
0
        public ModMenu()
        {
            Main.MasterMenuPool.Add(this.mainMenu);
            this.AddMenuSaveInventory(this.mainMenu);
            this.AddMenuLoadInventory(this.mainMenu);
            this.AddMenuSaveWeapons(this.mainMenu);
            this.AddMenuLoadWeapons(this.mainMenu);
            this.AddMenuRegisterVehicle(this.mainMenu);
            this.AddMenuSaveVehicle(this.mainMenu);
            this.AddMenuLoadVehicle(this.mainMenu);
            this.AddMenuSaveGroup(this.mainMenu);
            this.AddMenuLoadGroup(this.mainMenu);
            UIResRectangle rectangle1 = new UIResRectangle();

            rectangle1.Color = Color.FromArgb(0xff, Color.DarkRed);
            UIResRectangle rectangle = rectangle1;

            this.mainMenu.SetBannerType(rectangle);
            Main.MasterMenuPool.RefreshIndex();
            base.Tick    += new EventHandler(this.OnTick);
            base.KeyDown += delegate(object o, KeyEventArgs e) {
                if (((e.KeyCode == Main.MenuKey) && Main.ModActive) && !Main.MasterMenuPool.IsAnyMenuOpen())
                {
                    this.mainMenu.Visible = !this.mainMenu.Visible;
                }
            };
        }
Esempio n. 2
0
        public ObjectPlacingMenu() : base("", "Objects", new Point(0, -107))
        {
            var rectangle = new UIResRectangle();

            rectangle.Color = Color.FromArgb(0, 0, 0, 0);
            SetBannerType(rectangle);
            DisableInstructionalButtons(true);
            MouseControlsEnabled = false;
            ResetKey(UIMenu.MenuControls.Back);
            SetKey(UIMenu.MenuControls.Back, Control.FrontendPauseAlternate);

            List <dynamic> localizedCategories = new List <dynamic>();

            foreach (var item in categories)
            {
                if (Game.DoesGXTEntryExist(item))
                {
                    localizedCategories.Add(Game.GetGXTEntry(item));
                }
                else
                {
                    localizedCategories.Add(item);
                }
            }

            CategoryItem = new UIMenuListItem(Game.GetGXTEntry("FMMC_MTYPE2"), localizedCategories, currentCategoryIndex);
            CategoryItem.OnListChanged += (_, index) =>
            {
                currentCategoryIndex = index;
                Rebuild();
            };

            Rebuild();
        }
Esempio n. 3
0
        public ModMenu()
        {
            mainMenu = new UIMenu("Undead Streets", "");
            Main.MasterMenuPool.Add(mainMenu);
            AddMenuSaveInventory(mainMenu);
            AddMenuLoadInventory(mainMenu);
            AddMenuSaveWeapons(mainMenu);
            AddMenuLoadWeapons(mainMenu);
            AddMenuRegisterVehicle(mainMenu);
            AddMenuSaveVehicle(mainMenu);
            AddMenuLoadVehicle(mainMenu);
            AddMenuSaveGroup(mainMenu);
            AddMenuLoadGroup(mainMenu);
            var banner = new UIResRectangle
            {
                Color = Color.FromArgb(255, Color.DarkRed)
            };

            mainMenu.SetBannerType(banner);
            Main.MasterMenuPool.RefreshIndex();
            Tick    += OnTick;
            KeyDown += (o, e) =>
            {
                if (e.KeyCode == Main.MenuKey && Main.ModActive == true && !Main.MasterMenuPool.IsAnyMenuOpen())
                {
                    mainMenu.Visible = !mainMenu.Visible;
                }
            };
        }
Esempio n. 4
0
        private void DrawPlayerRec(Player player, float x, float y)
        {
            int r, g, b;

            Util.GetPlayerRGBColor(player, out r, out g, out b);
            UIResRectangle playerRec = new UIResRectangle(new PointF(x, y), new SizeF(SCOREBOARD_LENGTH, PLAYERITEM_HEIGHT), Color.FromArgb(120, r, g, b));

            playerRec.Draw();
        }
Esempio n. 5
0
        public ClassicChat()
        {
            CurrentInput   = "";
            _mainScaleform = new Scaleform("multiplayer_chat");
            _messages      = new List <Tuple <string, Color> >();


            _inputboxRectangle       = new UIResRectangle(new Point(20, 280), new Size(600, 35), Color.FromArgb(150, 60, 60, 60));
            _inputboxBorderRectangle = new UIResRectangle(new Point(20 - borderWidth, 280 - borderWidth), new Size(600 + borderWidth * 2, 35 + borderWidth * 2), Color.FromArgb(200, 0, 0, 0));
            _inputboxText            = new UIResText("", new Point(24, 282), 0.45f, Color.White);
        }
Esempio n. 6
0
        private void DrawTitle()
        {
            UIResRectangle titleRec = new UIResRectangle(new PointF(POS_X, POS_Y), new SizeF(SCOREBOARD_LENGTH, TITLE_HEIGHT), Color.FromArgb(220, 0, 0, 0));

            titleRec.Draw();

            int       playerAmount = Players.Count();
            UIResText titleText    = new UIResText($"{playerAmount} Players", new PointF(POS_X + 5f, POS_Y + 2f), 0.4f);

            titleText.Draw();
        }
Esempio n. 7
0
        public Helptip(string text, int duration)
        {
            _timeStarted = DateTime.Now;
            Time         = duration;

            Point safe = UIMenu.GetSafezoneBounds();

            _text = new UIResText(FormatDescription(text, 400), new Point(safe.X + 10, safe.Y + 5), 0.38f);

            _bg = new UIResRectangle(new Point(safe.X, safe.Y), new Size(410, 37), Color.FromArgb(200, 0, 0, 0));

            Visible = true;
        }
Esempio n. 8
0
        public PlayerGroup()
        {
            Main.MasterMenuPool.Add(this.mainMenu);
            this.AddMenuTasks(this.mainMenu);
            this.AddMenuApplyToPed(this.mainMenu);
            this.AddMenuApplyToAll(this.mainMenu);
            UIResRectangle rectangle1 = new UIResRectangle();

            rectangle1.Color = Color.FromArgb(0xff, Color.Purple);
            UIResRectangle rectangle = rectangle1;

            this.mainMenu.SetBannerType(rectangle);
            Main.MasterMenuPool.RefreshIndex();
            base.Tick += new EventHandler(this.OnTick);
        }
        public void AddMaterialsSubMenu(UIMenu menu)
        {
            materialsSubMenu = Main.MasterMenuPool.AddSubMenu(menu, "Materials", "See what materials that can be used for crafting you are carrying");
            var banner = new UIResRectangle
            {
                Color = Color.FromArgb(255, Color.DarkGreen)
            };

            materialsSubMenu.SetBannerType(banner);
            for (int i = 0; i < playerMaterialInventory.Count; i++)
            {
                materialsSubMenu.AddItem(new UIMenuItem(playerMaterialInventory[i].Name, playerMaterialInventory[i].Description));
                materialsSubMenu.MenuItems[materialsSubMenu.MenuItems.Count - 1].SetRightLabel("(" + playerMaterialInventory[i].Amount + "/" + playerMaterialInventory[i].MaxAmount + ")");
            }
        }
Esempio n. 10
0
        public void AddMaterialsSubMenu(UIMenu menu)
        {
            materialsSubMenu = Main.MasterMenuPool.AddSubMenu(menu, "Materials", "See what materials that can be used for crafting you are carrying");
            UIResRectangle rectangle1 = new UIResRectangle();

            rectangle1.Color = Color.FromArgb(0xff, Color.DarkGreen);
            UIResRectangle rectangle = rectangle1;

            materialsSubMenu.SetBannerType(rectangle);
            for (int i = 0; i < playerMaterialInventory.Count; i++)
            {
                materialsSubMenu.AddItem(new UIMenuItem(playerMaterialInventory[i].Name, playerMaterialInventory[i].Description));
                object[] objArray1 = new object[] { "(", playerMaterialInventory[i].Amount, "/", playerMaterialInventory[i].MaxAmount, ")" };
                materialsSubMenu.MenuItems[materialsSubMenu.MenuItems.Count - 1].SetRightLabel(string.Concat(objArray1));
            }
        }
        public PlayerGroup()
        {
            mainMenu = new UIMenu("Manage Group", "");
            Main.MasterMenuPool.Add(mainMenu);
            AddMenuTasks(mainMenu);
            AddMenuApplyToPed(mainMenu);
            AddMenuApplyToAll(mainMenu);
            var banner = new UIResRectangle
            {
                Color = Color.FromArgb(255, Color.Purple)
            };

            mainMenu.SetBannerType(banner);
            Main.MasterMenuPool.RefreshIndex();
            Tick += OnTick;
        }
Esempio n. 12
0
        public StartMenu()
        {
            this.AddMenuRunners(this.mainMenu);
            this.AddMenuGender(this.mainMenu);
            this.AddMenuStart(this.mainMenu);
            UIResRectangle rectangle1 = new UIResRectangle();

            rectangle1.Color = Color.FromArgb(0xff, Color.DarkRed);
            UIResRectangle rectangle = rectangle1;

            this.mainMenu.SetBannerType(rectangle);
            Main.MasterMenuPool.Add(this.mainMenu);
            Main.MasterMenuPool.RefreshIndex();
            base.Tick    += new EventHandler(this.OnTick);
            base.KeyDown += delegate(object o, KeyEventArgs e) {
                if (((e.KeyCode == Main.MenuKey) && !Main.ModActive) && !Main.MasterMenuPool.IsAnyMenuOpen())
                {
                    this.mainMenu.Visible = !this.mainMenu.Visible;
                }
            };
        }
        public StartMenu()
        {
            mainMenu = new UIMenu("Undead Streets", "Starting Settings");
            AddMenuRunners(mainMenu);
            AddMenuGender(mainMenu);
            AddMenuStart(mainMenu);
            var banner = new UIResRectangle
            {
                Color = Color.FromArgb(255, Color.DarkRed)
            };

            mainMenu.SetBannerType(banner);
            Main.MasterMenuPool.Add(mainMenu);
            Main.MasterMenuPool.RefreshIndex();
            Tick    += OnTick;
            KeyDown += (o, e) =>
            {
                if (e.KeyCode == Main.MenuKey && Main.ModActive == false && !Main.MasterMenuPool.IsAnyMenuOpen())
                {
                    mainMenu.Visible = !mainMenu.Visible;
                }
            };
        }
        public Inventory()
        {
            Tick += OnTick;
            playerItemInventory.Add(bottleWater);
            playerItemInventory.Add(bottleSoda);
            playerItemInventory.Add(chocolateBar);
            playerItemInventory.Add(canFood);
            playerItemInventory.Add(cookedMeat);
            playerMaterialInventory.Add(metal);
            playerMaterialInventory.Add(wood);
            playerMaterialInventory.Add(plastic);
            playerMaterialInventory.Add(rawMeat);
            inventoryMenu     = new UIMenu("Inventory", "");
            craftCampfireMenu = new UIMenu("Campfire Crafting", "");
            AddItemsSubMenu(inventoryMenu);
            AddMaterialsSubMenu(inventoryMenu);
            AddCraftingCooking(craftCampfireMenu);
            UIResRectangle uIResRectangle = new UIResRectangle();
            var            banner         = uIResRectangle;

            banner.Color = Color.FromArgb(255, Color.Yellow);
            inventoryMenu.SetBannerType(banner);
            var banner2 = uIResRectangle;

            banner2.Color = Color.FromArgb(255, Color.OrangeRed);
            craftCampfireMenu.SetBannerType(banner2);
            Main.MasterMenuPool.Add(inventoryMenu);
            Main.MasterMenuPool.Add(craftCampfireMenu);
            Main.MasterMenuPool.RefreshIndex();
            KeyDown += (o, e) =>
            {
                if (e.KeyCode == Main.InventoryKey && Main.ModActive == true && !Main.MasterMenuPool.IsAnyMenuOpen())
                {
                    inventoryMenu.Visible = !inventoryMenu.Visible;
                }
            };
        }
Esempio n. 15
0
        public Inventory()
        {
            base.Tick += new EventHandler(this.OnTick);
            playerItemInventory.Add(bottleWater);
            playerItemInventory.Add(bottleSoda);
            playerItemInventory.Add(chocolateBar);
            playerItemInventory.Add(canFood);
            playerItemInventory.Add(cookedMeat);
            playerMaterialInventory.Add(metal);
            playerMaterialInventory.Add(wood);
            playerMaterialInventory.Add(plastic);
            playerMaterialInventory.Add(rawMeat);
            inventoryMenu     = new UIMenu("Inventory", "");
            craftCampfireMenu = new UIMenu("Campfire Crafting", "");
            this.AddItemsSubMenu(inventoryMenu);
            this.AddMaterialsSubMenu(inventoryMenu);
            this.AddCraftingCooking(craftCampfireMenu);
            UIResRectangle rectangle  = new UIResRectangle();
            UIResRectangle rectangle2 = rectangle;

            rectangle2.Color = Color.FromArgb(0xff, Color.DarkGreen);
            inventoryMenu.SetBannerType(rectangle2);
            UIResRectangle rectangle3 = rectangle;

            rectangle3.Color = Color.FromArgb(0xff, Color.OrangeRed);
            craftCampfireMenu.SetBannerType(rectangle3);
            Main.MasterMenuPool.Add(inventoryMenu);
            Main.MasterMenuPool.Add(craftCampfireMenu);
            Main.MasterMenuPool.RefreshIndex();
            this.KeyDown += delegate(object o, KeyEventArgs e) {
                if (((e.KeyCode == Main.InventoryKey) && Main.ModActive) && !Main.MasterMenuPool.IsAnyMenuOpen())
                {
                    inventoryMenu.Visible = !inventoryMenu.Visible;
                }
            };
        }
Esempio n. 16
0
        public SpawnListMenu(string title, List <string> modelNameList) : base("", title, new Point(0, -107))
        {
            var rectangle = new UIResRectangle();

            rectangle.Color = Color.FromArgb(0, 0, 0, 0);
            SetBannerType(rectangle);
            DisableInstructionalButtons(true);
            ResetKey(UIMenu.MenuControls.Back);
            SetKey(UIMenu.MenuControls.Back, Control.FrontendPauseAlternate);

            foreach (var item in modelNameList)
            {
                string gxtLabel;
                bool   ok = ItemDatabase.PropGxtDB.TryGetValue(item, out gxtLabel);
                if (ok)
                {
                    AddItem(new UIMenuItem(Game.GetGXTEntry(gxtLabel)));
                }
                else
                {
                    AddItem(new UIMenuItem(item));
                }
            }
        }
        public InteractionMenu()
        {
            Instance = this;



            EventHandlers["PhoneLookAt"] += new Action(async() =>
            {
                API.TaskStartScenarioInPlace(Game.PlayerPed.Handle, "WORLD_HUMAN_STAND_MOBILE", 0, true);
                await Delay(3000);
                Game.PlayerPed.Task.ClearAll();
            });


            _interactionMenuPool = new ModifiedMenuPool();
            var banner = new UIResRectangle();

            banner.Color     = Color.FromArgb(160, 30, 30, 30);
            _interactionMenu = new UIMenu("Interaction Menu", "A menu to intereact with the world!", new PointF(5, Screen.Height / 2));
            _interactionMenu.Title.Centered          = true;
            _interactionMenu.MouseEdgeEnabled        = false;
            _interactionMenu.ControlDisablingEnabled = true;
            var animationsButton = new UIMenuItem("Animations Menu", "Browse all the animations!");

            _interactionMenu.AddItem(animationsButton);

            var phoneMenu          = _interactionMenuPool.AddSubMenuOffset(_interactionMenu, "Phone", "Access your phone.", new PointF(5, Screen.Height / 2));
            var emergencyButton    = new UIMenuItem("(911) Emergency Call");
            var nonEmergencyButton = new UIMenuItem("(311) Non Emergency Call");
            var textButton         = new UIMenuItem("Text Somebody", "Use thier server ID or actual phone number");
            var tweetButton        = new UIMenuItem("Post to Twitter");
            var torButton          = new UIMenuItem("Post to TOR");
            var advertButton       = new UIMenuItem("Post to craigslist");

            phoneMenu.AddItem(emergencyButton);
            phoneMenu.AddItem(nonEmergencyButton);
            phoneMenu.AddItem(textButton);
            phoneMenu.OnItemSelect += delegate(UIMenu sender, UIMenuItem item, int index)
            {
                if (item == emergencyButton)
                {
                    _interactionMenuPool.CloseAllMenus();
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
                    Utility.Instance.KeyboardInput("This is 911, what is your emergency?", "", 2000, delegate(string s)
                    {
                        TriggerEvent("911CallClient", s);
                    });
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
                }
                else if (item == nonEmergencyButton)
                {
                    _interactionMenuPool.CloseAllMenus();
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
                    Utility.Instance.KeyboardInput("This is 311, what is your emergency?", "", 2000, delegate(string s)
                    {
                        TriggerEvent("311CallClient", s);
                    });
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
                }
                else if (item == textButton)
                {
                    _interactionMenuPool.CloseAllMenus();
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
                    Utility.Instance.KeyboardInput("The server id or phone number of the person you are trying to text.", lastnumber, 10,
                                                   delegate(string s)
                    {
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
                        Utility.Instance.KeyboardInput("The message you are trying to send to the person.", "", 2000,
                                                       delegate(string s1)
                        {
                            lastnumber = s;
                            TriggerServerEvent("TextingFromClient", s, s1);
                        });
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
                    });
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
                }
            };

            var cardButton = new UIMenuItem("Show Buisness Card", "Show buisness card with name and phone number to everyone nearby.");
            _interactionMenu.AddItem(cardButton);

            var idButton = new UIMenuItem("Show ID", "Show your identification to everyone nearby.");
            _interactionMenu.AddItem(idButton);

            _interactionMenu.OnItemSelect += (sender, item, index) =>
            {
                if (item == animationsButton)
                {
                    _interactionMenuPool.CloseAllMenus();
                    TriggerEvent("OpenAnimationsMenu");
                }
                else if (item == idButton)
                {
                    TriggerServerEvent("RequestID", Game.Player.ServerId);
                }
                else if (item == cardButton)
                {
                    TriggerServerEvent("BuisnessCardRequest", Game.Player.ServerId);
                }
            };

            _interactionMenuPool.Add(_interactionMenu);
            _interactionMenuPool.RefreshIndex();
            _interactionMenuPool.CloseAllMenus();;

#pragma warning disable CS1998 // This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
            Tick += new Func <Task>(async delegate
#pragma warning restore CS1998 // This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
            {
                _interactionMenuPool.ProcessMenus();
                if (API.IsInputDisabled(2) && API.IsControlJustReleased(0, 288) && !_interactionMenuPool.IsAnyMenuOpen() && !Restraints.Instance.Restrained)
                {
                    _interactionMenu.Visible = true;
                }
            });
        }
Esempio n. 18
0
        public static void DrawFishingMinigame()
        {
            if (Pad.IsControlJustPressed(0, 24))
            {
                switch (fishingState)
                {
                case 1:
                    // Start fishing
                    fishingState       = 2;
                    fishingBarPosition = width - 224;
                    Events.CallRemote("startFishingTimer");
                    break;

                case 2:
                    // Player didn't catch any fish
                    fishingState = -1;
                    Player.LocalPlayer.FreezePosition(false);
                    Events.CallRemote("fishingCanceled");
                    break;

                case 3:
                    if (fishingBarPosition > fishingAchieveStart && fishingBarPosition < fishingAchieveStart + 15)
                    {
                        // Valid catch
                        fishingSuccess++;

                        if (fishingSuccess == 3)
                        {
                            // Fishing succeed
                            fishingState = -1;
                            Player.LocalPlayer.FreezePosition(false);
                            Events.CallRemote("fishingSuccess");
                        }
                        else
                        {
                            // Generate the new bars
                            movementRight      = true;
                            fishingBarPosition = width - 224;

                            var random = new Random();
                            fishingAchieveStart = (int)Math.Round(random.NextDouble() * 390 + fishingBarMin);
                        }
                    }
                    else
                    {
                        // Player failed catching
                        fishingState = -1;
                        Player.LocalPlayer.FreezePosition(false);
                        Events.CallRemote("fishingCanceled");
                    }

                    break;
                }

                // Don't display anything
                return;
            }

            if (fishingState == 3)
            {
                // Draw the minigame bar
                UIResRectangle.Draw(width - 425, height - 40, 400, 25, Color.FromArgb(200, 0, 0, 0));

                // Draw the success bar
                UIResRectangle.Draw(fishingAchieveStart, height - 40, 10, 25, Color.FromArgb(255, 0, 255, 0));

                // Draw the moving bar
                UIResRectangle.Draw(fishingBarPosition, height - 41, 2, 26, Color.FromArgb(255, 255, 255, 255));

                if (movementRight)
                {
                    // Move the bar to the right
                    fishingBarPosition++;

                    if (fishingBarPosition > fishingBarMax)
                    {
                        fishingBarPosition = fishingBarMax;
                        movementRight      = false;
                    }
                }
                else
                {
                    // Move the bar to the left
                    fishingBarPosition--;

                    if (fishingBarPosition < fishingBarMin)
                    {
                        fishingBarPosition = fishingBarMin;
                        movementRight      = true;
                    }
                }
            }
        }
Esempio n. 19
0
        public void AddItemsSubMenu(UIMenu menu)
        {
            itemsSubMenu = Main.MasterMenuPool.AddSubMenu(menu, "Items", "See what useful items you are carrying");
            UIResRectangle rectangle1 = new UIResRectangle();

            rectangle1.Color = Color.FromArgb(0xff, Color.DarkGreen);
            UIResRectangle rectangle = rectangle1;

            itemsSubMenu.SetBannerType(rectangle);
            int num = 0;

            while (true)
            {
                if (num >= playerItemInventory.Count)
                {
                    itemsSubMenu.OnItemSelect += delegate(UIMenu sender, UIMenuItem item, int index) {
                        if (playerItemInventory[index].Amount <= 0)
                        {
                            UI.Notify("Cannot use ~b~" + item.Text + "~w~ as you are not carrying any.");
                        }
                        else if (playerItemInventory[index].GetType() == typeof(InventoryFoodItem))
                        {
                            InventoryFoodItem item2 = (InventoryFoodItem)playerItemInventory[index];
                            if (item2.FoodType == FoodType.Food)
                            {
                                if (Character.currentHungerLevel >= 1f)
                                {
                                    UI.Notify("Cannot use ~b~" + item.Text + "~w~ as your Hunger levels are full.");
                                }
                                else
                                {
                                    Character.currentHungerLevel += item2.Restore;
                                    if (Character.currentHungerLevel > 1f)
                                    {
                                        Character.currentHungerLevel = 1f;
                                    }
                                    InventoryItem local1 = playerItemInventory[index];
                                    local1.Amount--;
                                    object[] objArray1 = new object[] { "(", playerItemInventory[index].Amount, "/", playerItemInventory[index].MaxAmount, ")" };
                                    item.SetRightLabel(string.Concat(objArray1));
                                    UI.Notify("Used ~b~" + item.Text + "~w~ to replenish Hunger levels.");
                                }
                            }
                            else if (item2.FoodType == FoodType.Drink)
                            {
                                if (Character.currentThirstLevel >= 1f)
                                {
                                    UI.Notify("Cannot use ~b~" + item.Text + "~w~ as your Thirst levels are full.");
                                }
                                else
                                {
                                    Character.currentThirstLevel += item2.Restore;
                                    if (Character.currentThirstLevel > 1f)
                                    {
                                        Character.currentThirstLevel = 1f;
                                    }
                                    InventoryItem local2 = playerItemInventory[index];
                                    local2.Amount--;
                                    object[] objArray2 = new object[] { "(", playerItemInventory[index].Amount, "/", playerItemInventory[index].MaxAmount, ")" };
                                    item.SetRightLabel(string.Concat(objArray2));
                                    UI.Notify("Used ~b~" + item.Text + "~w~ to replenish Thirst levels.");
                                }
                            }
                        }
                        else if (playerItemInventory[index].GetType() == typeof(InventoryCraftableFoodItem))
                        {
                            InventoryCraftableFoodItem item3 = (InventoryCraftableFoodItem)playerItemInventory[index];
                            if (item3.FoodType == FoodType.Food)
                            {
                                if (Character.currentHungerLevel >= 1f)
                                {
                                    UI.Notify("Cannot use ~b~" + item.Text + "~w~ as your Hunger levels are full.");
                                }
                                else
                                {
                                    Character.currentHungerLevel += item3.Restore;
                                    if (Character.currentHungerLevel > 1f)
                                    {
                                        Character.currentHungerLevel = 1f;
                                    }
                                    InventoryItem local3 = playerItemInventory[index];
                                    local3.Amount--;
                                    object[] objArray3 = new object[] { "(", playerItemInventory[index].Amount, "/", playerItemInventory[index].MaxAmount, ")" };
                                    item.SetRightLabel(string.Concat(objArray3));
                                    UI.Notify("Used ~b~" + item.Text + "~w~ to replenish Hunger levels.");
                                }
                            }
                            else if (item3.FoodType == FoodType.Drink)
                            {
                                if (Character.currentThirstLevel >= 1f)
                                {
                                    UI.Notify("Cannot use ~b~" + item.Text + "~w~ as your Thirst levels are full.");
                                }
                                else
                                {
                                    Character.currentThirstLevel += item3.Restore;
                                    if (Character.currentThirstLevel > 1f)
                                    {
                                        Character.currentThirstLevel = 1f;
                                    }
                                    InventoryItem local4 = playerItemInventory[index];
                                    local4.Amount--;
                                    object[] objArray4 = new object[] { "(", playerItemInventory[index].Amount, "/", playerItemInventory[index].MaxAmount, ")" };
                                    item.SetRightLabel(string.Concat(objArray4));
                                    UI.Notify("Used ~b~" + item.Text + "~w~ to replenish Thirst levels.");
                                }
                            }
                        }
                    };
                    return;
                }
                itemsSubMenu.AddItem(new UIMenuItem(playerItemInventory[num].Name, playerItemInventory[num].Description));
                object[] objArray1 = new object[] { "(", playerItemInventory[num].Amount, "/", playerItemInventory[num].MaxAmount, ")" };
                itemsSubMenu.MenuItems[itemsSubMenu.MenuItems.Count - 1].SetRightLabel(string.Concat(objArray1));
                num++;
            }
        }
    public PIMenu()
    {
        Tick    += OnTick;
        KeyDown += OnKeyDown;

        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@brave");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@confident");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@drunk");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@drunk@verydrunk");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@fat@a");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@shadyped@a");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@hurry@a");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@injured");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@intimidation@1h");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@quick");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@sad@a");
        Function.Call(Hash.REQUEST_CLIP_SET, "move_m@tool_belt@a");

        MenuColor = Color.Blue;

        MainMenu = new UIMenu(Game.Player.Name.ToString(), "INTERACTION MENU", new Point(0, 0));
        MenuPool.Add(MainMenu);
        GlobalMenuBanner       = new UIResRectangle();
        GlobalMenuBanner.Color = MenuColor;
        MainMenu.SetBannerType(GlobalMenuBanner);
        MainMenu.Title.Font     = GTA.Font.ChaletComprimeCologne;
        MainMenu.Title.Scale    = 0.86f;
        MainMenu.Subtitle.Color = MenuColor;

        var QuickGPSList = new List <dynamic>
        {
            "None",
            "Ammu-Nation",
            "Convenience Store",
            "Mod Shop",
            "Clothes Store",
        };

        MainMenu.AddItem(QuickGPSItem = new UIMenuListItem("Quick GPS", QuickGPSList, 0, "Select to place your waypoint at a set location."));

        QuickGPSItem.Activated += (UIMenu sender, UIMenuItem selecteditem) =>
        {
            var tmpList = (UIMenuListItem)selecteditem;
            switch (tmpList.Index)
            {
            case 0:
                Function.Call(Hash.SET_WAYPOINT_OFF);
                break;

            case 1:
                Vector3 NearestAmmunation = PointsOfInterest.GetClosestPoi(Game.Player.Character.Position, PointsOfInterest.Type.AmmuNation);
                Function.Call(Hash.SET_NEW_WAYPOINT, NearestAmmunation.X, NearestAmmunation.Y);
                break;
            }
        };

        InventoryMenu = new UIMenu(Game.Player.Name.ToString(), "INVENTORY", new Point(0, 0));
        MenuPool.Add(InventoryMenu);
        InventoryMenu.SetBannerType(GlobalMenuBanner);
        InventoryMenu.Title.Font     = GTA.Font.ChaletComprimeCologne;
        InventoryMenu.Title.Scale    = 0.86f;
        InventoryMenu.Subtitle.Color = MenuColor;

        var InventoryMenuItem = new UIMenuItem("Inventory", "Your inventory which contains clothing, ammo, and much more.");

        MainMenu.AddItem(InventoryMenuItem);

        MainMenu.BindMenuToItem(InventoryMenu, InventoryMenuItem);

        var PlayerMoodsList = new List <dynamic>
        {
            "None",
            "Normal",
            "Happy",
            "Angry",
            "Injured",
            "Stressed",
        };

        MainMenu.AddItem(PlayerMoodItem = new UIMenuListItem("Player Mood", PlayerMoodsList, 0, "Sets your character's facial expression."));

        var WalkStyleList = new List <dynamic>
        {
            "Normal",
            "Brave",
            "Confident",
            "Drunk",
            "Fat",
            "Gangster",
            "Hurry",
            "Injured",
            "Intimidated",
            "Quick ",
            "Sad",
            "Tough Guy"
        };

        MainMenu.AddItem(WalkStyleItem = new UIMenuListItem("Walk Style", WalkStyleList, 0, "Sets your Character's walking style."));

        var AimingStyleList = new List <dynamic>
        {
            "None",
            "Gangster",
            "Cowboy",
        };

        MainMenu.AddItem(AimingStyleItem = new UIMenuListItem("Aiming Style", AimingStyleList, 0, "Sets your Character's pistol aiming style."));

        PassiveModeItem = new UIMenuItem("Enable Passive Mode", "Passive Mode will prevent damage and wanted levels from police.");

        MainMenu.AddItem(PassiveModeItem);

        MenuOptionsMenu = new UIMenu(Game.Player.Name.ToString(), "MENU OPTIONS", new Point(0, 0));
        MenuPool.Add(MenuOptionsMenu);
        MenuOptionsMenu.SetBannerType(GlobalMenuBanner);
        MenuOptionsMenu.Title.Font     = GTA.Font.ChaletComprimeCologne;
        MenuOptionsMenu.Title.Scale    = 0.86f;
        MenuOptionsMenu.Subtitle.Color = MenuColor;

        var MenuOptionsMenuItem = new UIMenuItem("Menu Options", "");

        MainMenu.AddItem(MenuOptionsMenuItem);

        MainMenu.BindMenuToItem(MenuOptionsMenu, MenuOptionsMenuItem);

        AboutMenu = new UIMenu(Game.Player.Name.ToString(), "ABOUT", new Point(0, 0));
        MenuPool.Add(AboutMenu);
        AboutMenu.SetBannerType(GlobalMenuBanner);
        AboutMenu.Title.Font     = GTA.Font.ChaletComprimeCologne;
        AboutMenu.Title.Scale    = 0.86f;
        AboutMenu.Subtitle.Color = MenuColor;

        var AboutOptionsMenuItem = new UIMenuItem("About", "");

        MenuOptionsMenu.BindMenuToItem(AboutMenu, AboutOptionsMenuItem);

        var MenuColorList = new List <dynamic>
        {
            "Blue",
            "Red",
            "Green",
            "Orange",
            "Purple",
            "Yellow",
        };

        MenuOptionsMenu.AddItem(MenuColorItem = new UIMenuListItem("Color", MenuColorList, 0, "Select interaction menu's color theme."));

        MenuOptionsMenu.AddItem(AboutOptionsMenuItem);

        var VersionItem = new UIMenuItem("Version");
        var AuthorItem  = new UIMenuItem("Author");

        AboutMenu.AddItem(VersionItem);
        AboutMenu.AddItem(AuthorItem);

        VersionItem.SetRightLabel("1.0");
        AuthorItem.SetRightLabel("jedijosh920 & Guadmaz");

        MainMenu.OnItemSelect += (UIMenu sender, UIMenuItem selectedItem, int index) =>
        {
            switch (index)
            {
            case 5:
                if (!IsPassiveMode)
                {
                    Game.Player.Character.IsInvincible = true;
                    Game.Player.Character.Alpha        = 200;
                    Function.Call(Hash.SET_POLICE_IGNORE_PLAYER, Game.Player, true);
                    Function.Call(Hash.SET_WANTED_LEVEL_MULTIPLIER, 0.0f);
                    PassiveModeItem.Text = "Disable Passive Mode";
                    IsPassiveMode        = true;
                }

                else if (IsPassiveMode)
                {
                    Game.Player.Character.ResetAlpha();
                    Function.Call(Hash.SET_POLICE_IGNORE_PLAYER, Game.Player, false);
                    Function.Call(Hash.SET_WANTED_LEVEL_MULTIPLIER, 1.0f);
                    PassiveModeItem.Text = "Enable Passive Mode";
                    IsPassiveMode        = false;
                }
                break;
            }
        };

        MenuOptionsMenu.OnListChange += (UIMenu sender, UIMenuListItem listItem, int newIndex) =>
        {
            if (listItem == MenuColorItem)
            {
                switch (newIndex)
                {
                case 0:
                    MenuColor = Color.Blue;
                    break;

                case 1:
                    MenuColor = Color.Red;
                    break;

                case 2:
                    MenuColor = Color.Green;
                    break;

                case 3:
                    MenuColor = Color.Orange;
                    break;

                case 4:
                    MenuColor = Color.Purple;
                    break;

                case 5:
                    MenuColor = Color.Yellow;
                    break;
                }
            }

            if (listItem == WalkStyleItem)
            {
                switch (newIndex)
                {
                case 0:
                    Game.Player.Character.Task.ClearAll();
                    Function.Call(Hash.RESET_PED_MOVEMENT_CLIPSET, Game.Player.Character, 0x3E800000);
                    break;

                case 1:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@brave", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;

                case 2:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@confident", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;

                case 3:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@drunk@verydrunk", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;

                case 4:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@fat@a", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;

                case 5:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@shadyped@a", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;

                case 6:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@hurry@a", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;

                case 7:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@injured", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;

                case 8:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@intimidation@1h", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;

                case 9:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@quick", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;

                case 10:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@sad@a", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;

                case 11:
                    Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@tool_belt@a", 0x3E800000);
                    Game.Player.Character.Task.ClearAll();
                    break;
                }
            }

            if (listItem == PlayerMoodItem)
            {
                switch (newIndex)
                {
                case 0:
                    Function.Call(Hash.CLEAR_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character);
                    break;

                case 1:
                    Function.Call(Hash.SET_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character, "mood_normal_1", 0);
                    break;

                case 2:
                    Function.Call(Hash.SET_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character, "mood_happy_1", 0);
                    break;

                case 3:
                    Function.Call(Hash.SET_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character, "Mood_Angry_1", 0);
                    break;

                case 4:
                    Function.Call(Hash.SET_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character, "Mood_Injured_1", 0);
                    break;

                case 5:
                    Function.Call(Hash.SET_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character, "Mood_Stressed_1", 0);
                    break;
                }
            }

            if (listItem == AimingStyleItem)
            {
                switch (newIndex)
                {
                case 0:
                    Function.Call(Hash.SET_WEAPON_ANIMATION_OVERRIDE, Game.Player.Character, Function.Call <int>(Hash.GET_HASH_KEY, "default"));
                    break;

                case 1:
                    Function.Call(Hash.SET_WEAPON_ANIMATION_OVERRIDE, Game.Player.Character, Function.Call <int>(Hash.GET_HASH_KEY, "Gang1H"));
                    break;

                case 2:
                    Function.Call(Hash.SET_WEAPON_ANIMATION_OVERRIDE, Game.Player.Character, Function.Call <int>(Hash.GET_HASH_KEY, "Hillbilly"));
                    break;
                }
            }
        };

        var menu     = new AmmoMenu();
        var ammoItem = new UIMenuItem("Ammo");

        InventoryMenu.AddItem(ammoItem);
        InventoryMenu.BindMenuToItem(menu, ammoItem);
        MenuPool.Add(menu);

        MainMenu.RefreshIndex();
        InventoryMenu.RefreshIndex();
    }
        public void AddItemsSubMenu(UIMenu menu)
        {
            itemsSubMenu = Main.MasterMenuPool.AddSubMenu(menu, "Items", "See what useful items you are carrying");
            var banner = new UIResRectangle
            {
                Color = Color.FromArgb(255, Color.DarkGreen)
            };

            itemsSubMenu.SetBannerType(banner);
            for (int i = 0; i < playerItemInventory.Count; i++)
            {
                itemsSubMenu.AddItem(new UIMenuItem(playerItemInventory[i].Name, playerItemInventory[i].Description));
                itemsSubMenu.MenuItems[itemsSubMenu.MenuItems.Count - 1].SetRightLabel("(" + playerItemInventory[i].Amount + "/" + playerItemInventory[i].MaxAmount + ")");
            }
            itemsSubMenu.OnItemSelect += (sender, item, index) =>
            {
                if (playerItemInventory[index].Amount > 0)
                {
                    if (playerItemInventory[index].GetType() == typeof(InventoryFoodItem))
                    {
                        InventoryFoodItem foodItem = (InventoryFoodItem)playerItemInventory[index];
                        if (foodItem.FoodType == FoodType.Food)
                        {
                            if (Character.currentHungerLevel < 1.0f)
                            {
                                Character.currentHungerLevel += foodItem.Restore;
                                if (Character.currentHungerLevel > 1.0f)
                                {
                                    Character.currentHungerLevel = 1.0f;
                                }
                                playerItemInventory[index].Amount -= 1;
                                item.SetRightLabel("(" + playerItemInventory[index].Amount + "/" + playerItemInventory[index].MaxAmount + ")");
                                UI.Notify("Used ~b~" + item.Text + "~w~ to replenish Hunger levels.");
                            }
                            else
                            {
                                UI.Notify("Cannot use ~b~" + item.Text + "~w~ as your Hunger levels are full.");
                            }
                        }
                        else if (foodItem.FoodType == FoodType.Drink)
                        {
                            if (Character.currentThirstLevel < 1.0f)
                            {
                                Character.currentThirstLevel += foodItem.Restore;
                                if (Character.currentThirstLevel > 1.0f)
                                {
                                    Character.currentThirstLevel = 1.0f;
                                }
                                playerItemInventory[index].Amount -= 1;
                                item.SetRightLabel("(" + playerItemInventory[index].Amount + "/" + playerItemInventory[index].MaxAmount + ")");
                                UI.Notify("Used ~b~" + item.Text + "~w~ to replenish Thirst levels.");
                            }
                            else
                            {
                                UI.Notify("Cannot use ~b~" + item.Text + "~w~ as your Thirst levels are full.");
                            }
                        }
                    }
                    else if (playerItemInventory[index].GetType() == typeof(InventoryCraftableFoodItem))
                    {
                        InventoryCraftableFoodItem foodItem = (InventoryCraftableFoodItem)playerItemInventory[index];
                        if (foodItem.FoodType == FoodType.Food)
                        {
                            if (Character.currentHungerLevel < 1.0f)
                            {
                                Character.currentHungerLevel += foodItem.Restore;
                                if (Character.currentHungerLevel > 1.0f)
                                {
                                    Character.currentHungerLevel = 1.0f;
                                }
                                playerItemInventory[index].Amount -= 1;
                                item.SetRightLabel("(" + playerItemInventory[index].Amount + "/" + playerItemInventory[index].MaxAmount + ")");
                                UI.Notify("Used ~b~" + item.Text + "~w~ to replenish Hunger levels.");
                            }
                            else
                            {
                                UI.Notify("Cannot use ~b~" + item.Text + "~w~ as your Hunger levels are full.");
                            }
                        }
                        else if (foodItem.FoodType == FoodType.Drink)
                        {
                            if (Character.currentThirstLevel < 1.0f)
                            {
                                Character.currentThirstLevel += foodItem.Restore;
                                if (Character.currentThirstLevel > 1.0f)
                                {
                                    Character.currentThirstLevel = 1.0f;
                                }
                                playerItemInventory[index].Amount -= 1;
                                item.SetRightLabel("(" + playerItemInventory[index].Amount + "/" + playerItemInventory[index].MaxAmount + ")");
                                UI.Notify("Used ~b~" + item.Text + "~w~ to replenish Thirst levels.");
                            }
                            else
                            {
                                UI.Notify("Cannot use ~b~" + item.Text + "~w~ as your Thirst levels are full.");
                            }
                        }
                    }
                }
                else
                {
                    UI.Notify("Cannot use ~b~" + item.Text + "~w~ as you are not carrying any.");
                }
            };
        }
Esempio n. 22
0
        public PlayerInventory()
        {
            _inventoryKey = this.Settings.GetValue <Keys>("keys", "inventory_key", _inventoryKey);
            this.Settings.SetValue <Keys>("keys", "inventory_key", _inventoryKey);
            this.Settings.Save();
            Inventory des = Serializer.Deserialize <Inventory>("./scripts/Inventory.dat");

            if (des == null)
            {
                des = new Inventory(MenuType.Player, false);
            }
            _inventory = des;
            _inventory.LoadMenus();
            Instance = this;
            MenuConrtoller.MenuPool.Add(_mainMenu);
            UIResRectangle rectangle = new UIResRectangle();

            _mainMenu.SetBannerType(rectangle);
            UIMenuItem         inventoryItem = new UIMenuItem("Inventory");
            UIMenuItem         resourcesItem = new UIMenuItem("Resources");
            UIMenuCheckboxItem editModeItem  = new UIMenuCheckboxItem("Edit Mode", true, "Allow yourself to pickup objects.");

            editModeItem.CheckboxEvent += (ItemCheckboxEvent) delegate(UIMenuCheckboxItem sender, bool @checked)
            {
                PlayerMap.Instance.EditMode = @checked;
            };
            UIMenuItem mainMenuItem = new UIMenuItem("Main Menu", "Navigate to the main menu. (For gamepad users)");

            mainMenuItem.Activated += (ItemActivatedEvent) delegate
            {
                MenuConrtoller.MenuPool.CloseAllMenus();
                ModController.Instance.MainMenu.Visible = true;
            };
            UIMenuCheckboxItem devModeCheckbox = new UIMenuCheckboxItem("Developer Mode", _inventory.DeveloperMode, "Enable/Disable infinite items and resources.");

            devModeCheckbox.CheckboxEvent += (ItemCheckboxEvent) delegate(UIMenuCheckboxItem item, bool @checked)
            {
                if (_inventory != null)
                {
                    if (@checked)
                    {
                        string userInput = Game.GetUserInput(GTA.WindowTitle.FMMC_KEY_TIP10, "", 12);
                        if (string.IsNullOrEmpty(userInput) || userInput.ToLower() != "michael")
                        {
                            item.Checked = false;
                            UI.Notify("Hint: Tamara Greenway's husband's first name.");
                            return;
                        }
                    }
                    _inventory.DeveloperMode = @checked;
                    if (!@checked)
                    {
                        _inventory.Items.ForEach(delegate(InventoryItemBase i)
                        {
                            i.Amount = 0;
                        });
                        _inventory.Resources.ForEach(delegate(InventoryItemBase i)
                        {
                            i.Amount = 0;
                        });
                        _inventory.RefreshMenu();
                    }
                    else
                    {
                        UI.Notify("Developer Mode: ~g~Activated~s~");
                    }
                    Serializer.Serialize("./scripts/Inventory.dat", _inventory);
                }
            };
            _mainMenu.AddItem(inventoryItem);
            _mainMenu.AddItem(resourcesItem);
            _mainMenu.BindMenuToItem(_inventory.InventoryMenu, inventoryItem);
            _mainMenu.BindMenuToItem(_inventory.ResourceMenu, resourcesItem);
            _mainMenu.AddItem(editModeItem);
            _mainMenu.AddItem(devModeCheckbox);
            _inventory.ItemUsed  += InventoryOnItemUsed;
            _inventory.AddedItem += delegate
            {
                Serializer.Serialize("./scripts/Inventory.dat", _inventory);
            };
            this.Tick  += (EventHandler)OnTick;
            this.KeyUp += (KeyEventHandler)OnKeyUp;
            LootedPed  += OnLootedPed;
        }
Esempio n. 23
0
        public Main()
        {
            // Initialize managers
            AmmoTypeManager.Init();
            MaterialManager.Init();
            ConversionManager.Init();
            BenchManager.Init();

            // NativeUI
            Point          noBannerOffset = new Point(0, -107);
            UIResRectangle emptyBanner    = new UIResRectangle(Point.Empty, Size.Empty, Color.Empty);

            // Main menu
            BenchMain = new UIMenu(string.Empty, "SELECT AN OPTION", noBannerOffset);
            BenchMain.SetBannerType(emptyBanner);

            // Generic list menu for displaying ammo types/bench materials, subtitle changes with BenchMain item selection
            BenchList = new UIMenu(string.Empty, "LIST MENU TITLE", noBannerOffset);
            BenchList.SetBannerType(emptyBanner);

            // Action menu, subtitle changes with BenchList item selection
            BenchAction = new UIMenu(string.Empty, "ACTION MENU TITLE", noBannerOffset);
            BenchAction.SetBannerType(emptyBanner);

            MaterialHeader = new UIMenuColoredItem("~b~MATERIAL", Color.Transparent, Color.Transparent);
            MaterialHeader.SetRightLabel("~b~BENCH");
            MaterialHeader.Enabled = false;

            // Amount button
            AmountItem = new UIMenuItem("Amount");
            AmountItem.SetRightLabel("Select...");

            // Confirm button
            ConfirmItem = new UIMenuItem("Confirm");
            ConfirmItem.SetLeftBadge(UIMenuItem.BadgeStyle.Tick);

            // Separators
            MaterialSeparator         = new UIMenuColoredItem("TITLE", Color.Black, Color.Black);
            MaterialSeparator.Enabled = false;

            ActionSeparator         = new UIMenuColoredItem("~b~ACTION", Color.Black, Color.Black);
            ActionSeparator.Enabled = false;

            // Menu relations
            BenchMain.BindMenuToItem(BenchList, new UIMenuItem("Craft Ammo"));
            BenchMain.BindMenuToItem(BenchList, new UIMenuItem("Dismantle Ammo"));
            BenchMain.BindMenuToItem(BenchList, new UIMenuItem("Bench Materials"));

            // Add menus to the menupool
            MenuPool.Add(BenchMain);
            MenuPool.Add(BenchList);
            MenuPool.Add(BenchAction);

            // Menu events
            BenchMain.OnItemSelect += BenchMain_OnItemSelect;
            BenchList.OnItemSelect += BenchList_OnItemSelect;
            AmountItem.Activated   += AmountItem_Activated;
            ConfirmItem.Activated  += ConfirmItem_Activated;

            // Events
            Tick    += Main_Tick;
            Aborted += Main_Aborted;
        }