public void OnTick()
        {
            position.Text = "Pos: " + Game.PlayerPed.Position.ToString();

            if (Game.PlayerPed.IsInVehicle())
            {
                Vehicle vehicle = Game.PlayerPed.CurrentVehicle;

                knownVehicle.SetRightLabel(VehiclesPetrolTanks.dict.ContainsKey(vehicle.Model.Hash) ? "Yes" : "No");
                vehicleModelId.SetRightLabel(vehicle.DisplayName.ToString());
                vehicleFuelTank.SetRightLabel(vehicle.FuelLevel.ToString());
            }
            else
            {
                vehicleModelId.SetRightLabel("ped or not driver");
                vehicleFuelTank.SetRightLabel("ped or not driver");
            }

            mainMenu.MouseControlsEnabled    = false;
            menuPool.MouseEdgeEnabled        = false;
            menuPool.ControlDisablingEnabled = false;
            menuPool.ProcessMenus();

            if (Game.IsControlJustReleased(0, Control.InteractionMenu))
            {
                mainMenu.Visible = !mainMenu.Visible;
            }
        }
Esempio n. 2
0
        private static async Task OnTick()
        {
            MenuPool.ProcessMenus();

            if ((Game.IsControlJustPressed(0, (Control)288) || Game.IsDisabledControlJustPressed(0, (Control)288)))
            {
                ShowMainMenu();
            }
            if ((Game.IsControlJustPressed(0, (Control)289) || Game.IsDisabledControlJustPressed(0, (Control)289)))
            {
                ShowCursor(false);
            }
            if ((Game.IsControlJustPressed(0, (Control)170) || Game.IsDisabledControlJustPressed(0, (Control)170)))
            {
                ShowCursor(true);
            }

            if (_isShowCursor)
            {
                ShowCursorThisFrame();
                Game.DisableAllControlsThisFrame(0);
                var x = GetDisabledControlNormal(0, (int)Control.CursorX) * Screen.Width;
                var y = GetDisabledControlNormal(0, (int)Control.CursorY) * Screen.Height;
                CursorPosition = new Point((int)x, (int)y);
            }
        }
Esempio n. 3
0
 void onTick(object sender, EventArgs e)
 {
     if (zombiemod_menupool != null)
     {
         zombiemod_menupool.ProcessMenus();
     }
 }
Esempio n. 4
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()}");
            };
        }
Esempio n. 5
0
 public void process()
 {
     if (MenuPool != null && MenuPool.IsAnyMenuOpen())
     {
         MenuPool.ProcessMenus();
     }
 }
Esempio n. 6
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();
            };
        }
Esempio n. 7
0
        public VehicleControls()
        {
            MenuPool menuPool = new MenuPool();

            UIMenu menu = new UIMenu("Vehicle Controls", "");

            menuPool.Add(menu);

            AddEngineItem(menu);
            AddDoorLockItem(menu);
            AddOpenDoorItem(menu);
            AddLockSpeedItem(menu);
            AddSaveVehicleItem(menu);

            menu.RefreshIndex();

            Tick += new Func <Task>(async delegate
            {
                await Task.FromResult(0);

                menuPool.ProcessMenus();
                if (Game.IsControlJustReleased(1, Control.InteractionMenu))
                {
                    menu.Visible = !menu.Visible;
                }
            });
        }
Esempio n. 8
0
        void OnTick2(object sender, EventArgs e)
        {
            if (modMenuPool != null)
            {
                modMenuPool.ProcessMenus();
            }
            Random random = new Random();
            Random List1  = new Random();
            Random List2  = new Random();

            FriendlyPed_List = List1.Next(0, 3); //生成FriendlyPed序号

            EnemyPed_List = List2.Next(0, 3);    //生成EnemyPed序号

            nX = random.Next(-10, 11);           //生成-10-10且不能是-5-5之间的随机数
            if (nX > -5 || nX < 5)
            {
                random.Next(-10, 11);
            }
            nY = random.Next(-10, 11);   //生成-10-10且不能是-5-5之间的随机数
            if (nY > -5 || nY < 5)
            {
                random.Next(-10, 11);
            }
        }
Esempio n. 9
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();
            };
        }
Esempio 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;
                }
            };
        }
Esempio n. 11
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);
            });
        }
        /// <summary>
        /// Main process that enters our key and makes the menu enabled
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public static void Process(object sender, GraphicsEventArgs e)
        {
            //A keys converter is used to convert a string to a key.
            KeysConverter kc = new KeysConverter();

            //We create two variables: one is a System.Windows.Keys, the other is a string.
            Keys EndCalloutKey;
            Keys EndCalloutKeyModifier;


            //Use a try/catch, because reading values from files is risky: we can never be sure what we're going to get and we don't want our plugin to crash.
            try
            {
                //We assign myKeyBinding the value of the string read by the method getMyKeyBinding(). We then use the kc.ConvertFromString method to convert this to a key.
                //If the string does not represent a valid key (see .ini file for a link) an exception is thrown. That's why we need a try/catch.
                EndCalloutKey         = (Keys)kc.ConvertFromString(getEndKey());
                EndCalloutKeyModifier = (Keys)kc.ConvertFromString(getEndCalloutKeyModifier());
            }
            //If there was an error reading the values, we set them to their defaults. We also let the user know via a notification.
            catch
            {
                EndCalloutKey         = Keys.End;
                EndCalloutKeyModifier = Keys.LShiftKey;
                Game.DisplayNotification("There was an error reading the .ini file. Setting defaults...");
            }

            if (Game.IsKeyDownRightNow(EndCalloutKeyModifier) && Game.IsKeyDownRightNow(EndCalloutKey) && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch.
            {
                mainMenu.Visible = !mainMenu.Visible;
            }

            _menuPool.ProcessMenus();       // Process all our menus: draw the menu and process the key strokes and the mouse.
        }
Esempio n. 13
0
        // This is where loops/things are run every frame.
        private void OnTick(object sender, EventArgs e)
        {
            _menuPool.ProcessMenus();

            if (Game.IsControlPressed(2, GTA.Control.VehicleAttack) && Game.IsControlPressed(2, GTA.Control.Jump))
            {
            }

            if (playerPed.IsGettingIntoAVehicle)
            {
                Vehicle veh = playerPed.GetVehicleIsTryingToEnter();
                if (veh.LockStatus == VehicleLockStatus.Locked)
                {
                    ///playerPed.Task.PlayAnimation("missheistfbisetup1", "unlock_exit_door");
                    playerPed.Task.EnterVehicle();
                }
            }


            if (inv)
            {
                playerPed.IsInvincible = true;
            }
            else
            {
                playerPed.IsInvincible = false;
            }
        }
Esempio n. 14
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;
                }
            };
        }
Esempio n. 15
0
 private void Main_Tick(object sender, System.EventArgs e)
 {
     if (menuPool != null)
     {
         menuPool.ProcessMenus();
     }
 }
Esempio n. 16
0
 public void OnTick(object sender, EventArgs eventArgs)
 {
     if (_barPool != null && (_menuPool == null || (_menuPool != null && !_menuPool.IsAnyMenuOpen())))
     {
         _barPool.Draw();
     }
     _menuPool?.ProcessMenus();
 }
Esempio n. 17
0
 //static bool pulloveractive = false;
 private static void Process(object sender, GraphicsEventArgs e)
 {
     _MenuPool.ProcessMenus();
     if (CourtsMenu.Visible)
     {
         CourtsMenu.Update();
     }
 }
Esempio n. 18
0
 private void Render(List <Events.TickNametagData> nametags)
 {
     if (_disableControls)
     {
         RAGE.Game.Pad.DisableAllControlActions(0);
     }
     _charMenu?.ProcessMenus();
 }
Esempio n. 19
0
        private async Task Main()
        {
            while (true)
            {
                await Delay(0);

                _menuPool.ProcessMenus();
            }
        }
Esempio n. 20
0
 public static void Update()
 {
     MenuPool.ProcessMenus();
     UpdateHUD();
     foreach (var uiElement in UIElements)
     {
         uiElement.Value.Update();
     }
 }
        public static void Process(System.Object obj, GraphicsEventArgs eva)
        {
            ICollection <Keys> klawisze = RAGENativeUI.Common.GetPressedKeys();

            if ((klawisze.Contains(RageShowMyLocationClass.modifier_key) && klawisze.Contains(RageShowMyLocationClass.menu_key)) && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch.
            {
                mainMenu.Visible = !mainMenu.Visible;
            }
            _menuPool.ProcessMenus();       // Procces all our menus: draw the menu and procces the key strokes and the mouse.
        }
 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);
         }
     }
 }
Esempio n. 23
0
        private void Tick(List <Events.TickNametagData> nametags)
        {
            if (VERSION != null)
            {
                RAGE.Game.Ui.SetTextOutline();
                RAGE.Game.UIText.Draw(VERSION, new Point(ScreenResX / 2, ScreenResY - (int)(ScreenResY * 0.03)), 0.35f, Color.White, RAGE.Game.Font.ChaletLondon, true);
            }

            _clothespool?.ProcessMenus();
        }
Esempio n. 24
0
 public void onTick(object sender, EventArgs e)
 {
     modules.ForEach(mod =>
     {
         if (mod.isEnabled())
         {
             mod.onTick();
         }
     });
     _menuPool.ProcessMenus();
 }
Esempio n. 25
0
 private void OnTick(object sender, EventArgs e)
 {
     _menuPool.ProcessMenus();
     CheckEngineState();
     GodMode();
     BrakeLightOnPark();
     CarInfo();
     AutoStart();
     CheckAutoStart();
     alarmWhenPlayerTryOpenClosedDoors();
 }
Esempio n. 26
0
        public override void OnUpdate(int gameTime)
        {
            basePool.ProcessMenus();

            if (Game.IsControlJustPressed(0, Control.ReplayEndpoint))
            {
                mainMenu.Visible = !mainMenu.Visible;
            }

            base.OnUpdate(gameTime);
        }
Esempio n. 27
0
        private static async Task ProcessMenuPool()
        {
            MenuPool.ProcessMenus();

            if (MenuPool.ToList().Count == 0 && Camera != null)
            {
                Camera = null;
                ShowShopMenu();
            }

            if (Game.IsControlJustPressed(0, (Control)244) || Game.IsDisabledControlJustPressed(0, (Control)244))   //M
            {
                ShowInGameMenu();
            }

            if (Game.IsControlJustPressed(0, (Control)174) || Game.IsDisabledControlJustPressed(0, (Control)174))   // left
            {
                if (User.GetStatusType() != StatusTypes.Spectator)
                {
                    return;
                }

                var list = new NavigationList <Player>();
                list.AddRange(new PlayerList().Where(p => !p.IsDead).Where(p => !p.IsInvincible));
                try
                {
                    User.StartSpec(list.MovePrevious);
                }
                catch (Exception e)
                {
                    Debug.WriteLine($"{list.Count} | {e}");
                    User.StartSpec(list.First());
                }
            }
            else if (Game.IsControlJustPressed(0, (Control)175) || Game.IsDisabledControlJustPressed(0, (Control)175))   // right
            {
                if (User.GetStatusType() != StatusTypes.Spectator)
                {
                    return;
                }
                var list = new NavigationList <Player>();
                list.AddRange(new PlayerList().Where(p => !p.IsDead).Where(p => !p.IsInvincible));
                try
                {
                    User.StartSpec(list.MoveNext);
                }
                catch (Exception e)
                {
                    Debug.WriteLine($"{list.Count} | {e}");
                    User.StartSpec(list.Last());
                }
            }
        }
Esempio n. 28
0
        public void Update()
        {
            MenuPool.ProcessMenus();

            UpdateCommunityEvent();

            if (SetProfileNull && BatmanProfile != null)
            {
                BatmanProfile  = null;
                SetProfileNull = false;
            }
        }
Esempio n. 29
0
 private static void MenuProcess()
 {
     while (true)
     {
         GameFiber.Yield();
         if (Game.IsKeyDown(Globals.menuKey))
         {
             mainMenu.Visible = !mainMenu.Visible;
         }
         _MenuPool.ProcessMenus();
     }
 }
Esempio n. 30
0
        internal static void ProcessLoop()
        {
            while (true)
            {
                GameFiber.Yield();

                if (_mainMenu.Visible)
                {
                    _menuPool.ProcessMenus();
                }
            }
        }