Ejemplo n.º 1
0
        /// <summary>
        ///     The AddMenuItem
        /// </summary>
        /// <param name="_name">The _name<see cref="string" /></param>
        /// <param name="_description">The _description<see cref="string" /></param>
        /// <param name="_menu">The _menu<see cref="UIMenu" /></param>
        /// <returns>The <see cref="UIMenuItem" /></returns>
        public UIMenuItem AddMenuItem(string _name, string _description, UIMenu _menu = null)
        {
            var menu    = _menu ?? mainMenu;
            var newitem = new UIMenuItem(_name, _description);

            menu.AddItem(newitem);
            menuPool.RefreshIndex();
            return(newitem);
        }
Ejemplo n.º 2
0
        public WeaponMenu()
        {
            _weaponmenuPool = new MenuPool();
            weaponMenu      = new UIMenu("Weapon Menu", "~p~Freedom Framework ~w~by ~b~Abel Gaming");
            _weaponmenuPool.Add(weaponMenu);

            MeleeWeapons(weaponMenu);
            HandgunWeapons(weaponMenu);
            ShotgunWeapons(weaponMenu);
            MachinegunWeapons(weaponMenu);
            RifleWeapons(weaponMenu);
            SniperWeapons(weaponMenu);
            HeavyWeapons(weaponMenu);
            ExplosiveWeapons(weaponMenu);
            BodyArmor(weaponMenu);

            _weaponmenuPool.MouseEdgeEnabled        = false;
            _weaponmenuPool.ControlDisablingEnabled = false;
            _weaponmenuPool.RefreshIndex();

            Tick += async() =>
            {
                _weaponmenuPool.ProcessMenus();
            };
        }
Ejemplo n.º 3
0
        public MainMenu()
        {
            _menuPool = new MenuPool();
            mainMenu  = new UIMenu("Main Menu", "~p~Freedom Framework ~w~by ~b~Abel Gaming");
            _menuPool.Add(mainMenu);

            Inventory(mainMenu);
            MenuItems(mainMenu);

            _menuPool.MouseEdgeEnabled        = false;
            _menuPool.ControlDisablingEnabled = false;
            _menuPool.RefreshIndex();

            Tick += async() =>
            {
                _menuPool.ProcessMenus();
                if (API.IsControlJustPressed(0, 168) && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch
                {
                    mainMenu.Visible = !mainMenu.Visible;
                }
                bread.SetRightLabel($"{Utilities.Constructors.Bread.ToString()}");
                cola.SetRightLabel($"{Utilities.Constructors.Colas.ToString()}");
                water.SetRightLabel($"{Utilities.Constructors.Waters.ToString()}");
            };
        }
Ejemplo n.º 4
0
        public Menu()
        {
            CH.Messages.NotifyToLoad(modName: ModName);

            _menuPool = new MenuPool();
            var mainMenu = new UIMenu(ModName, "~b~Select Item");

            _menuPool.Add(mainMenu);

            SpawnDubsta(mainMenu);
            DriveTo(mainMenu);
            Cruise(mainMenu);
            Repair(mainMenu);
            //TaskDriveToPlayer(mainMenu);

            _menuPool.RefreshIndex();

            Tick    += (o, e) => _menuPool.ProcessMenus();
            KeyDown += (o, e) =>
            {
                if (e.KeyCode == Keys.F11 && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch
                {
                    mainMenu.Visible = !mainMenu.Visible;
                }
            };
        }
Ejemplo n.º 5
0
    public TurnSignals()
    {
        UI.Notify("Script ScriptTemplate ~r~Loaded~w~!");
        carInfoPositionX.Enabled    = false;
        carInfoPositionY.Enabled    = false;
        carInfoPositionX.Multiplier = 0;
        carInfoPositionY.Multiplier = 0;

        speedText.Color = Color.White;
        speedText.Font  = GTA.Font.Monospace;

        gearText.Color = Color.White;
        gearText.Font  = GTA.Font.Monospace;

        rpmText.Color = Color.White;
        rpmText.Font  = GTA.Font.Monospace;

        _menuPool = new MenuPool();
        _menuPool.Add(mainMenu);
        ScriptSett(mainMenu);
        VehicleSpawn(mainMenu);
        carMenu(mainMenu);
        Other(mainMenu);
        _menuPool.RefreshIndex();
        Tick    += OnTick;
        KeyDown += OnKeyDown;
        KeyUp   += OnKeyUp;
        StartInfo();
    }
Ejemplo n.º 6
0
        // TODO: Should check if player already loaded
        void OnPlayerJoining(dynamic arg1, dynamic arg2)
        {
            if (emotes.Count != 0)
            {
                return;
            }

            // Récupère les configs et la liste d'emote
            LoadConfig();
            LoadJson();

            // Crée le menu
            menuPool = new MenuPool();
            mainMenu = new UIMenu("Emotes", "Select an emote")
            {
                MouseControlsEnabled = false
            };
            menuPool.Add(mainMenu);
            mainMenu.OnItemSelect += OnItemSelect;

            foreach (Emote emote in emotes)
            {
                mainMenu.AddItem(new UIMenuItem(emote.Description));
            }
            menuPool.RefreshIndex();
        }
Ejemplo n.º 7
0
        public ConfigurationMenu()
        {
            Load();

            mainMenu = new UIMenu("Street Racing", "Configuration");
            menuPool.Add(mainMenu);

            AddCheckbox(nameof(Active), Active, x => Active = x);
            AddCheckbox("Max mods", MaxMods, x => MaxMods   = x);
            AddCheckbox("Police Pursit", PolicePursuit, x => PolicePursuit = x);
            AddMenuSpawnCount(mainMenu);

            AddButton("Save configuration", () =>
            {
                UI.Notify("Saved config");
                Save();
            });

            AddCheckbox("Record Track", RecordTrack, x => RecordTrack = x);
            AddButton("Save track", () =>
            {
                UI.Notify("Saved track");
                SaveCheckpoints(StreetRacing.RecordedCheckpoints.Select(x => x.Position));
                LoadRaces();
            });

            menuPool.RefreshIndex();
        }
Ejemplo n.º 8
0
        public CarrierMenu()
        {
            MPool = new MenuPool
            {
                (MainMenu = new UIMenu("Carrier Menu", "Select an action")),
                (PlaneSelectionMenu = new UIMenu("Carrier Menu", "Select an aircraft model")
                {
                    ParentMenu = MainMenu
                })
            };
            MainMenu.Visible           = false;
            PlaneSelectionMenu.Visible = false;

            MainMenu.AddItem(GoToGroundItem = new UIMenuItem("Go back to LSIA", "Travel back to the airport Police Sation"));
            MainMenu.AddItem(NavigateToPlaneSelectionItem = new UIMenuItem("Take an Aircraft", "Navigate to the Aircraft Selection menu"));
            MainMenu.BindMenuToItem(PlaneSelectionMenu, NavigateToPlaneSelectionItem);


            PlaneSelectionMenu.AddItem(ModelList      = new UIMenuListItem("Model", "Lets you select the aircraft model you want", AircraftManager.AircraftModels));
            PlaneSelectionMenu.AddItem(SpawnPlaneItem = new UIMenuItem("Start Flight", "Start a flight with the aircraft you selected"));

            GoToGroundItem.Activated += GoToCarrier;
            SpawnPlaneItem.Activated += SpawnPlane;
            MPool.RefreshIndex();
        }
Ejemplo n.º 9
0
        public TruckerJob()
        {
            MenuPool menuPool = new MenuPool();

            UIMenu menu = new UIMenu("Carrier Menu", "");

            menuPool.Add(menu);

            AddNonTruckerMenu(menu);

            menuPool.RefreshIndex();

            Tick += new Func <Task>(async delegate
            {
                // Debug shit
                //Vector3 pos = LocalPlayer.Character.Position;
                //Screen.DisplayHelpTextThisFrame($"X:{pos.X} Y:{pos.Y} Z:{pos.Z}");

                // Menu stuff
                menuPool.ProcessMenus();
                if (Game.IsControlJustReleased(1, Control.InteractionMenu))
                {
                    menu.Visible = !menu.Visible;
                }

                await Task.FromResult(0);
            });
        }
Ejemplo n.º 10
0
        public MainMenu()
        {
            _menuPool = new MenuPool();
            var mainMenu = new UIMenu("GN Police Menu", "Made By ~b~GN_ApexDevil v0.0.4");

            _menuPool.Add(mainMenu);

            PlayerOptions(mainMenu);
            PoliceAPIFunctions(mainMenu);
            Weaponslocker(mainMenu);
            DiscordLink(mainMenu);



            _menuPool.MouseEdgeEnabled        = false;
            _menuPool.ControlDisablingEnabled = false;
            _menuPool.RefreshIndex();

            Tick += async() =>
            {
                _menuPool.ProcessMenus();
                if (API.IsControlJustPressed(0, 166) && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch
                {
                    mainMenu.Visible = !mainMenu.Visible;
                }
            };
        }
Ejemplo n.º 11
0
        public VehicleMenu()
        {
            _vehiclemenuPool = new MenuPool();
            vehicleMenu      = new UIMenu("Vehicle Menu", "~p~Freedom Framework ~w~by ~b~Abel Gaming");
            _vehiclemenuPool.Add(vehicleMenu);

            //Create Menus
            CreateMenus();

            //Load Vehicle Hashes
            LoadVehicles();

            //Add Things to Menu
            AddVehicles(vehicleMenu);
            AddedVehicles(vehicleMenu);

            _vehiclemenuPool.MouseEdgeEnabled        = false;
            _vehiclemenuPool.ControlDisablingEnabled = false;
            _vehiclemenuPool.RefreshIndex();

            Tick += async() =>
            {
                _vehiclemenuPool.ProcessMenus();
            };
        }
Ejemplo n.º 12
0
        public Menu()
        {
            CH.Messages.NotifyToLoad(modName: ModName);

            var menuPool = new MenuPool();
            var mainMenu = new UIMenu(ModName, "GTAVMods - All in One");

            menuPool.Add(mainMenu);

            SpawnKillers2(mainMenu);
            SpawnKillers(mainMenu);
            Cord(mainMenu);
            SpawnHydra(mainMenu);
            SpawnHydraWithPilot(mainMenu);
            SpawnDriverInCar(mainMenu);
            ScriptTutorial_CreateDogs(mainMenu);
            ScriptTutorial_KilleDogs(mainMenu);
            Visibility(mainMenu);

            menuPool.RefreshIndex();

            Tick    += (o, e) => menuPool.ProcessMenus();
            KeyDown += (o, e) =>
            {
                if (e.KeyCode == Keys.F12 && !menuPool.IsAnyMenuOpen()) // Our menu on/off switch
                {
                    mainMenu.Visible = !mainMenu.Visible;
                }
            };
        }
Ejemplo n.º 13
0
        public DevUI()
        {
            menuPool = new MenuPool();
            mainMenu = new UIMenu("FRFuel dev menu", "things");

            position         = new UIMenuItem("Pos");
            position.Enabled = false;

            vehicleModelId         = new UIMenuItem("Vehicle model ID");
            vehicleModelId.Enabled = false;

            knownVehicle         = new UIMenuItem("Is known vehicle");
            knownVehicle.Enabled = false;

            vehicleFuelTank = new UIMenuItem("Vehicle fuel tank");

            mainMenu.AddItem(position);
            mainMenu.AddItem(knownVehicle);
            mainMenu.AddItem(vehicleModelId);
            mainMenu.AddItem(vehicleFuelTank);

            mainMenu.OnItemSelect += (sende, item, index) => {
                if (item == vehicleFuelTank && Game.PlayerPed.IsInVehicle())
                {
                    BaseScript.TriggerServerEvent(
                        "frfuel:dev:saveFuel",
                        "{" + Game.PlayerPed.CurrentVehicle.Model.Hash.ToString() + ", " + Game.PlayerPed.CurrentVehicle.FuelLevel.ToString() + "f},"
                        );
                    Screen.ShowNotification("Fuel to model saved");
                }
            };

            menuPool.Add(mainMenu);
            menuPool.RefreshIndex();
        }
Ejemplo n.º 14
0
        private async void InitialiseMenu()
        {
            if (EditorMenu == null)
            {
                EditorMenu = new UIMenu(ScriptName, "Edit Track Width and Camber", new PointF(screenPosX * Screen.Width, screenPosY * Screen.Height));
                {
                    EditorMenu.MouseEdgeEnabled        = false;
                    EditorMenu.ControlDisablingEnabled = false;
                    EditorMenu.MouseControlsEnabled    = false;
                }
            }
            else
            {
                EditorMenu.Clear();
            }

            frontOffsetGUI   = AddDynamicFloatList(EditorMenu, "Front Track Width", -currentPreset.DefaultOffsetX[0], -currentPreset.OffsetX[0], FrontMaxOffset);
            rearOffsetGUI    = AddDynamicFloatList(EditorMenu, "Rear Track Width", -currentPreset.DefaultOffsetX[currentPreset.FrontWheelsCount], -currentPreset.OffsetX[currentPreset.FrontWheelsCount], RearMaxOffset);
            frontRotationGUI = AddDynamicFloatList(EditorMenu, "Front Camber", currentPreset.DefaultRotationY[0], currentPreset.RotationY[0], FrontMaxCamber);
            rearRotationGUI  = AddDynamicFloatList(EditorMenu, "Rear Camber", currentPreset.DefaultRotationY[currentPreset.FrontWheelsCount], currentPreset.RotationY[currentPreset.FrontWheelsCount], RearMaxCamber);
            AddMenuReset(EditorMenu);

            if (_menuPool == null)
            {
                _menuPool = new MenuPool();
                {
                    _menuPool.ResetCursorOnOpen = true;
                }

                _menuPool.Add(EditorMenu);
            }
            _menuPool.RefreshIndex();

            await Delay(0);
        }
Ejemplo n.º 15
0
    //Now we will add all of our sub menus into our main menu, and set the general information of the entire menu
    public NativeUITemplate()
    {
        playerPed.AlwaysDiesOnLowHealth = false;
        _menuPool = new MenuPool();
        var mainMenu = new UIMenu("~g~Razer ~w~V", "~w~Mod by TheWolf! ~r~V 1.0");

        _menuPool.Add(mainMenu);
        PlayerModelMenu(mainMenu); //Here we add the Player Model Sub Menu
        _menuPool.RefreshIndex();

        //This code will run with every ms tick
        Tick += OnTick;

        //This code will open the menu
        KeyDown += (o, e) =>
        {
            if (e.KeyCode == Keys.F6 && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch
            {
                mainMenu.Visible = !mainMenu.Visible;
            }
        };

        var keyboard = Keyboard.Instance;

        Key[] otherPlayerKeys = { Key.A, Key.S, Key.D, Key.Space, Key.LeftShift, Key.V, Key.F };
        keyboard.SetKeys(Color.White, Key.W, otherPlayerKeys);
    }
Ejemplo n.º 16
0
 // create or re-create menu
 void CreateNewMenu()
 {
     _menuPool = new MenuPool();
     mainMenu  = new UIMenu("3d Marker", "~b~Marker Selection");
     _menuPool.Add(mainMenu);
     CreateMenu(mainMenu);
     _menuPool.RefreshIndex();
 }
Ejemplo n.º 17
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ModMenu" /> class.
        /// </summary>
        /// <param name="_name">The _name<see cref="string" /></param>
        /// <param name="_description">The _description<see cref="string" /></param>
        public ModMenu(string _name, string _description)
        {
            menuPool = new MenuPool();

            mainMenu = new UIMenu(_name, _description);

            menuPool.Add(mainMenu);
            menuPool.RefreshIndex();
        }
Ejemplo n.º 18
0
 internal static async void Toggle()
 {
     if (pool.IsAnyMenuOpen())
     {
         pool.CloseAllMenus();
     }
     else
     {
         menu.Visible = true;
         pool.RefreshIndex();
         menu.Clear();
         SetObservations(menu);
         while (pool.IsAnyMenuOpen())
         {
             pool.ProcessMenus();
             await BaseScript.Delay(0);
         }
     }
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Re-add all menus to a new instance of the menupool to prevent NativeUI issues.
 /// </summary>
 public static void RefreshMenuPool()
 {
     _menuPool = new MenuPool();
     _menuPool.Add(mainMenu);
     foreach (LoadoutSubMenu submenu in loadoutsubmenus)
     {
         _menuPool.Add(submenu.DivisionMenu);
     }
     _menuPool.RefreshIndex();
 }
Ejemplo n.º 20
0
        private void InitModMenu()
        {
            this.menuPool = new MenuPool();

            this.modMenu_main = new UIMenu("CopsV", "complete Overhaul");
            this.menuPool.Add(modMenu_main);
            this.modMenu_main.RefreshIndex();

            this.InitSubMenuDealer();
            menuPool.RefreshIndex();
        }
Ejemplo n.º 21
0
 static Menu()
 {
     menuPool = new MenuPool()
     {
         MouseEdgeEnabled        = false,
         ControlDisablingEnabled = false
     };
     mainMenu = new UIMenu("Vehicle Clamp", "Actions")
     {
         MouseControlsEnabled = false
     };
     menuPool.Add(mainMenu);
     VehicleControlMenu(mainMenu);
     menuPool.RefreshIndex();
 }
Ejemplo n.º 22
0
 static Menu()
 {
     menuPool = new MenuPool()
     {
         MouseEdgeEnabled        = false,
         ControlDisablingEnabled = false
     };
     mainMenu = new UIMenu("Vehicle Spawner", "Categories")
     {
         MouseControlsEnabled = false
     };
     menuPool.Add(mainMenu);
     VehicleSpawnMenu(mainMenu);
     menuPool.RefreshIndex();
 }
Ejemplo n.º 23
0
        public LoadoutScript()
        {
            Debug.Write("LoadoutScript by Albo1125.");

            mainMenu = new UIMenu("Loadouts", "");
            _menuPool.Add(mainMenu);

            //Deserialize the loadouts.json file.
            string resourceName = API.GetCurrentResourceName();
            string loadouts     = API.LoadResourceFile(resourceName, "loadouts.json");

            Loadout[] AllLoadouts = JsonConvert.DeserializeObject <Loadout[]>(loadouts, new JsonSerializerSettings
            {
                TypeNameHandling = TypeNameHandling.Auto
            });

            //Group the loadouts by division and add a separate submenu for every division.
            IEnumerable <IGrouping <string, Loadout> > groupedLoadouts = AllLoadouts.GroupBy(x => x.Division);

            foreach (IGrouping <string, Loadout> div in groupedLoadouts)
            {
                loadoutsubmenus.Add(new LoadoutSubMenu(div.Key, div));
            }

            //Add every division's submenu to the main loadout menu.
            foreach (LoadoutSubMenu submenu in loadoutsubmenus)
            {
                mainMenu.AddItem(submenu.MainMenuDivisionItem);
                mainMenu.BindMenuToItem(submenu.DivisionMenu, submenu.MainMenuDivisionItem);

                _menuPool.Add(submenu.DivisionMenu);
                submenu.DivisionMenu.RefreshIndex();
            }

            //Disable mouse controls and refresh the indexes.
            mainMenu.MouseControlsEnabled = false;
            mainMenu.MouseEdgeEnabled     = true;
            mainMenu.RefreshIndex();
            _menuPool.RefreshIndex();

            //Add an event handler for the /lo command.
            EventHandlers["Loadouts:ShowMenu"] += new Action <dynamic>((dynamic) =>
            {
                mainMenu.Visible = true;
            });

            Main();
        }
Ejemplo n.º 24
0
 static MenuHandler()
 {
     pool = new MenuPool()
     {
         MouseEdgeEnabled        = false,
         ControlDisablingEnabled = false
     };
     menu = new UIMenu("Observations", "Menu")
     {
         MouseControlsEnabled    = false,
         MouseEdgeEnabled        = false,
         ControlDisablingEnabled = false
     };
     pool.Add(menu);
     pool.RefreshIndex();
 }
Ejemplo n.º 25
0
 // Made by London Studios
 static Menu()
 {
     menuPool = new MenuPool()
     {
         MouseEdgeEnabled        = false,
         ControlDisablingEnabled = false
     };
     mainMenu = new UIMenu("Smart Tape", "Manage tape")
     {
         MouseControlsEnabled    = false,
         ControlDisablingEnabled = false
     };
     menuPool.Add(mainMenu);
     TapeMenu(mainMenu);
     menuPool.RefreshIndex();
 }
Ejemplo n.º 26
0
        public ScriptManager()
        {
            KeyDown += onKeyDown;
            Tick    += onTick;

            UI.Notify("Script manager loaded");

            _menuPool = new MenuPool();
            // var mainMenu = new UIMenu("Native UI", "~b~NATIVEUI SHOWCASE");

            UIMenuColoredItem myItem = new UIMenuColoredItem("Simple Button", Color.White, Color.Black);

            myItem.TextColor            = Color.Red;
            myItem.HighlightedTextColor = Color.Yellow;

            myMenu.AddItem(myItem);

            myMenu.AddItem(new UIMenuCheckboxItem("Simple Checkbox", false));
            myMenu.AddItem(new UIMenuListItem("Simple List", new List <dynamic> {
                "Item 1", "Item 2", "Item 3"
            }, 0));
            myMenu.AddItem(new UIMenuItem("Another Button", "Items can have descriptions too!"));

            _menuPool.Add(myMenu);

            //Sprite sprite = new Sprite("shopui_title_graphics_michael", "shopui_title_graphics_michael", Point.Empty, Size.Empty);
            //myMenu.SetBannerType(sprite);

            // var banner = new UIResRectangle(Point.Empty, Size.Empty, Color.FromArgb(255, 255, 255, 255));
            //banner.Color = Color.FromArgb(255, 255, 255, 255);
            // myMenu.SetBannerType(banner);

            //myMenu.SetBannerType(banner);

            _menuPool.RefreshIndex();


            KeyDown += (o, e) =>
            {
                if (e.KeyCode == Keys.F5) // Our menu on/off switch
                {
                    myMenu.Visible = !myMenu.Visible;
                }
            };

            // myMenu.OnItemSelect += ItemSelectHandler;
        }
Ejemplo n.º 27
0
        public PoliceMenu()
        {
            _policeMenuPool = new MenuPool();
            policeMenu      = new UIMenu("Police Menu", "~p~Freedom Framework ~w~by ~b~Abel Gaming");
            _policeMenuPool.Add(policeMenu);

            Outfits(policeMenu);

            _policeMenuPool.MouseEdgeEnabled        = false;
            _policeMenuPool.ControlDisablingEnabled = false;
            _policeMenuPool.RefreshIndex();

            Tick += async() =>
            {
                _policeMenuPool.ProcessMenus();
            };
        }
Ejemplo n.º 28
0
        public MainCEO()
        {
            _CEOmenuPool = new MenuPool();
            ceoMenu      = new UIMenu("CEO", "~p~Freedom Framework ~w~by ~b~Abel Gaming");
            _CEOmenuPool.Add(ceoMenu);

            MenuOptions(ceoMenu);

            _CEOmenuPool.MouseEdgeEnabled        = false;
            _CEOmenuPool.ControlDisablingEnabled = false;
            _CEOmenuPool.RefreshIndex();

            Tick += async() =>
            {
                _CEOmenuPool.ProcessMenus();
            };
        }
Ejemplo n.º 29
0
        public JobMenu()
        {
            _jobmenuPool = new MenuPool();
            jobmainMenu  = new UIMenu("Job Menu", "~p~Freedom Framework ~w~by ~b~Abel Gaming");
            _jobmenuPool.Add(jobmainMenu);

            JobOptions(jobmainMenu);

            _jobmenuPool.MouseEdgeEnabled        = false;
            _jobmenuPool.ControlDisablingEnabled = false;
            _jobmenuPool.RefreshIndex();

            Tick += async() =>
            {
                _jobmenuPool.ProcessMenus();
            };
        }
Ejemplo n.º 30
0
        public ATMMenu()
        {
            _atmmenuPool = new MenuPool();
            atmMenu      = new UIMenu("ATM", "~p~Freedom Framework ~w~by ~b~Abel Gaming");
            _atmmenuPool.Add(atmMenu);

            MainOptions(atmMenu);

            _atmmenuPool.MouseEdgeEnabled        = false;
            _atmmenuPool.ControlDisablingEnabled = false;
            _atmmenuPool.RefreshIndex();

            Tick += async() =>
            {
                _atmmenuPool.ProcessMenus();
            };
        }