Ejemplo n.º 1
2
        public GTA()
        {
            Tick += OnTick;
            KeyDown += OnKeyDown;
            _menuPool = new MenuPool();
            #region TrainerMenu
            mainMenu = new UIMenu("YTrainer", "~b~YTrainer v0.1");
            _menuPool.Add(mainMenu);

            var GOptions = new UIMenuItem("World & Game Options");
            mainMenu.AddItem(GOptions);
            var COptions = new UIMenuItem("Vehicle Options");
            mainMenu.AddItem(COptions);
            var POptions = new UIMenuItem("Player Options");
            mainMenu.AddItem(POptions);
            var SpawnOptions = new UIMenuItem("Car Spawning");
            mainMenu.AddItem(SpawnOptions);
            var TOptions = new UIMenuItem("Time Options");
            mainMenu.AddItem(TOptions);
            var WeOptions = new UIMenuItem("Weather Options");
            mainMenu.AddItem(WeOptions);
            var WOptions = new UIMenuItem("Weapons Options");
            mainMenu.AddItem(WOptions);
            var TeOptions = new UIMenuItem("Teleports Options");
            mainMenu.AddItem(TeOptions);
            mainMenu.RefreshIndex();
            #endregion
            #region GeneralMenu
            generalMenu = new UIMenu("World & Game Options", "");
            _menuPool.Add(generalMenu);
            generalMenu.AddItem(HUD = new UIMenuCheckboxItem("Hide Hud and Radar", false));
            generalMenu.AddItem(new UIMenuItem("Save Game"));
            generalMenu.AddItem(nVision = new UIMenuCheckboxItem("Night Vision", false));
            generalMenu.RefreshIndex();
            generalMenu.OnCheckboxChange += OnCheckboxChange;
            generalMenu.OnItemSelect += OnItemSelect;
            #endregion
            #region VehicleMenu
            carMenu = new UIMenu("Vehicle Options", "");
            _menuPool.Add(carMenu);
            carMenu.AddItem(CGM = new UIMenuCheckboxItem("Car GodMode", false));
            carMenu.AddItem(new UIMenuItem("Flip Car"));
            carMenu.AddItem(new UIMenuItem("Clean Car"));
            carMenu.AddItem(DS = new UIMenuCheckboxItem("Default Station", false));
            carMenu.AddItem(new UIMenuItem("Drive to Waypoint"));
            carMenu.AddItem(new UIMenuItem("Stop Drive to Waypoint"));
            carMenu.AddItem(VisibleC = new UIMenuCheckboxItem("Visible Car", false));
            carMenu.AddItem(new UIMenuItem("Repair Car"));
            carMenu.AddItem(new UIMenuItem("Open Left Front Door"));
            carMenu.AddItem(new UIMenuItem("Open Right Front Door"));
            carMenu.AddItem(new UIMenuItem("Open Left Rear Door"));
            carMenu.AddItem(new UIMenuItem("Open Right Rear Door"));
            carMenu.AddItem(new UIMenuItem("Open Hood"));
            carMenu.AddItem(new UIMenuItem("Open Trunk"));
            carMenu.AddItem(new UIMenuItem("Open All Car Doors"));
            carMenu.AddItem(new UIMenuItem("Close Left Front Door"));
            carMenu.AddItem(new UIMenuItem("Close Right Front Door"));
            carMenu.AddItem(new UIMenuItem("Close Left Rear Door"));
            carMenu.AddItem(new UIMenuItem("Close Right Rear Door"));
            carMenu.AddItem(new UIMenuItem("Close Hood"));
            carMenu.AddItem(new UIMenuItem("Close Trunk"));
            carMenu.AddItem(new UIMenuItem("Close All Car Doors"));
            var Colors = new List<dynamic>
            {
                "Red","Blue","Black","Green","White","Yellow"
            };
            carMenu.AddItem(CarColors = new UIMenuListItem("Change Car Color", Colors, 0));
            carMenu.RefreshIndex();
            carMenu.OnCheckboxChange += OnCheckboxChange;
            carMenu.OnItemSelect += OnItemSelect;
            carMenu.OnListChange += OnListChange;
            #endregion
            #region PlayerMenu
            playerMenu = new UIMenu("Player Options", "");
            _menuPool.Add(playerMenu);
            playerMenu.AddItem(GM = new UIMenuCheckboxItem("God Mode", false));
            playerMenu.AddItem(UA = new UIMenuCheckboxItem("Unlimited Ammo", false));
            playerMenu.AddItem(uAbility = new UIMenuCheckboxItem("Unlimited Ability", false));
            var Wanted = new List<dynamic>
            {
                "0",
                "1",
                "2",
                "3",
                "4",
                "5",
            };
            playerMenu.AddItem(WantedLevel = new UIMenuListItem("Wanted Level", Wanted, 0));
            playerMenu.AddItem(new UIMenuItem("Give Money"));
            playerMenu.AddItem(VisibleP = new UIMenuCheckboxItem("Player Visible", false));
            playerMenu.AddItem(NW = new UIMenuCheckboxItem("Never Wanted", false));
            playerMenu.AddItem(new UIMenuItem("Add Health"));
            playerMenu.AddItem(new UIMenuItem("Add Armour"));
            playerMenu.AddItem(mRadio = new UIMenuCheckboxItem("Radio Menu", false));
            playerMenu.AddItem(fastRun = new UIMenuCheckboxItem("Fast Run", false));
            playerMenu.AddItem(fastSwim = new UIMenuCheckboxItem("Fast Swim", false));
            playerMenu.RefreshIndex();
            playerMenu.OnCheckboxChange += OnCheckboxChange;
            playerMenu.OnItemSelect += OnItemSelect;
            playerMenu.OnListChange += OnListChange;
            #endregion
            #region TimeMenu
            timeMenu = new UIMenu("Time Options", "");
            _menuPool.Add(timeMenu);
            timeMenu.AddItem(new UIMenuItem("Slow Motion 25%"));
            timeMenu.AddItem(new UIMenuItem("Slow Motion 50%"));
            timeMenu.AddItem(new UIMenuItem("Slow Motion 75%"));
            timeMenu.AddItem(new UIMenuItem("Normal Game Speed"));
            timeMenu.AddItem(new UIMenuItem("Fast Motion"));
            timeMenu.AddItem(new UIMenuItem("Noon (12)"));
            timeMenu.AddItem(new UIMenuItem("AfterNoon (18)"));
            timeMenu.AddItem(new UIMenuItem("Evening (23)"));
            timeMenu.AddItem(new UIMenuItem("Night (5)"));
            timeMenu.AddItem(new UIMenuItem("Ahead One Hour"));
            timeMenu.AddItem(new UIMenuItem("Back One Hour"));
            timeMenu.AddItem(SyncTime = new UIMenuCheckboxItem("Real Time", false));
            var Days = new List<dynamic>
            {
                "Sunday", //2
                "Monday",//3
                "Tuesday", //4
                "Thursday", //6
                "Wednesday", //5
                "Friday", //7
                "Saturday" //1
            };
            timeMenu.AddItem(DOH = new UIMenuListItem("Choose Day", Days, 0));
            timeMenu.RefreshIndex();
            timeMenu.OnItemSelect += OnItemSelect;
            timeMenu.OnListChange += OnListChange;
            #endregion
            #region WeatherMenu
            weatherMenu = new UIMenu("Weather Options", "");
            _menuPool.Add(weatherMenu);
            weatherMenu.AddItem(new UIMenuItem("Blizzard"));
            weatherMenu.AddItem(new UIMenuItem("Christmas"));
            weatherMenu.AddItem(new UIMenuItem("Clear"));
            weatherMenu.AddItem(new UIMenuItem("Clearing"));
            weatherMenu.AddItem(new UIMenuItem("Clouds"));
            weatherMenu.AddItem(new UIMenuItem("Extra Sunny"));
            weatherMenu.AddItem(new UIMenuItem("Foggy"));
            weatherMenu.AddItem(new UIMenuItem("Neutral"));
            weatherMenu.AddItem(new UIMenuItem("Overcast"));
            weatherMenu.AddItem(new UIMenuItem("Raining"));
            weatherMenu.AddItem(new UIMenuItem("Smog"));
            weatherMenu.AddItem(new UIMenuItem("Snowing"));
            weatherMenu.AddItem(new UIMenuItem("Snowlight"));
            weatherMenu.AddItem(new UIMenuItem("Thunder Storm"));
            weatherMenu.RefreshIndex();
            weatherMenu.OnItemSelect += OnItemSelect;
            #endregion
            #region WeaponMenu
            weaponMenu = new UIMenu("Weapons Options", "");
            _menuPool.Add(weaponMenu);
            weaponMenu.AddItem(new UIMenuItem("Baseball Bat"));
            weaponMenu.AddItem(new UIMenuItem("Knife"));
            weaponMenu.AddItem(new UIMenuItem("Nightstick"));
            weaponMenu.AddItem(new UIMenuItem("Crowbar"));
            weaponMenu.AddItem(new UIMenuItem("Golf Club"));
            weaponMenu.AddItem(new UIMenuItem("Hammer"));
            weaponMenu.AddItem(new UIMenuItem("Broken Bottle"));
            weaponMenu.AddItem(new UIMenuItem("Antique Cavalry Dagger"));
            weaponMenu.AddItem(new UIMenuItem("Hatchet"));
            weaponMenu.AddItem(new UIMenuItem("Knuckledusters"));
            weaponMenu.AddItem(new UIMenuItem("Machete"));
            weaponMenu.AddItem(new UIMenuItem("Flashlight"));
            weaponMenu.AddItem(new UIMenuItem("Pistol"));
            weaponMenu.AddItem(new UIMenuItem("Combat Pistol"));
            weaponMenu.AddItem(new UIMenuItem("AP Pistol"));
            weaponMenu.AddItem(new UIMenuItem("Stun Gun"));
            weaponMenu.AddItem(new UIMenuItem("Pistol .50"));
            weaponMenu.AddItem(new UIMenuItem("SNS Pistol"));
            weaponMenu.AddItem(new UIMenuItem("Heavy Pistol"));
            weaponMenu.AddItem(new UIMenuItem("Vintage Pistol"));
            weaponMenu.AddItem(new UIMenuItem("Flare Gun"));
            weaponMenu.AddItem(new UIMenuItem("Marksman Pistol"));
            weaponMenu.AddItem(new UIMenuItem("Micro SMG"));
            weaponMenu.AddItem(new UIMenuItem("SMG"));
            weaponMenu.AddItem(new UIMenuItem("Assault SMG"));
            weaponMenu.AddItem(new UIMenuItem("Combat PDW"));
            weaponMenu.AddItem(new UIMenuItem("Machine Pistol"));
            weaponMenu.AddItem(new UIMenuItem("Pump Shotgun"));
            weaponMenu.AddItem(new UIMenuItem("Sawed-Off Shotgun"));
            weaponMenu.AddItem(new UIMenuItem("Assault Shotgun"));
            weaponMenu.AddItem(new UIMenuItem("Bullpup Shotgun"));
            weaponMenu.AddItem(new UIMenuItem("Musket"));
            weaponMenu.AddItem(new UIMenuItem("Heavy Shotgun"));
            weaponMenu.AddItem(new UIMenuItem("Assault Rifle"));
            weaponMenu.AddItem(new UIMenuItem("Carbine Rifle"));
            weaponMenu.AddItem(new UIMenuItem("Advanced Rifle"));
            weaponMenu.AddItem(new UIMenuItem("Special Carbine"));
            weaponMenu.AddItem(new UIMenuItem("Bullpup Rifle"));
            weaponMenu.AddItem(new UIMenuItem("MG"));
            weaponMenu.AddItem(new UIMenuItem("Combat MG"));
            weaponMenu.AddItem(new UIMenuItem("Gusenberg Sweeper"));
            weaponMenu.AddItem(new UIMenuItem("Sniper Rifle"));
            weaponMenu.AddItem(new UIMenuItem("Heavy Sniper"));
            weaponMenu.AddItem(new UIMenuItem("Marksman Rifle"));
            weaponMenu.AddItem(new UIMenuItem("RPG"));
            weaponMenu.AddItem(new UIMenuItem("Grenade Launcher"));
            weaponMenu.AddItem(new UIMenuItem("Grenade Launcher Smoke"));
            weaponMenu.AddItem(new UIMenuItem("Minigun"));
            weaponMenu.AddItem(new UIMenuItem("Firework Launcher"));
            weaponMenu.AddItem(new UIMenuItem("Rail Gun"));
            weaponMenu.AddItem(new UIMenuItem("Homing Launcher"));
            weaponMenu.AddItem(new UIMenuItem("Grenade"));
            weaponMenu.AddItem(new UIMenuItem("Sticky Bomb"));
            weaponMenu.AddItem(new UIMenuItem("Tear Gas"));
            weaponMenu.AddItem(new UIMenuItem("Molotov Cocktail"));
            weaponMenu.AddItem(new UIMenuItem("Proximity Mine"));
            weaponMenu.AddItem(new UIMenuItem("Snowball"));
            weaponMenu.AddItem(new UIMenuItem("BZ Gas"));
            weaponMenu.AddItem(new UIMenuItem("Fire Extinguisher"));
            weaponMenu.AddItem(new UIMenuItem("Jerry Can"));
            weaponMenu.AddItem(new UIMenuItem("Digiscanner"));
            weaponMenu.AddItem(new UIMenuItem("Parachute"));
            weaponMenu.RefreshIndex();
            weaponMenu.OnItemSelect += OnItemSelect;
            #endregion
            #region TeleportMenu
            teleportMenu = new UIMenu("Teleports Options", "");
            _menuPool.Add(teleportMenu);
            var TSpaceship = new List<dynamic>
            {
                "1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20",
                "21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40",
                "41","42","43","44","45","46","47","48","49","50",
            };
            var TLetter = new List<dynamic>
            {
                "1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20",
                "21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40",
                "41","42","43","44","45","46","47","48","49","50",
            };
            teleportMenu.AddItem(Spaceship = new UIMenuListItem("Spaceship", TSpaceship, 0));
            teleportMenu.AddItem(LetterScraps = new UIMenuListItem("Letter Scraps", TLetter, 0));
            teleportMenu.AddItem(new UIMenuItem("Teleport to WayPoint"));
            teleportMenu.AddItem(new UIMenuItem("Teleport to Safehouse"));
            teleportMenu.AddItem(new UIMenuItem("Teleport to AmmuNation"));
            teleportMenu.AddItem(new UIMenuItem("Teleport to AmmuNation with shooting range"));
            teleportMenu.AddItem(new UIMenuItem("Teleport to Garage"));
            teleportMenu.AddItem(new UIMenuItem("Teleport to Barber Shop"));
            teleportMenu.RefreshIndex();
            teleportMenu.OnListChange += OnListChange;
            teleportMenu.OnItemSelect += OnItemSelect;
            #endregion
            #region SpawnVehicleMenu
            spawnMenu = new UIMenu("Car Spawning", "");
            _menuPool.Add(spawnMenu);
            spawnMenu.AddItem(new UIMenuItem("Adder"));
            spawnMenu.AddItem(new UIMenuItem("Airbus"));
            spawnMenu.AddItem(new UIMenuItem("Airtug"));
            spawnMenu.AddItem(new UIMenuItem("Akuma"));
            spawnMenu.AddItem(new UIMenuItem("Ambulance"));
            spawnMenu.AddItem(new UIMenuItem("Annihilator"));
            spawnMenu.AddItem(new UIMenuItem("Aseat"));
            spawnMenu.AddItem(new UIMenuItem("Aseat2 "));
            spawnMenu.AddItem(new UIMenuItem("Asterope"));
            spawnMenu.AddItem(new UIMenuItem("Bagger"));
            spawnMenu.AddItem(new UIMenuItem("Baller"));
            spawnMenu.AddItem(new UIMenuItem("Baller2"));
            spawnMenu.AddItem(new UIMenuItem("Banshee"));
            spawnMenu.AddItem(new UIMenuItem("Barracks"));
            spawnMenu.AddItem(new UIMenuItem("Barracks2"));
            spawnMenu.AddItem(new UIMenuItem("Bati"));
            spawnMenu.AddItem(new UIMenuItem("Bati2"));
            spawnMenu.AddItem(new UIMenuItem("Benson"));
            spawnMenu.AddItem(new UIMenuItem("Bfinjection"));
            spawnMenu.AddItem(new UIMenuItem("Biff"));
            spawnMenu.AddItem(new UIMenuItem("Bison"));
            spawnMenu.AddItem(new UIMenuItem("Bison2"));
            spawnMenu.AddItem(new UIMenuItem("Bison3"));
            spawnMenu.AddItem(new UIMenuItem("Bjkl "));
            spawnMenu.AddItem(new UIMenuItem("Blazer"));
            spawnMenu.AddItem(new UIMenuItem("Blazer2"));
            spawnMenu.AddItem(new UIMenuItem("Blazer3"));
            spawnMenu.AddItem(new UIMenuItem("Blimp"));
            spawnMenu.AddItem(new UIMenuItem("Blista"));
            spawnMenu.AddItem(new UIMenuItem("Bmx"));
            spawnMenu.AddItem(new UIMenuItem("Bobcatxl"));
            spawnMenu.AddItem(new UIMenuItem("Bodhi2"));
            spawnMenu.AddItem(new UIMenuItem("Boxvillet"));
            spawnMenu.AddItem(new UIMenuItem("Boxvillet2"));
            spawnMenu.AddItem(new UIMenuItem("Boxvillet3"));
            spawnMenu.AddItem(new UIMenuItem("Buccaner"));
            spawnMenu.AddItem(new UIMenuItem("Buffalo"));
            spawnMenu.AddItem(new UIMenuItem("Buffalo2"));
            spawnMenu.AddItem(new UIMenuItem("Bulldozer"));
            spawnMenu.AddItem(new UIMenuItem("Bullet "));
            spawnMenu.AddItem(new UIMenuItem("Burrito"));
            spawnMenu.AddItem(new UIMenuItem("Burrito2"));
            spawnMenu.AddItem(new UIMenuItem("Burrito3"));
            spawnMenu.AddItem(new UIMenuItem("Burrito4"));
            spawnMenu.AddItem(new UIMenuItem("Burrito5"));
            spawnMenu.AddItem(new UIMenuItem("Bus"));
            spawnMenu.AddItem(new UIMenuItem("Buzzard"));
            spawnMenu.AddItem(new UIMenuItem("Buzzard2"));
            spawnMenu.AddItem(new UIMenuItem("Caddy"));
            spawnMenu.AddItem(new UIMenuItem("Caddy2"));
            spawnMenu.AddItem(new UIMenuItem("Camper"));
            spawnMenu.AddItem(new UIMenuItem("Carbonizzare"));
            spawnMenu.AddItem(new UIMenuItem("Carbonrs"));
            spawnMenu.AddItem(new UIMenuItem("Cargobob"));
            spawnMenu.AddItem(new UIMenuItem("Cargobob2"));
            spawnMenu.AddItem(new UIMenuItem("Cargobob3 "));
            spawnMenu.AddItem(new UIMenuItem("Cargoplane"));
            spawnMenu.AddItem(new UIMenuItem("Cavalcade"));
            spawnMenu.AddItem(new UIMenuItem("Cavalcade2"));
            spawnMenu.AddItem(new UIMenuItem("Cheetah"));
            spawnMenu.AddItem(new UIMenuItem("Coach"));
            spawnMenu.AddItem(new UIMenuItem("Cogcabrio"));
            spawnMenu.AddItem(new UIMenuItem("Comet2"));
            spawnMenu.AddItem(new UIMenuItem("Coquette"));
            spawnMenu.AddItem(new UIMenuItem("Cruiser"));
            spawnMenu.AddItem(new UIMenuItem("Crusade"));
            spawnMenu.AddItem(new UIMenuItem("Cuban800"));
            spawnMenu.AddItem(new UIMenuItem("Cutter"));
            spawnMenu.AddItem(new UIMenuItem("Daemon"));
            spawnMenu.AddItem(new UIMenuItem("Dilettante"));
            spawnMenu.AddItem(new UIMenuItem("Dilettante2"));
            spawnMenu.AddItem(new UIMenuItem("Dinghy"));
            spawnMenu.AddItem(new UIMenuItem("Dinghy2"));
            spawnMenu.AddItem(new UIMenuItem("Dloader"));
            spawnMenu.AddItem(new UIMenuItem("Docktug"));
            spawnMenu.AddItem(new UIMenuItem("Dominator"));
            spawnMenu.AddItem(new UIMenuItem("Double"));
            spawnMenu.AddItem(new UIMenuItem("Dubsta"));
            spawnMenu.AddItem(new UIMenuItem("Dubsta2"));
            spawnMenu.AddItem(new UIMenuItem("Dump"));
            spawnMenu.AddItem(new UIMenuItem("Dune"));
            spawnMenu.AddItem(new UIMenuItem("Dune2"));
            spawnMenu.AddItem(new UIMenuItem("Duster"));
            spawnMenu.AddItem(new UIMenuItem("Elegy2"));
            spawnMenu.AddItem(new UIMenuItem("Emperor"));
            spawnMenu.AddItem(new UIMenuItem("Emperor2"));
            spawnMenu.AddItem(new UIMenuItem("Emperor3"));
            spawnMenu.AddItem(new UIMenuItem("Entityxf"));
            spawnMenu.AddItem(new UIMenuItem("Exemplar"));
            spawnMenu.AddItem(new UIMenuItem("F620"));
            spawnMenu.AddItem(new UIMenuItem("Faggio2"));
            spawnMenu.AddItem(new UIMenuItem("Fbi"));
            spawnMenu.AddItem(new UIMenuItem("Fbi2"));
            spawnMenu.AddItem(new UIMenuItem("Felon"));
            spawnMenu.AddItem(new UIMenuItem("Felon2"));
            spawnMenu.AddItem(new UIMenuItem("Feltzer2"));
            spawnMenu.AddItem(new UIMenuItem("Firetruk"));
            spawnMenu.AddItem(new UIMenuItem("Fixter"));
            spawnMenu.AddItem(new UIMenuItem("Flatbed"));
            spawnMenu.AddItem(new UIMenuItem("Forklift"));
            spawnMenu.AddItem(new UIMenuItem("Fq2"));
            spawnMenu.AddItem(new UIMenuItem("Frogger"));
            spawnMenu.AddItem(new UIMenuItem("Frogger2"));
            spawnMenu.AddItem(new UIMenuItem("Fugitive"));
            spawnMenu.AddItem(new UIMenuItem("Fusilade"));
            spawnMenu.AddItem(new UIMenuItem("Futo"));
            spawnMenu.AddItem(new UIMenuItem("Gauntlet"));
            spawnMenu.AddItem(new UIMenuItem("Gburrito"));
            spawnMenu.AddItem(new UIMenuItem("Granger"));
            spawnMenu.AddItem(new UIMenuItem("Gresley"));
            spawnMenu.AddItem(new UIMenuItem("Habanero"));
            spawnMenu.AddItem(new UIMenuItem("Handler"));
            spawnMenu.AddItem(new UIMenuItem("Hauler"));
            spawnMenu.AddItem(new UIMenuItem("Hexer"));
            spawnMenu.AddItem(new UIMenuItem("Hotknife"));
            spawnMenu.AddItem(new UIMenuItem("Infernus"));
            spawnMenu.AddItem(new UIMenuItem("Ingot"));
            spawnMenu.AddItem(new UIMenuItem("Intruder"));
            spawnMenu.AddItem(new UIMenuItem("Issi2"));
            spawnMenu.AddItem(new UIMenuItem("Jackal"));
            spawnMenu.AddItem(new UIMenuItem("Jb700"));
            spawnMenu.AddItem(new UIMenuItem("Jet"));
            spawnMenu.AddItem(new UIMenuItem("Jetmax"));
            spawnMenu.AddItem(new UIMenuItem("Journey"));
            spawnMenu.AddItem(new UIMenuItem("Khamelion"));
            spawnMenu.AddItem(new UIMenuItem("Ladstalker"));
            spawnMenu.AddItem(new UIMenuItem("Lazer"));
            spawnMenu.AddItem(new UIMenuItem("Lguard"));
            spawnMenu.AddItem(new UIMenuItem("Luxor"));
            spawnMenu.AddItem(new UIMenuItem("Mammatus"));
            spawnMenu.AddItem(new UIMenuItem("Manana"));
            spawnMenu.AddItem(new UIMenuItem("Marquis"));
            spawnMenu.AddItem(new UIMenuItem("Maverick"));
            spawnMenu.AddItem(new UIMenuItem("Mesa"));
            spawnMenu.AddItem(new UIMenuItem("Mesa2"));
            spawnMenu.AddItem(new UIMenuItem("Mesa3"));
            spawnMenu.AddItem(new UIMenuItem("Minivan"));
            spawnMenu.AddItem(new UIMenuItem("Mixer"));
            spawnMenu.AddItem(new UIMenuItem("Mixer2"));
            spawnMenu.AddItem(new UIMenuItem("Monroe"));
            spawnMenu.AddItem(new UIMenuItem("Mower"));
            spawnMenu.AddItem(new UIMenuItem("Mule"));
            spawnMenu.AddItem(new UIMenuItem("Mule2"));
            spawnMenu.AddItem(new UIMenuItem("Nemesis"));
            spawnMenu.AddItem(new UIMenuItem("Ninef"));
            spawnMenu.AddItem(new UIMenuItem("Ninef2"));
            spawnMenu.AddItem(new UIMenuItem("Oracle"));
            spawnMenu.AddItem(new UIMenuItem("Oracle2"));
            spawnMenu.AddItem(new UIMenuItem("Packer"));
            spawnMenu.AddItem(new UIMenuItem("Patriot"));
            spawnMenu.AddItem(new UIMenuItem("Pbus"));
            spawnMenu.AddItem(new UIMenuItem("Pcj"));
            spawnMenu.AddItem(new UIMenuItem("Penumbra"));
            spawnMenu.AddItem(new UIMenuItem("Peyote"));
            spawnMenu.AddItem(new UIMenuItem("Phantom"));
            spawnMenu.AddItem(new UIMenuItem("Phoenix"));
            spawnMenu.AddItem(new UIMenuItem("Picador"));
            spawnMenu.AddItem(new UIMenuItem("Police"));
            spawnMenu.AddItem(new UIMenuItem("Police2"));
            spawnMenu.AddItem(new UIMenuItem("Police3"));
            spawnMenu.AddItem(new UIMenuItem("Police4"));
            spawnMenu.AddItem(new UIMenuItem("Policeb"));
            spawnMenu.AddItem(new UIMenuItem("Policeold1"));
            spawnMenu.AddItem(new UIMenuItem("Policeold2"));
            spawnMenu.AddItem(new UIMenuItem("Policet"));
            spawnMenu.AddItem(new UIMenuItem("Polmav"));
            spawnMenu.AddItem(new UIMenuItem("Pony"));
            spawnMenu.AddItem(new UIMenuItem("Pony2"));
            spawnMenu.AddItem(new UIMenuItem("Pounder"));
            spawnMenu.AddItem(new UIMenuItem("Praire"));
            spawnMenu.AddItem(new UIMenuItem("Pranger"));
            spawnMenu.AddItem(new UIMenuItem("Predator"));
            spawnMenu.AddItem(new UIMenuItem("Premier"));
            spawnMenu.AddItem(new UIMenuItem("Primo"));
            spawnMenu.AddItem(new UIMenuItem("Radi"));
            spawnMenu.AddItem(new UIMenuItem("Rancherxl"));
            spawnMenu.AddItem(new UIMenuItem("Rancherxl2"));
            spawnMenu.AddItem(new UIMenuItem("Rapidgt"));
            spawnMenu.AddItem(new UIMenuItem("Rapidgt2"));
            spawnMenu.AddItem(new UIMenuItem("Ratloader"));
            spawnMenu.AddItem(new UIMenuItem("Rebel"));
            spawnMenu.AddItem(new UIMenuItem("Rebel2"));
            spawnMenu.AddItem(new UIMenuItem("Regina"));
            spawnMenu.AddItem(new UIMenuItem("Rentalbus"));
            spawnMenu.AddItem(new UIMenuItem("Rhino"));
            spawnMenu.AddItem(new UIMenuItem("Riot"));
            spawnMenu.AddItem(new UIMenuItem("Ripley"));
            spawnMenu.AddItem(new UIMenuItem("Rocoto"));
            spawnMenu.AddItem(new UIMenuItem("Romero"));
            spawnMenu.AddItem(new UIMenuItem("Rubble"));
            spawnMenu.AddItem(new UIMenuItem("Ruffian"));
            spawnMenu.AddItem(new UIMenuItem("Ruiner"));
            spawnMenu.AddItem(new UIMenuItem("Rumpo"));
            spawnMenu.AddItem(new UIMenuItem("Rumpo2"));
            spawnMenu.AddItem(new UIMenuItem("Sabregt"));
            spawnMenu.AddItem(new UIMenuItem("Sadler"));
            spawnMenu.AddItem(new UIMenuItem("Sadler2"));
            spawnMenu.AddItem(new UIMenuItem("Sanchez"));
            spawnMenu.AddItem(new UIMenuItem("Sanchez2"));
            spawnMenu.AddItem(new UIMenuItem("Sandking"));
            spawnMenu.AddItem(new UIMenuItem("Sandking2"));
            spawnMenu.AddItem(new UIMenuItem("Schafter2"));
            spawnMenu.AddItem(new UIMenuItem("Schwarzer"));
            spawnMenu.AddItem(new UIMenuItem("Scorcher"));
            spawnMenu.AddItem(new UIMenuItem("Scrap"));
            spawnMenu.AddItem(new UIMenuItem("Seashark"));
            spawnMenu.AddItem(new UIMenuItem("Seashark2"));
            spawnMenu.AddItem(new UIMenuItem("Seminole"));
            spawnMenu.AddItem(new UIMenuItem("Sentinel"));
            spawnMenu.AddItem(new UIMenuItem("Sentinel2"));
            spawnMenu.AddItem(new UIMenuItem("Serrano"));
            spawnMenu.AddItem(new UIMenuItem("Shamal"));
            spawnMenu.AddItem(new UIMenuItem("Sheriff"));
            spawnMenu.AddItem(new UIMenuItem("Sheriff2"));
            spawnMenu.AddItem(new UIMenuItem("Skylift"));
            spawnMenu.AddItem(new UIMenuItem("Speedo"));
            spawnMenu.AddItem(new UIMenuItem("Speedo2"));
            spawnMenu.AddItem(new UIMenuItem("Squalo"));
            spawnMenu.AddItem(new UIMenuItem("Stanier"));
            spawnMenu.AddItem(new UIMenuItem("Stinger"));
            spawnMenu.AddItem(new UIMenuItem("Stingergt"));
            spawnMenu.AddItem(new UIMenuItem("Stockade"));
            spawnMenu.AddItem(new UIMenuItem("Stockade3"));
            spawnMenu.AddItem(new UIMenuItem("Stratum"));
            spawnMenu.AddItem(new UIMenuItem("Stretch"));
            spawnMenu.AddItem(new UIMenuItem("Stunt"));
            spawnMenu.AddItem(new UIMenuItem("Submersible"));
            spawnMenu.AddItem(new UIMenuItem("Sultan"));
            spawnMenu.AddItem(new UIMenuItem("Suntrap"));
            spawnMenu.AddItem(new UIMenuItem("Superd"));
            spawnMenu.AddItem(new UIMenuItem("Surano"));
            spawnMenu.AddItem(new UIMenuItem("Surfer"));
            spawnMenu.AddItem(new UIMenuItem("Surfer2"));
            spawnMenu.AddItem(new UIMenuItem("Surge"));
            spawnMenu.AddItem(new UIMenuItem("Taco"));
            spawnMenu.AddItem(new UIMenuItem("Tailgater"));
            spawnMenu.AddItem(new UIMenuItem("Tankercar"));
            spawnMenu.AddItem(new UIMenuItem("Taxi"));
            spawnMenu.AddItem(new UIMenuItem("Tiptruck"));
            spawnMenu.AddItem(new UIMenuItem("Tiptruck2"));
            spawnMenu.AddItem(new UIMenuItem("Titan"));
            spawnMenu.AddItem(new UIMenuItem("Tornado"));
            spawnMenu.AddItem(new UIMenuItem("Tornado2"));
            spawnMenu.AddItem(new UIMenuItem("Tornado3"));
            spawnMenu.AddItem(new UIMenuItem("Tornado4"));
            spawnMenu.AddItem(new UIMenuItem("Tourbus"));
            spawnMenu.AddItem(new UIMenuItem("Towtruck"));
            spawnMenu.AddItem(new UIMenuItem("Towtruck2"));
            spawnMenu.AddItem(new UIMenuItem("Tractor"));
            spawnMenu.AddItem(new UIMenuItem("Tractor2"));
            spawnMenu.AddItem(new UIMenuItem("Tractor3"));
            spawnMenu.AddItem(new UIMenuItem("Trash"));
            spawnMenu.AddItem(new UIMenuItem("Tropic"));
            spawnMenu.AddItem(new UIMenuItem("Utilitruck"));
            spawnMenu.AddItem(new UIMenuItem("Utilitruck2"));
            spawnMenu.AddItem(new UIMenuItem("Utilitruck3"));
            spawnMenu.AddItem(new UIMenuItem("Vacca"));
            spawnMenu.AddItem(new UIMenuItem("Vader"));
            spawnMenu.AddItem(new UIMenuItem("Velum"));
            spawnMenu.AddItem(new UIMenuItem("Vigero"));
            spawnMenu.AddItem(new UIMenuItem("Voltic"));
            spawnMenu.AddItem(new UIMenuItem("Voodoo2"));
            spawnMenu.AddItem(new UIMenuItem("Washington"));
            spawnMenu.AddItem(new UIMenuItem("Youga"));
            spawnMenu.AddItem(new UIMenuItem("Zion"));
            spawnMenu.AddItem(new UIMenuItem("Zion2"));
            spawnMenu.AddItem(new UIMenuItem("Ztype"));
            spawnMenu.AddItem(new UIMenuItem("Bifta DLC Beach Bum"));
            spawnMenu.AddItem(new UIMenuItem("Kalahari DLC Beach Bum"));
            spawnMenu.AddItem(new UIMenuItem("Paradise DLC Beach Bum"));
            spawnMenu.AddItem(new UIMenuItem("Speeder DLC Beach Bum"));
            spawnMenu.AddItem(new UIMenuItem("Alpha DLC The Business"));
            spawnMenu.AddItem(new UIMenuItem("Jester DLC The Business"));
            spawnMenu.AddItem(new UIMenuItem("TurismoR DLC The Business"));
            spawnMenu.AddItem(new UIMenuItem("Vestra DLC The Business"));
            spawnMenu.AddItem(new UIMenuItem("Huntley DLC The High Life"));
            spawnMenu.AddItem(new UIMenuItem("Massacro DLC The High Life"));
            spawnMenu.AddItem(new UIMenuItem("Thrust DLC The High Life"));
            spawnMenu.AddItem(new UIMenuItem("Zentorno DLC The High Life"));
            spawnMenu.AddItem(new UIMenuItem("Blade DLC I'm Not a Hipster"));
            spawnMenu.AddItem(new UIMenuItem("Dubsta3 DLC I'm Not a Hipster"));
            spawnMenu.AddItem(new UIMenuItem("Glendale DLC I'm Not a Hipster"));
            spawnMenu.AddItem(new UIMenuItem("Panto DLC I'm Not a Hipster"));
            spawnMenu.AddItem(new UIMenuItem("Pigalle DLC I'm Not a Hipster"));
            spawnMenu.AddItem(new UIMenuItem("Rhapsody DLC I'm Not a Hipster"));
            spawnMenu.AddItem(new UIMenuItem("Warrener DLC I'm Not a Hipster"));
            spawnMenu.AddItem(new UIMenuItem("Monster DLC Indipendence Day"));
            spawnMenu.AddItem(new UIMenuItem("Sovereign DLC Indipendence Day"));
            spawnMenu.AddItem(new UIMenuItem("Furoregt DLC Last Team Standing"));
            spawnMenu.AddItem(new UIMenuItem("Hakuchou DLC Last Team Standing"));
            spawnMenu.AddItem(new UIMenuItem("Innovation DLC Last Team Standing"));
            spawnMenu.AddItem(new UIMenuItem("Besra DLC The San Andreas Flight School"));
            spawnMenu.AddItem(new UIMenuItem("Coquette2 DLC The San Andreas Flight School"));
            spawnMenu.AddItem(new UIMenuItem("Miljet DLC The San Andreas Flight School"));
            spawnMenu.AddItem(new UIMenuItem("Swift DLC The San Andreas Flight School"));
            spawnMenu.AddItem(new UIMenuItem("Btype DLC The Valentine Day Massacre"));
            spawnMenu.AddItem(new UIMenuItem("Blimp2"));
            spawnMenu.AddItem(new UIMenuItem("Blista2"));
            spawnMenu.AddItem(new UIMenuItem("Blista3"));
            spawnMenu.AddItem(new UIMenuItem("Buffalo3"));
            spawnMenu.AddItem(new UIMenuItem("Dodo"));
            spawnMenu.AddItem(new UIMenuItem("Dominator2"));
            spawnMenu.AddItem(new UIMenuItem("Dukes"));
            spawnMenu.AddItem(new UIMenuItem("Dukes2"));
            spawnMenu.AddItem(new UIMenuItem("Gauntlet2"));
            spawnMenu.AddItem(new UIMenuItem("Marshall"));
            spawnMenu.AddItem(new UIMenuItem("Stallion"));
            spawnMenu.AddItem(new UIMenuItem("Stallion2"));
            spawnMenu.AddItem(new UIMenuItem("Submersible2"));
            spawnMenu.AddItem(new UIMenuItem("Jester2 DLC Festive Surprise"));
            spawnMenu.AddItem(new UIMenuItem("Massacro2 DLC Festive Surprise"));
            spawnMenu.AddItem(new UIMenuItem("Ratloader2 DLC Festive Surprise"));
            spawnMenu.AddItem(new UIMenuItem("Slamvan DLC Festive Surprise"));
            spawnMenu.AddItem(new UIMenuItem("Btype2 DLC Halloween"));
            spawnMenu.AddItem(new UIMenuItem("Lurcher DLC Halloween"));
            spawnMenu.AddItem(new UIMenuItem("Barracks3 DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Boxville4 DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Casco DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Dinghy3 DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Enduro DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Gburrito2 DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Guardian DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Hydra DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Insurgent DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Insurgent2 DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Kuruma DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Kuruma2 DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Lectro DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Mule3 DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Savage DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Slamvan2 DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Technical DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Trash2 DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Valkyrie DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Velum2 DLC Heists"));
            spawnMenu.AddItem(new UIMenuItem("Buccaner2 DLC Lowrider"));
            spawnMenu.AddItem(new UIMenuItem("Chino2 DLC Lowrider"));
            spawnMenu.AddItem(new UIMenuItem("Faction DLC Lowrider"));
            spawnMenu.AddItem(new UIMenuItem("Faction2 DLC Lowrider"));
            spawnMenu.AddItem(new UIMenuItem("Moonbeam DLC Lowrider"));
            spawnMenu.AddItem(new UIMenuItem("Moonbeam2 DLC Lowrider"));
            spawnMenu.AddItem(new UIMenuItem("Primo2 DLC Lowrider"));
            spawnMenu.AddItem(new UIMenuItem("Voodoo DLC Lowrider"));
            spawnMenu.AddItem(new UIMenuItem("Feltzer3 DLC Ill Gotten Gains Part 1"));
            spawnMenu.AddItem(new UIMenuItem("Luxor2 DLC Ill Gotten Gains Part 1"));
            spawnMenu.AddItem(new UIMenuItem("Osiris DLC Ill Gotten Gains Part 1"));
            spawnMenu.AddItem(new UIMenuItem("Swift2 DLC Ill Gotten Gains Part 1"));
            spawnMenu.AddItem(new UIMenuItem("Virgo DLC Ill Gotten Gains Part 1"));
            spawnMenu.AddItem(new UIMenuItem("Windsor DLC Ill Gotten Gains Part 1"));
            spawnMenu.AddItem(new UIMenuItem("Brawler DLC Ill Gotten Gains Part 2"));
            spawnMenu.AddItem(new UIMenuItem("Chino DLC Ill Gotten Gains Part 2"));
            spawnMenu.AddItem(new UIMenuItem("Coquette3 DLC Ill Gotten Gains Part 2"));
            spawnMenu.AddItem(new UIMenuItem("T20 DLC Ill Gotten Gains Part 2"));
            spawnMenu.AddItem(new UIMenuItem("Toro DLC Ill Gotten Gains Part 2"));
            spawnMenu.AddItem(new UIMenuItem("Vindicator DLC Ill Gotten Gains Part 2"));
            spawnMenu.OnItemSelect += OnItemSelect;
            spawnMenu.RefreshIndex();
            #endregion
            mainMenu.BindMenuToItem(generalMenu, GOptions);
            mainMenu.BindMenuToItem(carMenu, COptions);
            mainMenu.BindMenuToItem(playerMenu, POptions);
            mainMenu.BindMenuToItem(timeMenu, TOptions);
            mainMenu.BindMenuToItem(weatherMenu, WeOptions);
            mainMenu.BindMenuToItem(weaponMenu, WOptions);
            mainMenu.BindMenuToItem(teleportMenu, TeOptions);
            mainMenu.BindMenuToItem(spawnMenu, SpawnOptions);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Add checkbox to menu.
 /// </summary>
 /// <param name="menu">Parent menu.</param>
 /// <param name="item">The checkbox item.</param>
 /// <param name="OnSelect">What to do when item is selected.</param>
 /// <param name="OnHover">What to do when item is hovered.</param>
 /// <param name="OnChange">What to do when checkbox selection is changed.</param>
 public void AddCheckboxItem(
     UIMenu menu, UIMenuCheckboxItem item,
     Action OnSelect = null, Action OnHover = null, Action<bool> OnChange = null)
 {
     AddItem(menu, item, OnSelect: OnSelect, OnHover: OnHover);
     if (OnChange != null)
         menu.OnCheckboxChange += (sender, item2, checked_) =>
         {
             if (item == item2) OnChange(checked_);
         };
 }
Ejemplo n.º 3
0
 public void AddMenuKetchup(UIMenu menu)
 {
     var newitem = new UIMenuCheckboxItem("Add ketchup?", ketchup, "Do you wish to add ketchup?");
     menu.AddItem(newitem);
     menu.OnCheckboxChange += (sender, item, checked_) =>
     {
         if (item == newitem)
         {
             ketchup = checked_;
             UI.Notify("~r~Ketchup status: ~b~" + ketchup);
         }
     };
 }
Ejemplo n.º 4
0
    public MenuExample()
    {
        Tick += OnTick;
        KeyDown += OnKeyDown;
        _menuPool = new MenuPool();

        mainMenu = new UIMenu("Native UI", "~b~NATIVEUI SHOWCASE");
        _menuPool.Add(mainMenu);

        mainMenu.AddItem(ketchupCheckbox = new UIMenuCheckboxItem("Add ketchup?", false, "Do you wish to add ketchup?"));
        var foods = new List<dynamic>
        {
            "Banana",
            "Apple",
            "Pizza",
            "Quartilicious",
            0xF00D, // Dynamic!
        };
        mainMenu.AddItem(dishesListItem = new UIMenuListItem("Food", foods, 0));
        mainMenu.AddItem(cookItem = new UIMenuItem("Cook!", "Cook the dish with the appropiate ingredients and ketchup."));

        var menuItem = new UIMenuItem("Go to another menu.");
        mainMenu.AddItem(menuItem);
        cookItem.SetLeftBadge(UIMenuItem.BadgeStyle.Star);
        cookItem.SetRightBadge(UIMenuItem.BadgeStyle.Tick);
        mainMenu.RefreshIndex();

        mainMenu.OnItemSelect += OnItemSelect;
        mainMenu.OnListChange += OnListChange;
        mainMenu.OnCheckboxChange += OnCheckboxChange;
        mainMenu.OnIndexChange += OnItemChange;

        newMenu = new UIMenu("Native UI", "~r~NATIVEUI SHOWCASE");
        _menuPool.Add(newMenu);
        for (int i = 0; i < 20; i++)
        {
            newMenu.AddItem(new UIMenuItem("PageFiller", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!"));
        }
        newMenu.RefreshIndex();
        mainMenu.BindMenuToItem(newMenu, menuItem);
    }
Ejemplo n.º 5
0
 public void OnCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkbox, bool Checked)
 {
     if (sender != mainMenu || checkbox != ketchupCheckbox) return; // We only want to detect changes from our menu.
     UI.Notify("~r~Ketchup status: ~b~" + Checked);
 }
Ejemplo n.º 6
0
        private void OnCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkboxItem, bool Checked)
        {
            if(sender == generalMenu)
            {
                if(HUD.Checked == true)
                {
                    Function.Call(Hash.DISPLAY_HUD, 0);
                    Function.Call(Hash.DISPLAY_RADAR, 0);
                }
                else if(HUD.Checked == false)
                {
                    Function.Call(Hash.DISPLAY_HUD, 1);
                    Function.Call(Hash.DISPLAY_RADAR, 1);
                }
                if (nVision.Checked == true) Function.Call(Hash.SET_NIGHTVISION,true); else Function.Call(Hash.SET_NIGHTVISION, false);
            }
            else if(sender == playerMenu)
            {
                if(GM.Checked== true) Game.Player.Character.IsInvincible = true;
                else if(GM.Checked == false) Game.Player.Character.IsInvincible = false;
                if(UA.Checked == true)
                {
                    Game.Player.Character.Weapons.Current.AmmoInClip = Game.Player.Character.Weapons.Current.MaxAmmoInClip;
                    Game.Player.Character.Weapons.Current.Ammo = Game.Player.Character.Weapons.Current.MaxAmmo;
                    Game.Player.Character.Weapons.Current.InfiniteAmmo = true;
                    Game.Player.Character.Weapons.Current.InfiniteAmmoClip = true;
                }
                if (VisibleP.Checked == true) Game.Player.Character.IsVisible = false;
                else if (VisibleP.Checked == false) Game.Player.Character.IsVisible = true;
            }
            else if(sender == carMenu)
            {
                if (CGM.Checked == true)
                {
                    if (Game.Player.Character.IsSittingInVehicle())
                    {
                        Vehicle veh = Game.Player.Character.CurrentVehicle;
                        Function.Call(Hash.SET_ENTITY_INVINCIBLE, veh, true);
                        Function.Call(Hash.SET_ENTITY_PROOFS, veh, 1, 1, 1, 1, 1, 1, 1, 1);
                        veh.CanTiresBurst = false;
                        Function.Call(Hash.SET_VEHICLE_WHEELS_CAN_BREAK, veh, 0);
                        veh.CanBeVisiblyDamaged = false;
                    }
                    else if (!Game.Player.Character.IsSittingInVehicle())
                    {

                    }
                }
                else if (CGM.Checked == false)
                {
                    if (Game.Player.Character.IsSittingInVehicle())
                    {
                        Vehicle veh = Game.Player.Character.CurrentVehicle;
                        Function.Call(Hash.SET_ENTITY_INVINCIBLE, veh, false);
                        Function.Call(Hash.SET_ENTITY_PROOFS, veh, 0, 0, 0, 0, 0, 0, 0, 0);
                        veh.CanTiresBurst = true;
                        Function.Call(Hash.SET_VEHICLE_WHEELS_CAN_BREAK, veh, 1);
                        veh.CanBeVisiblyDamaged = true;
                    }
                    else if (!Game.Player.Character.IsSittingInVehicle())
                    {

                    }
                }
                if (VisibleC.Checked == true)
                {
                    if (Game.Player.Character.IsSittingInVehicle())
                    {
                        Game.Player.Character.CurrentVehicle.IsVisible = false;
                    }
                }
                else if(VisibleC.Checked == false)
                {
                    if (Game.Player.Character.IsSittingInVehicle())
                    {
                        Game.Player.Character.CurrentVehicle.IsVisible = true;
                    }
                }
            }
        }
Ejemplo n.º 7
0
        private void CreateMenu()
        {
            _mainMenu = new UIMenu("Tobii Eye Tracking", "~b~SETTINGS");
            _mainMenu.SetMenuWidthOffset(50);
            //_mainMenu.ControlDisablingEnabled = false;
            _menuPool.Add(_mainMenu);

            var values0To1 = new List<dynamic>();
            for (var i = 0; i <= 10; i++)
            {
                values0To1.Add(i * 0.1);
            }
            var valuesMinus1To1 = new List<dynamic>();
            for (var i = -10; i <= 10; i++)
            {
                valuesMinus1To1.Add(i * 0.1);
            }

            var values0To70 = new List<dynamic>();
            for (var i = 0; i <= 70; i++)
            {
                values0To70.Add((double)i);
            }

            var valuesMinus70To0 = new List<dynamic>();
            for (var i = -70; i <= 0; i++)
            {
                valuesMinus70To0.Add((double)i);
            }

            var freelookDevices = new List<dynamic>
            {
                "Gamepad",
                "Mouse"
            };

            _freelookDevice = new UIMenuListItem("Freelook device", freelookDevices, (int)_settings.FreelookDevice, "Device to use for freelook");
            _freelookDevice.OnListChanged += (sender, args) => { _settings.FreelookDevice = (FeeelookDevice)_freelookDevice.Index; };
            _mainMenu.AddItem(_freelookDevice);

            var thirdPersonFreelook = new UIMenuCheckboxItem("TPS Freelook", _settings.ThirdPersonFreelookEnabled, "Control camera with gaze");
            thirdPersonFreelook.CheckboxEvent += (sender, args) => { _settings.ThirdPersonFreelookEnabled = thirdPersonFreelook.Checked; };
            _mainMenu.AddItem(thirdPersonFreelook);

            var thirdPersonSensitivitySlider = new UIMenuListItem("TPS Freelook Sensitivity", values0To1, (int)Math.Round(_settings.ThirdPersonSensitivity / 0.1), "Freelook sensitivity");
            thirdPersonSensitivitySlider.OnListChanged += (sender, args) => { _settings.ThirdPersonSensitivity = thirdPersonSensitivitySlider.IndexToItem(thirdPersonSensitivitySlider.Index); };
            _mainMenu.AddItem(thirdPersonSensitivitySlider);

            {
                var thirdPersonYOffsetSlider = new UIMenuListItem("TPS Freelook Vertical Offset", valuesMinus1To1, (int)Math.Round((_settings.ThirdPersonYOffset + 1) / 0.1), "Freelook vertical offset");
                thirdPersonYOffsetSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffset = thirdPersonYOffsetSlider.IndexToItem(thirdPersonYOffsetSlider.Index); };
                _mainMenu.AddItem(thirdPersonYOffsetSlider);

                var thirdPersonDeadZoneWidthSlider = new UIMenuListItem("TPS Freelook Deadzone Width", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneWidth / 0.1), "Freelook deadzone");
                thirdPersonDeadZoneWidthSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidth = thirdPersonDeadZoneWidthSlider.IndexToItem(thirdPersonDeadZoneWidthSlider.Index); };
                _mainMenu.AddItem(thirdPersonDeadZoneWidthSlider);

                var thirdPersonDeadZoneHeightSlider = new UIMenuListItem("TPS Freelook Deadzone Height", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneHeight / 0.1), "Freelook deadzone");
                thirdPersonDeadZoneHeightSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeight = thirdPersonDeadZoneHeightSlider.IndexToItem(thirdPersonDeadZoneHeightSlider.Index); };
                _mainMenu.AddItem(thirdPersonDeadZoneHeightSlider);

                var thirdPersonMinPitchSlider = new UIMenuListItem("TPS Min Pitch", valuesMinus70To0, (int)Math.Round((_settings.ThirdPersonMinPitchDeg + 70) / 1), "Freelook min pitch angle");
                thirdPersonMinPitchSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchDeg = thirdPersonMinPitchSlider.IndexToItem(thirdPersonMinPitchSlider.Index); };
                _mainMenu.AddItem(thirdPersonMinPitchSlider);

                var thirdPersonMaxPitchSlider = new UIMenuListItem("TPS Max Pitch", values0To70, (int)Math.Round((_settings.ThirdPersonMaxPitchDeg) / 1), "Freelook max pitch angle");
                thirdPersonMaxPitchSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchDeg = thirdPersonMaxPitchSlider.IndexToItem(thirdPersonMaxPitchSlider.Index); };
                _mainMenu.AddItem(thirdPersonMaxPitchSlider);
            }

            {
                var thirdPersonYOffsetDrivingSlider = new UIMenuListItem("TPS Freelook Vertical Offset Driving", valuesMinus1To1, (int)Math.Round((_settings.ThirdPersonYOffsetDriving + 1) / 0.1), "Freelook vertical offset");
                thirdPersonYOffsetDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffsetDriving = thirdPersonYOffsetDrivingSlider.IndexToItem(thirdPersonYOffsetDrivingSlider.Index); };
                _mainMenu.AddItem(thirdPersonYOffsetDrivingSlider);

                var thirdPersonDeadZoneWidthDrivingSlider = new UIMenuListItem("TPS Freelook Deadzone Width Driving", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneWidthDriving / 0.1), "Freelook deadzone");
                thirdPersonDeadZoneWidthDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidthDriving = thirdPersonDeadZoneWidthDrivingSlider.IndexToItem(thirdPersonDeadZoneWidthDrivingSlider.Index); };
                _mainMenu.AddItem(thirdPersonDeadZoneWidthDrivingSlider);

                var thirdPersonDeadZoneHeightDrivingSlider = new UIMenuListItem("TPS Freelook Deadzone Height Driving", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneHeightDriving / 0.1), "Freelook deadzone");
                thirdPersonDeadZoneHeightDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeightDriving = thirdPersonDeadZoneHeightDrivingSlider.IndexToItem(thirdPersonDeadZoneHeightDrivingSlider.Index); };
                _mainMenu.AddItem(thirdPersonDeadZoneHeightDrivingSlider);

                var thirdPersonMinPitchDrivingSlider = new UIMenuListItem("TPS Min Pitch Driving", valuesMinus70To0, (int)Math.Round((_settings.ThirdPersonMinPitchDrivingDeg + 70) / 1), "Freelook min pitch angle");
                thirdPersonMinPitchDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchDrivingDeg = thirdPersonMinPitchDrivingSlider.IndexToItem(thirdPersonMinPitchDrivingSlider.Index); };
                _mainMenu.AddItem(thirdPersonMinPitchDrivingSlider);

                var thirdPersonMaxPitchDrivingSlider = new UIMenuListItem("TPS Max Pitch Driving", values0To70, (int)Math.Round((_settings.ThirdPersonMaxPitchDeg) / 1), "Freelook max pitch angle");
                thirdPersonMaxPitchDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchDrivingDeg = thirdPersonMaxPitchDrivingSlider.IndexToItem(thirdPersonMaxPitchDrivingSlider.Index); };
                _mainMenu.AddItem(thirdPersonMaxPitchDrivingSlider);
            }

            {
                var thirdPersonYOffsetPlaneSlider = new UIMenuListItem("TPS Freelook Vertical Offset Plane", valuesMinus1To1, (int)Math.Round((_settings.ThirdPersonYOffsetPlane + 1) / 0.1), "Freelook vertical offset");
                thirdPersonYOffsetPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffsetPlane = thirdPersonYOffsetPlaneSlider.IndexToItem(thirdPersonYOffsetPlaneSlider.Index); };
                _mainMenu.AddItem(thirdPersonYOffsetPlaneSlider);

                var thirdPersonDeadZoneWidthPlaneSlider = new UIMenuListItem("TPS Freelook Deadzone Width Plane", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneWidthPlane / 0.1), "Freelook deadzone");
                thirdPersonDeadZoneWidthPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidthPlane = thirdPersonDeadZoneWidthPlaneSlider.IndexToItem(thirdPersonDeadZoneWidthPlaneSlider.Index); };
                _mainMenu.AddItem(thirdPersonDeadZoneWidthPlaneSlider);

                var thirdPersonDeadZoneHeightPlaneSlider = new UIMenuListItem("TPS Freelook Deadzone Height Plane", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneHeightPlane / 0.1), "Freelook deadzone");
                thirdPersonDeadZoneHeightPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeightPlane = thirdPersonDeadZoneHeightPlaneSlider.IndexToItem(thirdPersonDeadZoneHeightPlaneSlider.Index); };
                _mainMenu.AddItem(thirdPersonDeadZoneHeightPlaneSlider);

                var thirdPersonMinPitchPlaneSlider = new UIMenuListItem("TPS Min Pitch Plane", valuesMinus70To0, (int)Math.Round((_settings.ThirdPersonMinPitchPlaneDeg + 70) / 1), "Freelook min pitch angle");
                thirdPersonMinPitchPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchPlaneDeg = thirdPersonMinPitchPlaneSlider.IndexToItem(thirdPersonMinPitchPlaneSlider.Index); };
                _mainMenu.AddItem(thirdPersonMinPitchPlaneSlider);

                var thirdPersonMaxPitchPlaneSlider = new UIMenuListItem("TPS Max Pitch Plane", values0To70, (int)Math.Round((_settings.ThirdPersonMaxPitchPlaneDeg) / 1), "Freelook max pitch angle");
                thirdPersonMaxPitchPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchPlaneDeg = thirdPersonMaxPitchPlaneSlider.IndexToItem(thirdPersonMaxPitchPlaneSlider.Index); };
                _mainMenu.AddItem(thirdPersonMaxPitchPlaneSlider);
            }

            {
                var thirdPersonYOffsetHeliSlider = new UIMenuListItem("TPS Freelook Vertical Offset Heli", valuesMinus1To1, (int)Math.Round((_settings.ThirdPersonYOffsetHeli + 1) / 0.1), "Freelook vertical offset");
                thirdPersonYOffsetHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffsetHeli = thirdPersonYOffsetHeliSlider.IndexToItem(thirdPersonYOffsetHeliSlider.Index); };
                _mainMenu.AddItem(thirdPersonYOffsetHeliSlider);

                var thirdPersonDeadZoneWidthHeliSlider = new UIMenuListItem("TPS Freelook Deadzone Width Heli", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneWidthHeli / 0.1), "Freelook deadzone");
                thirdPersonDeadZoneWidthHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidthHeli = thirdPersonDeadZoneWidthHeliSlider.IndexToItem(thirdPersonDeadZoneWidthHeliSlider.Index); };
                _mainMenu.AddItem(thirdPersonDeadZoneWidthHeliSlider);

                var thirdPersonDeadZoneHeightHeliSlider = new UIMenuListItem("TPS Freelook Deadzone Height Heli", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneHeightHeli / 0.1), "Freelook deadzone");
                thirdPersonDeadZoneHeightHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeightHeli = thirdPersonDeadZoneHeightHeliSlider.IndexToItem(thirdPersonDeadZoneHeightHeliSlider.Index); };
                _mainMenu.AddItem(thirdPersonDeadZoneHeightHeliSlider);

                var thirdPersonMinPitchHeliSlider = new UIMenuListItem("TPS Min Pitch Heli", valuesMinus70To0, (int)Math.Round((_settings.ThirdPersonMinPitchHeliDeg + 70) / 1), "Freelook min pitch angle");
                thirdPersonMinPitchHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchHeliDeg = thirdPersonMinPitchHeliSlider.IndexToItem(thirdPersonMinPitchHeliSlider.Index); };
                _mainMenu.AddItem(thirdPersonMinPitchHeliSlider);

                var thirdPersonMaxPitchHeliSlider = new UIMenuListItem("TPS Max Pitch Heli", values0To70, (int)Math.Round((_settings.ThirdPersonMaxPitchDeg) / 1), "Freelook max pitch angle");
                thirdPersonMaxPitchHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchHeliDeg = thirdPersonMaxPitchHeliSlider.IndexToItem(thirdPersonMaxPitchHeliSlider.Index); };
                _mainMenu.AddItem(thirdPersonMaxPitchHeliSlider);
            }

            var firstPersonFreelook = new UIMenuCheckboxItem("FPS Freelook", _settings.FirstPersonFreelookEnabled, "Control camera with gaze");
            firstPersonFreelook.CheckboxEvent += (sender, args) => { _settings.FirstPersonFreelookEnabled = firstPersonFreelook.Checked; };
            _mainMenu.AddItem(firstPersonFreelook);

            var firstPersonSensitivitySlider = new UIMenuListItem("FPS Freelook Sensitivity", values0To1, (int)Math.Round(_settings.FirstPersonSensitivity / 0.1), "Freelook sensitivity");
            firstPersonSensitivitySlider.OnListChanged += (sender, args) => { _settings.FirstPersonSensitivity = firstPersonSensitivitySlider.IndexToItem(firstPersonSensitivitySlider.Index); };
            _mainMenu.AddItem(firstPersonSensitivitySlider);

            {
                var firstPersonDeadZoneWidthSlider = new UIMenuListItem("FPS Freelook Deadzone Width", values0To1, (int)Math.Round(_settings.FirstPersonDeadZoneWidth / 0.1), "Freelook deadzone");
                firstPersonDeadZoneWidthSlider.OnListChanged += (sender, args) => { _settings.FirstPersonDeadZoneWidth = firstPersonDeadZoneWidthSlider.IndexToItem(firstPersonDeadZoneWidthSlider.Index); };
                _mainMenu.AddItem(firstPersonDeadZoneWidthSlider);

                var firstPersonDeadZoneHeightSlider = new UIMenuListItem("FPS Freelook Deadzone Height", values0To1, (int)Math.Round(_settings.FirstPersonDeadZoneHeight / 0.1), "Freelook deadzone");
                firstPersonDeadZoneHeightSlider.OnListChanged += (sender, args) => { _settings.FirstPersonDeadZoneHeight = firstPersonDeadZoneHeightSlider.IndexToItem(firstPersonDeadZoneHeightSlider.Index); };
                _mainMenu.AddItem(firstPersonDeadZoneHeightSlider);

                var firstPersonMinPitchSlider = new UIMenuListItem("FPS Min Pitch", valuesMinus70To0, (int)Math.Round((_settings.FirstPersonMinPitchDeg + 70) / 1), "Freelook min pitch angle");
                firstPersonMinPitchSlider.OnListChanged += (sender, args) => { _settings.FirstPersonMinPitchDeg = firstPersonMinPitchSlider.IndexToItem(firstPersonMinPitchSlider.Index); };
                _mainMenu.AddItem(firstPersonMinPitchSlider);

                var firstPersonMaxPitchSlider = new UIMenuListItem("FPS Max Pitch", values0To70, (int)Math.Round((_settings.FirstPersonMaxPitchDeg) / 1), "Freelook max pitch angle");
                firstPersonMaxPitchSlider.OnListChanged += (sender, args) => { _settings.FirstPersonMaxPitchDeg = firstPersonMaxPitchSlider.IndexToItem(firstPersonMaxPitchSlider.Index); };
                _mainMenu.AddItem(firstPersonMaxPitchSlider);
            }

            var aimingSensitivitySlider = new UIMenuListItem("Aiming Sensitivity", values0To1, (int)Math.Round(_settings.AimingSensitivity / 0.1), "Freelok sensitivity while aiming");
            aimingSensitivitySlider.OnListChanged += (sender, args) => { _settings.AimingSensitivity = aimingSensitivitySlider.IndexToItem(aimingSensitivitySlider.Index); };
            _mainMenu.AddItem(aimingSensitivitySlider);

            var aimWithGaze = new UIMenuCheckboxItem("Aim With Gaze", _settings.AimWithGazeEnabled, "Aim with gaze");
            aimWithGaze.CheckboxEvent += (sender, args) => { _settings.AimWithGazeEnabled = aimWithGaze.Checked; };
            _mainMenu.AddItem(aimWithGaze);

            var snapAtPedestrians = new UIMenuCheckboxItem("Snap At Pedestrians", _settings.SnapAtPedestriansEnabled, "Snap aim at pedestrians");
            snapAtPedestrians.CheckboxEvent += (sender, args) => { _settings.SnapAtPedestriansEnabled = snapAtPedestrians.Checked; };
            _mainMenu.AddItem(snapAtPedestrians);

            var gazeFilteringSlider = new UIMenuListItem("Gaze Filter", values0To1, (int)Math.Round(_settings.GazeFiltering / 0.1), "Filter gaze data");
            gazeFilteringSlider.OnListChanged += (sender, args) => { _settings.GazeFiltering = gazeFilteringSlider.IndexToItem(gazeFilteringSlider.Index); };
            _mainMenu.AddItem(gazeFilteringSlider);

            var incinerateAtGaze = new UIMenuCheckboxItem("Incinerate At Gaze", _settings.IncinerateAtGazeEnabled, "Incinerate at gaze");
            incinerateAtGaze.CheckboxEvent += (sender, args) => { _settings.IncinerateAtGazeEnabled = incinerateAtGaze.Checked; };
            _mainMenu.AddItem(incinerateAtGaze);

            var taseAtGaze = new UIMenuCheckboxItem("Tase At Gaze", _settings.TaseAtGazeEnabled, "Tase at gaze");
            taseAtGaze.CheckboxEvent += (sender, args) => { _settings.TaseAtGazeEnabled = taseAtGaze.Checked; };
            _mainMenu.AddItem(taseAtGaze);

            var missilesAtGaze = new UIMenuCheckboxItem("Launch Missiles At Gaze", _settings.MissilesAtGazeEnabled, "Launch missiles at gaze");
            missilesAtGaze.CheckboxEvent += (sender, args) => { _settings.MissilesAtGazeEnabled = missilesAtGaze.Checked; };
            _mainMenu.AddItem(missilesAtGaze);

            var pedestrianIntreraction = new UIMenuCheckboxItem("Pedestrian Interaction", _settings.PedestrianInteractionEnabled, "Pedestrians talk to you");
            pedestrianIntreraction.CheckboxEvent += (sender, args) => { _settings.PedestrianInteractionEnabled = pedestrianIntreraction.Checked; };
            _mainMenu.AddItem(pedestrianIntreraction);

            var dontFallFromBikes = new UIMenuCheckboxItem("Don't Fall From Bikes", _settings.DontFallFromBikesEnabled, "Never fall from bikes");
            dontFallFromBikes.CheckboxEvent += (sender, args) => { _settings.DontFallFromBikesEnabled = dontFallFromBikes.Checked; };
            _mainMenu.AddItem(dontFallFromBikes);

            var dedzns = new UIMenuItem("Deadzones");
            _mainMenu.AddItem(dedzns);

            _mainMenu.RefreshIndex();
            {
                DeadzoneMenu = new UIMenu("Tobii Eye Tracking", "~b~DEADZONES");
                DeadzoneMenu.SetMenuWidthOffset(50);
                _mainMenu.BindMenuToItem(DeadzoneMenu, dedzns);
                DeadzoneMenu.AddItem(new UIMenuItem("Add Deadzone", "Deadzones prevent camera movement when you are looking inside the zone, for example, the minimap."));
                DeadzoneMenu.RefreshIndex();
                _menuPool.Add(DeadzoneMenu);
            }
        }
Ejemplo n.º 8
0
		private void CreateMenu()
		{
			_mainMenu = new UIMenu("Tobii Eye Tracking", "~b~SETTINGS");
			_mainMenu.SetMenuWidthOffset(50);
			//_mainMenu.ControlDisablingEnabled = false;
			_menuPool.Add(_mainMenu);

		    InitLists();
            CreateThirdPersonFreelookMenu();
            CreateFirstPersonFreelookMenu();
            CreateDeadzoneMenu();
		    _freelookDevice = new UIMenuListItem("Freelook Device", _freelookDevices, (int)_settings.FreelookDevice, "Device to use for freelook");
			_freelookDevice.OnListChanged += (sender, args) => { _settings.FreelookDevice = (FeeelookDevice)_freelookDevice.Index; };
			_mainMenu.AddItem(_freelookDevice);

            var firstPersonFreelookSettings = new UIMenuItem("First Person Freelook Settings", "Look around with gaze in first person");
            _mainMenu.AddItem(firstPersonFreelookSettings);
            _mainMenu.BindMenuToItem(FirstPersonFreelookMenu, firstPersonFreelookSettings);

            var thirdPersonFreelookSettings = new UIMenuItem("Third Person Freelook Settings", "Look around with gaze in third person");
            _mainMenu.AddItem(thirdPersonFreelookSettings);
            _mainMenu.BindMenuToItem(ThirdPersonFreelookMenu, thirdPersonFreelookSettings);

            var deadzoneSettings = new UIMenuItem("Freelook Deadzones", "Deadzones prevent camera movement when you are looking inside the zone, for example, the minimap");
            _mainMenu.AddItem(deadzoneSettings);
            _mainMenu.BindMenuToItem(DeadzoneMenu, deadzoneSettings);

		    var aimingSensitivitySlider = new UIMenuListItem("Aiming Sensitivity", _values0To1, (int)Math.Round(_settings.AimingSensitivity / 0.1), "Freelok sensitivity while aiming");
			aimingSensitivitySlider.OnListChanged += (sender, args) => { _settings.AimingSensitivity = aimingSensitivitySlider.IndexToItem(aimingSensitivitySlider.Index); };
			_mainMenu.AddItem(aimingSensitivitySlider);

			var aimWithGaze = new UIMenuCheckboxItem("Aim With Gaze", _settings.AimWithGazeEnabled, "Aim with gaze");
			aimWithGaze.CheckboxEvent += (sender, args) => { _settings.AimWithGazeEnabled = aimWithGaze.Checked; };
			_mainMenu.AddItem(aimWithGaze);

			var snapAtPedestrians = new UIMenuCheckboxItem("Snap At Pedestrians", _settings.SnapAtPedestriansEnabled, "Snap aim at pedestrians");
			snapAtPedestrians.CheckboxEvent += (sender, args) => { _settings.SnapAtPedestriansEnabled = snapAtPedestrians.Checked; };
			_mainMenu.AddItem(snapAtPedestrians);

			var gazeFilteringSlider = new UIMenuListItem("Gaze Filter", _values0To1, (int)Math.Round(_settings.GazeFiltering / 0.1), "Filter gaze data");
			gazeFilteringSlider.OnListChanged += (sender, args) => { _settings.GazeFiltering = gazeFilteringSlider.IndexToItem(gazeFilteringSlider.Index); };
			_mainMenu.AddItem(gazeFilteringSlider);

			var incinerateAtGaze = new UIMenuCheckboxItem("Incinerate At Gaze", _settings.IncinerateAtGazeEnabled, "Incinerate at gaze");
			incinerateAtGaze.CheckboxEvent += (sender, args) => { _settings.IncinerateAtGazeEnabled = incinerateAtGaze.Checked; };
			_mainMenu.AddItem(incinerateAtGaze);

			var taseAtGaze = new UIMenuCheckboxItem("Tase At Gaze", _settings.TaseAtGazeEnabled, "Tase at gaze");
			taseAtGaze.CheckboxEvent += (sender, args) => { _settings.TaseAtGazeEnabled = taseAtGaze.Checked; };
			_mainMenu.AddItem(taseAtGaze);

			var missilesAtGaze = new UIMenuCheckboxItem("Launch Missiles At Gaze", _settings.MissilesAtGazeEnabled, "Launch missiles at gaze");
			missilesAtGaze.CheckboxEvent += (sender, args) => { _settings.MissilesAtGazeEnabled = missilesAtGaze.Checked; };
			_mainMenu.AddItem(missilesAtGaze);

			var pedestrianIntreraction = new UIMenuCheckboxItem("Pedestrian Interaction", _settings.PedestrianInteractionEnabled, "Pedestrians talk to you");
			pedestrianIntreraction.CheckboxEvent += (sender, args) => { _settings.PedestrianInteractionEnabled = pedestrianIntreraction.Checked; };
			_mainMenu.AddItem(pedestrianIntreraction);

			var dontFallFromBikes = new UIMenuCheckboxItem("Don't Fall From Bikes", _settings.DontFallFromBikesEnabled, "Never fall from bikes");
			dontFallFromBikes.CheckboxEvent += (sender, args) => { _settings.DontFallFromBikesEnabled = dontFallFromBikes.Checked; };
			_mainMenu.AddItem(dontFallFromBikes);

            var shutDown = new UIMenuItem("Shut Down", "Unload the mod");
		    shutDown.Activated += (sender, item) =>
		    {
		        ShutDownRequested(this, new EventArgs());
		    };
            
            _mainMenu.AddItem(shutDown);

			_mainMenu.RefreshIndex();
		}
Ejemplo n.º 9
0
	    private void CreateFirstPersonFreelookMenu()
	    {
            FirstPersonFreelookMenu = new UIMenu("Tobii Eye Tracking", "~b~FIRST PERSON FREELOOK SETTINGS");
            FirstPersonFreelookMenu.SetMenuWidthOffset(50);
	        {
	            var firstPersonFreelook = new UIMenuCheckboxItem("FPS Freelook", _settings.FirstPersonFreelookEnabled,
	                "Control camera with gaze");
	            firstPersonFreelook.CheckboxEvent +=
	                (sender, args) => { _settings.FirstPersonFreelookEnabled = firstPersonFreelook.Checked; };
                FirstPersonFreelookMenu.AddItem(firstPersonFreelook);

	            var firstPersonSensitivitySlider = new UIMenuListItem("FPS Freelook Sensitivity", _values0To1,
	                (int) Math.Round(_settings.FirstPersonSensitivity/0.1), "Freelook sensitivity");
	            firstPersonSensitivitySlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.FirstPersonSensitivity =
	                        firstPersonSensitivitySlider.IndexToItem(firstPersonSensitivitySlider.Index);
	                };
                FirstPersonFreelookMenu.AddItem(firstPersonSensitivitySlider);

	            var firstPersonDeadZoneWidthSlider = new UIMenuListItem("FPS Freelook Deadzone Width", _values0To1,
	                (int) Math.Round(_settings.FirstPersonDeadZoneWidth/0.1), "Freelook deadzone");
	            firstPersonDeadZoneWidthSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.FirstPersonDeadZoneWidth =
	                        firstPersonDeadZoneWidthSlider.IndexToItem(firstPersonDeadZoneWidthSlider.Index);
	                };
                FirstPersonFreelookMenu.AddItem(firstPersonDeadZoneWidthSlider);

	            var firstPersonDeadZoneHeightSlider = new UIMenuListItem("FPS Freelook Deadzone Height", _values0To1,
	                (int) Math.Round(_settings.FirstPersonDeadZoneHeight/0.1), "Freelook deadzone");
	            firstPersonDeadZoneHeightSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.FirstPersonDeadZoneHeight =
	                        firstPersonDeadZoneHeightSlider.IndexToItem(firstPersonDeadZoneHeightSlider.Index);
	                };
                FirstPersonFreelookMenu.AddItem(firstPersonDeadZoneHeightSlider);

	            var firstPersonMinPitchSlider = new UIMenuListItem("FPS Min Pitch", _valuesMinus70To0,
	                (int) Math.Round((_settings.FirstPersonMinPitchDeg + 70)/1), "Freelook min pitch angle");
	            firstPersonMinPitchSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.FirstPersonMinPitchDeg = firstPersonMinPitchSlider.IndexToItem(firstPersonMinPitchSlider.Index);
	                };
                FirstPersonFreelookMenu.AddItem(firstPersonMinPitchSlider);

	            var firstPersonMaxPitchSlider = new UIMenuListItem("FPS Max Pitch", _values0To70,
	                (int) Math.Round((_settings.FirstPersonMaxPitchDeg)/1), "Freelook max pitch angle");
	            firstPersonMaxPitchSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.FirstPersonMaxPitchDeg = firstPersonMaxPitchSlider.IndexToItem(firstPersonMaxPitchSlider.Index);
	                };
                FirstPersonFreelookMenu.AddItem(firstPersonMaxPitchSlider);
	        }

	        {
	            var firstPersonFreelookDriving = new UIMenuCheckboxItem("FPS Freelook Driving",
	                _settings.FirstPersonFreelookDrivingEnabled, "Control camera with gaze");
	            firstPersonFreelookDriving.CheckboxEvent +=
	                (sender, args) => { _settings.FirstPersonFreelookDrivingEnabled = firstPersonFreelookDriving.Checked; };
                FirstPersonFreelookMenu.AddItem(firstPersonFreelookDriving);

	            var firstPersonSensitivityDrivingSlider = new UIMenuListItem("FPS Freelook Sensitivity Driving", _values0To1,
	                (int) Math.Round(_settings.FirstPersonSensitivityDriving/0.1), "Freelook sensitivity");
	            firstPersonSensitivityDrivingSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.FirstPersonSensitivityDriving =
	                        firstPersonSensitivityDrivingSlider.IndexToItem(firstPersonSensitivityDrivingSlider.Index);
	                };
                FirstPersonFreelookMenu.AddItem(firstPersonSensitivityDrivingSlider);

	            var firstPersonDeadZoneWidthDrivingSlider = new UIMenuListItem("FPS Freelook Deadzone Width Driving",
	                _values0To1, (int) Math.Round(_settings.FirstPersonDeadZoneWidthDriving/0.1), "Freelook deadzone");
	            firstPersonDeadZoneWidthDrivingSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.FirstPersonDeadZoneWidthDriving =
	                        firstPersonDeadZoneWidthDrivingSlider.IndexToItem(firstPersonDeadZoneWidthDrivingSlider.Index);
	                };
                FirstPersonFreelookMenu.AddItem(firstPersonDeadZoneWidthDrivingSlider);

	            var firstPersonDeadZoneHeightDrivingSlider = new UIMenuListItem("FPS Freelook Deadzone Height Driving",
	                _values0To1, (int) Math.Round(_settings.FirstPersonDeadZoneHeightDriving/0.1), "Freelook deadzone");
	            firstPersonDeadZoneHeightDrivingSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.FirstPersonDeadZoneHeightDriving =
	                        firstPersonDeadZoneHeightDrivingSlider.IndexToItem(firstPersonDeadZoneHeightDrivingSlider.Index);
	                };
                FirstPersonFreelookMenu.AddItem(firstPersonDeadZoneHeightDrivingSlider);

	            var firstPersonMinPitchDrivingSlider = new UIMenuListItem("FPS Min Pitch Driving", _valuesMinus70To0,
	                (int) Math.Round((_settings.FirstPersonMinPitchDegDriving + 70)/1), "Freelook min pitch angle");
	            firstPersonMinPitchDrivingSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.FirstPersonMinPitchDegDriving =
	                        firstPersonMinPitchDrivingSlider.IndexToItem(firstPersonMinPitchDrivingSlider.Index);
	                };
                FirstPersonFreelookMenu.AddItem(firstPersonMinPitchDrivingSlider);

	            var firstPersonMaxPitchDrivingSlider = new UIMenuListItem("FPS Max Pitch Driving", _values0To70,
	                (int) Math.Round((_settings.FirstPersonMaxPitchDegDriving)/1), "Freelook max pitch angle");
	            firstPersonMaxPitchDrivingSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.FirstPersonMaxPitchDegDriving =
	                        firstPersonMaxPitchDrivingSlider.IndexToItem(firstPersonMaxPitchDrivingSlider.Index);
	                };
                FirstPersonFreelookMenu.AddItem(firstPersonMaxPitchDrivingSlider);
	        }
            FirstPersonFreelookMenu.RefreshIndex();
            _menuPool.Add(FirstPersonFreelookMenu);
	    }
Ejemplo n.º 10
0
        public MapEditor()
        {
            Tick += OnTick;
            KeyDown += OnKeyDown;

            if (!Directory.Exists("scripts\\MapEditor"))
                Directory.CreateDirectory("scripts\\MapEditor");

            ObjectDatabase.SetupRelationships();
            LoadSettings();

            try
            {
                Translation.Load("scripts\\MapEditor", _settings.Translation);
            }
            catch (Exception e)
            {
                UI.Notify("~b~~h~Map Editor~h~~w~~n~Failed to load translations. Falling back to English.");
                UI.Notify(e.Message);
            }

            _scaleform = new Scaleform(0);
            _scaleform.Load("instructional_buttons");

            _objectInfoMenu = new UIMenu("", "~b~" + Translation.Translate("PROPERTIES"), new Point(0, -107));
            _objectInfoMenu.ResetKey(UIMenu.MenuControls.Back);
            _objectInfoMenu.DisableInstructionalButtons(true);
            _objectInfoMenu.SetBannerType(new UIResRectangle(new Point(), new Size()));
            _menuPool.Add(_objectInfoMenu);

            ModManager.InitMenu();

            _objectsMenu = new UIMenu("Map Editor", "~b~" + Translation.Translate("PLACE OBJECT"));

            ObjectDatabase.LoadFromFile("scripts\\ObjectList.ini", ref ObjectDatabase.MainDb);
            ObjectDatabase.LoadInvalidHashes();
            ObjectDatabase.LoadFromFile("scripts\\PedList.ini", ref ObjectDatabase.PedDb);
            ObjectDatabase.LoadFromFile("scripts\\VehicleList.ini", ref ObjectDatabase.VehicleDb);

            _crosshairPath = Path.GetFullPath("scripts\\MapEditor\\crosshair.png");
            _crosshairBluePath = Path.GetFullPath("scripts\\MapEditor\\crosshair_blue.png");
            _crosshairYellowPath = Path.GetFullPath("scripts\\MapEditor\\crosshair_yellow.png");

            if (!File.Exists("scripts\\MapEditor\\crosshair.png"))
                _crosshairPath = Sprite.WriteFileFromResources(Assembly.GetExecutingAssembly(), "MapEditor.crosshair.png", "scripts\\MapEditor\\crosshair.png");
            if (!File.Exists("scripts\\MapEditor\\crosshair_blue.png"))
                _crosshairBluePath = Sprite.WriteFileFromResources(Assembly.GetExecutingAssembly(), "MapEditor.crosshair_blue.png", "scripts\\MapEditor\\crosshair_blue.png");
            if (!File.Exists("scripts\\MapEditor\\crosshair_yellow.png"))
                _crosshairYellowPath = Sprite.WriteFileFromResources(Assembly.GetExecutingAssembly(), "MapEditor.crosshair_yellow.png", "scripts\\MapEditor\\crosshair_yellow.png");

            RedrawObjectsMenu();
            _objectsMenu.OnItemSelect += OnObjectSelect;
            _objectsMenu.OnIndexChange += OnIndexChange;
            _menuPool.Add(_objectsMenu);

            _objectsMenu.ResetKey(UIMenu.MenuControls.Back);
            _objectsMenu.AddInstructionalButton(new InstructionalButton(Control.SelectWeapon, Translation.Translate("Change Axis")));
            _objectsMenu.AddInstructionalButton(new InstructionalButton(Control.MoveUpDown, Translation.Translate("Zoom")));
            _objectsMenu.AddInstructionalButton(new InstructionalButton(Control.Jump, Translation.Translate("Search")));

            _searchMenu = new UIMenu("Map Editor", "~b~" + Translation.Translate("PLACE OBJECT"));
            _searchMenu.OnItemSelect += OnObjectSelect;
            _searchMenu.OnIndexChange += OnIndexChange;
            _menuPool.Add(_searchMenu);

            _searchMenu.ResetKey(UIMenu.MenuControls.Back);
            _searchMenu.AddInstructionalButton(new InstructionalButton(Control.SelectWeapon, Translation.Translate("Change Axis")));
            _searchMenu.AddInstructionalButton(new InstructionalButton(Control.MoveUpDown, Translation.Translate("Zoom")));
            _searchMenu.AddInstructionalButton(new InstructionalButton(Control.Jump, Translation.Translate("Search")));

            _mainMenu = new UIMenu("Map Editor", "~b~" + Translation.Translate("MAIN MENU"));
            _mainMenu.AddItem(new UIMenuItem(Translation.Translate("Enter/Exit Map Editor")));
            _mainMenu.AddItem(new UIMenuItem(Translation.Translate("New Map"), Translation.Translate("Remove all current objects and start a new map.")));
            _mainMenu.AddItem(new UIMenuItem(Translation.Translate("Save Map"), Translation.Translate("Save all current objects to a file.")));
            _mainMenu.AddItem(new UIMenuItem(Translation.Translate("Load Map"), Translation.Translate("Load objects from a file and add them to the world.")));
            _mainMenu.RefreshIndex();
            _mainMenu.DisableInstructionalButtons(true);
            _menuPool.Add(_mainMenu);

            _formatMenu = new UIMenu("Map Editor", "~b~" + Translation.Translate("SELECT FORMAT"));
            _formatMenu.DisableInstructionalButtons(true);
            _formatMenu.ParentMenu = _mainMenu;
            RedrawFormatMenu();
            _menuPool.Add(_formatMenu);

            _metadataMenu = new UIMenu("Map Editor", "~b~" + Translation.Translate("SAVE MAP"));
            _metadataMenu.DisableInstructionalButtons(true);
            _metadataMenu.ParentMenu = _formatMenu;
            RedrawMetadataMenu();
            _menuPool.Add(_metadataMenu);

            _filepicker = new UIMenu("Map Editor", "~b~" + Translation.Translate("PICK FILE"));
            _filepicker.DisableInstructionalButtons(true);
            _filepicker.ParentMenu = _formatMenu;
            _menuPool.Add(_filepicker);

            _mainMenu.OnItemSelect += (m, it, i) =>
            {
                switch (i)
                {
                    case 0: // Enter/Exit Map Editor
                        IsInFreecam = !IsInFreecam;
                        Game.Player.Character.FreezePosition = IsInFreecam;
                        Game.Player.Character.IsVisible = !IsInFreecam;
                        World.RenderingCamera = null;
                        if (!IsInFreecam)
                        {
                            Game.Player.Character.Position -= new Vector3(0f, 0f, Game.Player.Character.HeightAboveGround - 1f);
                            return;
                        }
                        World.DestroyAllCameras();
                        _mainCamera = World.CreateCamera(GameplayCamera.Position, GameplayCamera.Rotation, 60f);
                        _objectPreviewCamera = World.CreateCamera(new Vector3(1200.016f, 3980.998f, 86.05062f), new Vector3(0f, 0f, 0f), 60f);
                        World.RenderingCamera = _mainCamera;
                        break;
                    case 1: // New Map
                        JavascriptHook.StopAllScripts();
                        PropStreamer.RemoveAll();
                        PropStreamer.Markers.Clear();
                        _currentObjectsMenu.Clear();
                        PropStreamer.Identifications.Clear();
                        PropStreamer.ActiveScenarios.Clear();
                        PropStreamer.ActiveRelationships.Clear();
                        PropStreamer.ActiveWeapons.Clear();
                        PropStreamer.Doors.Clear();
                        PropStreamer.CurrentMapMetadata = new MapMetadata();
                        ModManager.CurrentMod?.ModDisconnectInvoker();
                        ModManager.CurrentMod = null;
                        foreach (MapObject o in PropStreamer.RemovedObjects)
                        {
                            var t = World.CreateProp(o.Hash, o.Position, o.Rotation, true, false);
                            t.PositionNoOffset = o.Position;
                        }
                        PropStreamer.RemovedObjects.Clear();
                        _loadedEntities = 0;
                        _changesMade = 0;
                        _lastAutosave = DateTime.Now;
                        UI.Notify("~b~~h~Map Editor~h~~w~~n~" + Translation.Translate("Loaded new map."));
                        break;
                    case 2:
                        if (ModManager.CurrentMod != null)
                        {
                            string filename = Game.GetUserInput(255);
                            if (String.IsNullOrWhiteSpace(filename))
                            {
                                UI.Notify("~r~~h~Map Editor~h~~n~~w~" + Translation.Translate("The filename was empty."));
                                return;
                            }
                            Map tmpMap = new Map();
                            tmpMap.Objects.AddRange(PropStreamer.GetAllEntities());
                            tmpMap.RemoveFromWorld.AddRange(PropStreamer.RemovedObjects);
                            tmpMap.Markers.AddRange(PropStreamer.Markers);
                            UI.Notify("~b~~h~Map Editor~h~~n~~w~" + Translation.Translate("Map sent to external mod for saving."));
                            ModManager.CurrentMod.MapSavedInvoker(tmpMap, filename);
                            return;
                        }
                        _savingMap = true;
                        _mainMenu.Visible = false;
                        RedrawFormatMenu();
                        _formatMenu.Visible = true;
                        break;
                    case 3:
                        _savingMap = false;
                        _mainMenu.Visible = false;
                        RedrawFormatMenu();
                        _formatMenu.Visible = true;
                        break;
                }
            };

            _formatMenu.OnItemSelect += (m, item, indx) =>
            {
                if (_savingMap)
                {
                    string filename = "";
                    if (indx != 0)
                        filename = Game.GetUserInput(255);

                    switch (indx)
                    {
                        case 0: // XML
                            // TODO: Send to another menu
                            _formatMenu.Visible = false;
                            RedrawMetadataMenu();
                            _metadataMenu.Visible = true;
                            break;
                        case 1: // Objects.ini
                            if (!filename.EndsWith(".ini")) filename += ".ini";
                            SaveMap(filename, MapSerializer.Format.SimpleTrainer);
                            break;
                        case 2: // C#
                            if (!filename.EndsWith(".cs")) filename += ".cs";
                            SaveMap(filename, MapSerializer.Format.CSharpCode);
                            break;
                        case 3: // Raw
                            if (!filename.EndsWith(".txt")) filename += ".txt";
                            SaveMap(filename, MapSerializer.Format.Raw);
                            break;
                        case 4: // SpoonerLegacy
                            if (!filename.EndsWith(".SP00N")) filename += ".SP00N";
                            SaveMap(filename, MapSerializer.Format.SpoonerLegacy);
                            break;
                        case 5: // Menyoo
                            if (!filename.EndsWith(".xml")) filename += ".xml";
                            SaveMap(filename, MapSerializer.Format.Menyoo);
                            break;
                    }
                }
                else
                {
                    string filename = "";
                    if (indx != 4)
                        filename = Game.GetUserInput(255);

                    MapSerializer.Format tmpFor = MapSerializer.Format.NormalXml;
                    switch (indx)
                    {
                        case 0: // XML
                            tmpFor = MapSerializer.Format.NormalXml;
                            break;
                        case 1: // Objects.ini
                            tmpFor = MapSerializer.Format.SimpleTrainer;
                            break;
                        case 2: // Spooner
                            tmpFor = MapSerializer.Format.SpoonerLegacy;
                            break;
                        case 3: // Spooner
                            tmpFor = MapSerializer.Format.Menyoo;
                            break;
                        case 4: // File picker
                            _formatMenu.Visible = false;
                            RedrawFilepickerMenu();
                            _filepicker.Visible = true;
                            return;
                    }
                    LoadMap(filename, tmpFor);
                }
                _formatMenu.Visible = false;
            };

            _settingsMenu = new UIMenu("Map Editor", "~b~" + Translation.Translate("SETTINGS"));

            for (int i = -_possibleRange; i <= _possibleRange; i++)
            {
                _possiblePositions.Add(i * 0.01);
            }

            for (int i = -36000; i <= 36000; i++)
            {
                _possibleRoll.Add(i * 0.01);
            }

            var possibleLangauges = new List<string>
            {
                "Auto"
            };
            possibleLangauges.AddRange(Translation.Translations.Select(t => t.Language).ToList());

            var language = new UIMenuListItem(Translation.Translate("Language"),
                possibleLangauges.Select(t => (dynamic) t).ToList(), possibleLangauges.IndexOf(_settings.Translation));

            language.OnListChanged += (sender, index) =>
            {
                var newLanguage = sender.IndexToItem(index).ToString();
                Translation.SetLanguage(newLanguage);
                _settings.Translation = newLanguage;
                SaveSettings();
                if (newLanguage == "Auto")
                {
                    language.Description = "Use your game's language settings.";
                    return;
                }
                var descFile = Translation.Translations.FirstOrDefault(t => t.Language == newLanguage);
                if (descFile == null) return;
                language.Description = "~h~" + Translation.Translate("Translator") + ":~h~ " + descFile.Translator;
            };

            var checkem = new UIMenuListItem(Translation.Translate("Marker"), new List<dynamic>(Enum.GetNames(typeof(CrosshairType))), Enum.GetNames(typeof(CrosshairType)).ToList().FindIndex(x => x == _settings.CrosshairType.ToString()));
            checkem.OnListChanged += (i, indx) =>
            {
                CrosshairType outHash;
                Enum.TryParse(i.IndexToItem(indx).ToString(), out outHash);
                _settings.CrosshairType = outHash;
                SaveSettings();
            };

            List<dynamic> autosaveList = new List<dynamic> {Translation.Translate("Disable")};
            for (int i = 5; i <= 60; i += 5)
            {
                autosaveList.Add(i);
            }
            int aIndex = autosaveList.IndexOf(_settings.AutosaveInterval);
            if (aIndex == -1)
                aIndex = 0;

            var autosaveItem = new UIMenuListItem(Translation.Translate("Autosave Interval"), autosaveList, aIndex, Translation.Translate("Interval in minutes between automatic autosaves."));
            autosaveItem.OnListChanged += (item, index) =>
            {
                var sel = item.IndexToItem(index);
                _settings.AutosaveInterval = (sel as string) == Translation.Translate("Disable") ? -1 : Convert.ToInt32(item.IndexToItem(index), CultureInfo.InvariantCulture);
                SaveSettings();
            };

            List<dynamic> possibleDrawDistances = new List<dynamic> {Translation.Translate("Default"), 50, 75};
            for (int i = 100; i <= 3000; i += 100)
            {
                possibleDrawDistances.Add(i);
            }
            int dIndex = possibleDrawDistances.IndexOf(_settings.DrawDistance);
            if (dIndex == -1)
                dIndex = 0;
            var drawDistanceItem = new UIMenuListItem(Translation.Translate("Draw Distance"), possibleDrawDistances, dIndex, Translation.Translate("Draw distance for props, vehicles and peds. Reload the map for changes to take effect."));
            drawDistanceItem.OnListChanged += (item, index) =>
            {
                var sel = item.IndexToItem(index);
                _settings.DrawDistance = (sel as string) == Translation.Translate("Default") ? -1 : Convert.ToInt32(item.IndexToItem(index), CultureInfo.InvariantCulture);
                SaveSettings();
            };

            List<dynamic> senslist = new List<dynamic>();
            for (int i = 1; i < 60; i++)
            {
                senslist.Add(i);
            }
            var gamboy = new UIMenuListItem(Translation.Translate("Mouse Camera Sensitivity"), senslist, _settings.CameraSensivity - 1);
            gamboy.OnListChanged += (item, index) =>
            {
                _settings.CameraSensivity = index + 1;
                SaveSettings();
            };
            var gampadSens = new UIMenuListItem(Translation.Translate("Gamepad Camera Sensitivity"), senslist, _settings.GamepadCameraSensitivity - 1);
            gampadSens.OnListChanged += (item, index) =>
            {
                _settings.GamepadCameraSensitivity = index + 1;
                SaveSettings();
            };

            var keymovesens = new UIMenuListItem(Translation.Translate("Keyboard Movement Sensitivity"), senslist, _settings.KeyboardMovementSensitivity - 1);
            keymovesens.OnListChanged += (item, index) =>
            {
                _settings.KeyboardMovementSensitivity = index + 1;
                SaveSettings();
            };

            var gammovesens = new UIMenuListItem(Translation.Translate("Gamepad Movement Sensitivity"), senslist, _settings.GamepadMovementSensitivity - 1);
            gammovesens.OnListChanged += (item, index) =>
            {
                _settings.GamepadMovementSensitivity = index + 1;
                SaveSettings();
            };

            var butts = new UIMenuCheckboxItem(Translation.Translate("Instructional Buttons"), _settings.InstructionalButtons);
            butts.CheckboxEvent += (i, checkd) =>
            {
                _settings.InstructionalButtons = checkd;
                SaveSettings();
            };
            var gamepadItem = new UIMenuCheckboxItem(Translation.Translate("Enable Gamepad Shortcut"), _settings.Gamepad);
            gamepadItem.CheckboxEvent += (i, checkd) =>
            {
                _settings.Gamepad = checkd;
                SaveSettings();
            };

            var counterItem = new UIMenuCheckboxItem(Translation.Translate("Entity Counter"), _settings.PropCounterDisplay);
            counterItem.CheckboxEvent += (i, checkd) =>
            {
                _settings.PropCounterDisplay = checkd;
                SaveSettings();
            };

            var snapper = new UIMenuCheckboxItem(Translation.Translate("Follow Object With Camera"), _settings.SnapCameraToSelectedObject);
            snapper.CheckboxEvent += (i, checkd) =>
            {
                _settings.SnapCameraToSelectedObject = checkd;
                SaveSettings();
            };

            var boundItem = new UIMenuCheckboxItem(Translation.Translate("Bounding Box"), _settings.BoundingBox.GetValueOrDefault(false));
            boundItem.CheckboxEvent += (i, checkd) =>
            {
                _settings.BoundingBox = checkd;
                SaveSettings();
            };

            var scriptItem = new UIMenuCheckboxItem(Translation.Translate("Execute Scripts"), _settings.LoadScripts);
            scriptItem.CheckboxEvent += (i, checkd) =>
            {
                _settings.LoadScripts = checkd;
                SaveSettings();
            };

            var validate = new UIMenuItem(Translation.Translate("Validate Object Database"),Translation.Translate(
                "This will update the current object database, removing any invalid objects. The changes will take effect after you restart the script." +
                " It will take a couple of minutes."));
            validate.Activated += (men, item) => ValidateDatabase();

            var resetGrps = new UIMenuItem(Translation.Translate("Reset Active Relationship Groups"),
                Translation.Translate("This will set all ped's relationship groups to Companion."));
            resetGrps.Activated += (men, item) =>
            {
                PropStreamer.Peds.ForEach(ped => ObjectDatabase.SetPedRelationshipGroup(new Ped(ped), "Companion"));
            };

            var objectValidationItem = new UIMenuCheckboxItem(Translation.Translate("Skip Invalid Objects"), _settings.OmitInvalidObjects);
            objectValidationItem.CheckboxEvent += (i, checkd) =>
            {
                _settings.OmitInvalidObjects = checkd;
                SaveSettings();
            };

            #if DEBUG

            var testItem = new UIMenuItem("Load Terrain");
            testItem.Activated += (sender, item) =>
            {
                if (!Game.IsWaypointActive)
                {
                    Function.Call(Hash.CLEAR_HD_AREA);
                    return;
                }
                var wpyPos = World.GetWaypointPosition();

                Function.Call(Hash.SET_HD_AREA, wpyPos.X, wpyPos.Y, wpyPos.Z, 400f);
            };
            _settingsMenu.AddItem(testItem);

            #endif

            _settingsMenu.AddItem(language);
            _settingsMenu.AddItem(gamepadItem);
            _settingsMenu.AddItem(drawDistanceItem);
            _settingsMenu.AddItem(autosaveItem);
            _settingsMenu.AddItem(checkem);
            _settingsMenu.AddItem(boundItem);
            _settingsMenu.AddItem(gamboy);
            _settingsMenu.AddItem(gampadSens);
            _settingsMenu.AddItem(keymovesens);
            _settingsMenu.AddItem(gammovesens);
            _settingsMenu.AddItem(butts);
            _settingsMenu.AddItem(counterItem);
            _settingsMenu.AddItem(snapper);
            _settingsMenu.AddItem(scriptItem);
            _settingsMenu.AddItem(objectValidationItem);
            _settingsMenu.AddItem(validate);
            _settingsMenu.AddItem(resetGrps);
            _settingsMenu.RefreshIndex();
            _settingsMenu.DisableInstructionalButtons(true);
            _menuPool.Add(_settingsMenu);

            _currentObjectsMenu = new UIMenu("Map Editor", "~b~" + Translation.Translate("CURRENT ENTITES"));
            _currentObjectsMenu.OnItemSelect += OnEntityTeleport;
            _currentObjectsMenu.DisableInstructionalButtons(true);
            _menuPool.Add(_currentObjectsMenu);

            var binder = new UIMenuItem(Translation.Translate("Settings"));
            _currentEntitiesItem = new UIMenuItem(Translation.Translate("Current Entities"));

            var binder2 = new UIMenuItem(Translation.Translate("Create Map for External Mod"));

            _mainMenu.AddItem(_currentEntitiesItem);
            _mainMenu.AddItem(binder);
            _mainMenu.AddItem(binder2);

            _mainMenu.BindMenuToItem(_settingsMenu, binder);
            _mainMenu.BindMenuToItem(_currentObjectsMenu, _currentEntitiesItem);
            _mainMenu.BindMenuToItem(ModManager.ModMenu, binder2);
            _mainMenu.RefreshIndex();
            _menuPool.Add(ModManager.ModMenu);
        }
Ejemplo n.º 11
0
        private void RedrawObjectInfoMenu(Marker ent, bool refreshIndex)
        {
            if (ent == null) return;
            string name = ent.Type.ToString() + " #" + ent.Id;

            _objectInfoMenu.Subtitle.Caption = "~b~" + name;
            _objectInfoMenu.Clear();

            List<dynamic> possbileScale = new List<dynamic>();
            for (int i = 0; i <= 1000; i++)
            {
                possbileScale.Add(i * 0.01);
            }

            List<dynamic> possibleColors = new List<dynamic>();
            for (int i = 0; i <= 255; i++)
            {
                possibleColors.Add(i);
            }

            var posXitem = new UIMenuListItem(Translation.Translate("Position X"), _possiblePositions, (int)(Math.Round((ent.Position.X * 100) + _possibleRange)));
            var posYitem = new UIMenuListItem(Translation.Translate("Position Y"), _possiblePositions, (int)(Math.Round((ent.Position.Y * 100) + _possibleRange)));
            var posZitem = new UIMenuListItem(Translation.Translate("Position Z"), _possiblePositions, (int)(Math.Round((ent.Position.Z * 100) + _possibleRange)));

            var rotXitem = new UIMenuListItem(Translation.Translate("Rotation X"), _possiblePositions, (int)(Math.Round((ent.Rotation.X * 100) + _possibleRange)));
            var rotYitem = new UIMenuListItem(Translation.Translate("Rotation Y"), _possiblePositions, (int)(Math.Round((ent.Rotation.Y * 100) + _possibleRange)));
            var rotZitem = new UIMenuListItem(Translation.Translate("Rotation Z"), _possiblePositions, (int)(Math.Round((ent.Rotation.Z * 100) + _possibleRange)));

            var dynamic = new UIMenuCheckboxItem(Translation.Translate("Bop Up And Down"), ent.BobUpAndDown);
            dynamic.CheckboxEvent += (ite, checkd) =>
            {
                ent.BobUpAndDown = checkd;
            };

            var faceCam = new UIMenuCheckboxItem(Translation.Translate("Face Camera"), ent.RotateToCamera);
            dynamic.CheckboxEvent += (ite, checkd) =>
            {
                ent.RotateToCamera = checkd;
            };

            var type = new UIMenuListItem(Translation.Translate("Type"), new List<dynamic>(_markersTypes), _markersTypes.ToList().IndexOf(ent.Type.ToString()));
            type.OnListChanged += (ite, index) =>
            {
                MarkerType hash;
                Enum.TryParse(ite.IndexToItem(index), out hash);
                ent.Type = hash;
            };

            var scaleXitem = new UIMenuListItem(Translation.Translate("Scale X"), possbileScale, (int)(Math.Round((ent.Scale.X * 100))));
            var scaleYitem = new UIMenuListItem(Translation.Translate("Scale Y"), possbileScale, (int)(Math.Round((ent.Scale.Y * 100))));
            var scaleZitem = new UIMenuListItem(Translation.Translate("Scale Z"), possbileScale, (int)(Math.Round((ent.Scale.Z * 100))));

            var colorR = new UIMenuListItem(Translation.Translate("Red Color"), possibleColors, ent.Red);
            var colorG = new UIMenuListItem(Translation.Translate("Green Color"), possibleColors, ent.Green);
            var colorB = new UIMenuListItem(Translation.Translate("Blue Color"), possibleColors, ent.Blue);
            var colorA = new UIMenuListItem(Translation.Translate("Transparency"), possibleColors, ent.Alpha);

            var targetId = 0;

            if (ent.TeleportTarget.HasValue)
            {
                var ourMarkers =
                    PropStreamer.Markers.Where(m => (m.Position - ent.TeleportTarget.Value).Length() < 1f)
                        .OrderBy(m => (m.Position - ent.TeleportTarget.Value).Length());
                if (ourMarkers.Any())
                    targetId = ourMarkers.First().Id + 1;
            }

            var targetPos = new UIMenuListItem(Translation.Translate("Teleport Marker Target"),
                Enumerable.Range(-1, _markerCounter + 1).Select(n => (dynamic) n).ToList(), targetId);
            targetPos.OnListChanged += (sender, index) =>
            {
                if (index == 0)
                {
                    ent.TeleportTarget = null;
                    return;
                }

                ent.TeleportTarget = PropStreamer.Markers.FirstOrDefault(n => n.Id == index-1)?.Position;
            };

            var loadPointItem = new UIMenuCheckboxItem(Translation.Translate("Mark as Loading Point"),
                PropStreamer.CurrentMapMetadata.LoadingPoint.HasValue &&
                (PropStreamer.CurrentMapMetadata.LoadingPoint.Value - ent.Position).Length() < 1f, Translation.Translate("Player will be teleported here BEFORE starting to load the map."));
            loadPointItem.CheckboxEvent += (sender, @checked) =>
            {
                if (@checked)
                {
                    PropStreamer.CurrentMapMetadata.LoadingPoint = ent.Position;
                }
                else
                {
                    PropStreamer.CurrentMapMetadata.LoadingPoint = null;
                }
            };

            var loadTeleportItem = new UIMenuCheckboxItem(Translation.Translate("Mark as Starting Point"),
                PropStreamer.CurrentMapMetadata.TeleportPoint.HasValue &&
                (PropStreamer.CurrentMapMetadata.TeleportPoint.Value - ent.Position).Length() < 1f, Translation.Translate("Player will be teleported here AFTER starting to load the map."));
            loadTeleportItem.CheckboxEvent += (sender, @checked) =>
            {
                if (@checked)
                {
                    PropStreamer.CurrentMapMetadata.TeleportPoint = ent.Position;
                }
                else
                {
                    PropStreamer.CurrentMapMetadata.TeleportPoint = null;
                }
            };

            var visiblityItem = new UIMenuCheckboxItem(Translation.Translate("Only Visible In Editor"), ent.OnlyVisibleInEditor);
            visiblityItem.CheckboxEvent += (sender, @checked) =>
            {
                ent.OnlyVisibleInEditor = @checked;
            };

            _objectInfoMenu.AddItem(type);
            _objectInfoMenu.AddItem(posXitem);
            _objectInfoMenu.AddItem(posYitem);
            _objectInfoMenu.AddItem(posZitem);
            _objectInfoMenu.AddItem(rotXitem);
            _objectInfoMenu.AddItem(rotYitem);
            _objectInfoMenu.AddItem(rotZitem);
            _objectInfoMenu.AddItem(scaleXitem);
            _objectInfoMenu.AddItem(scaleYitem);
            _objectInfoMenu.AddItem(scaleZitem);
            _objectInfoMenu.AddItem(colorR);
            _objectInfoMenu.AddItem(colorG);
            _objectInfoMenu.AddItem(colorB);
            _objectInfoMenu.AddItem(colorA);
            _objectInfoMenu.AddItem(dynamic);
            _objectInfoMenu.AddItem(faceCam);
            _objectInfoMenu.AddItem(targetPos);
            _objectInfoMenu.AddItem(loadPointItem);
            _objectInfoMenu.AddItem(loadTeleportItem);
            _objectInfoMenu.AddItem(visiblityItem);

            posXitem.OnListChanged += (item, index) => ent.Position = new Vector3((float)item.IndexToItem(index), ent.Position.Y, ent.Position.Z);
            posYitem.OnListChanged += (item, index) => ent.Position = new Vector3(ent.Position.X, (float)item.IndexToItem(index), ent.Position.Z);
            posZitem.OnListChanged += (item, index) => ent.Position = new Vector3(ent.Position.X, ent.Position.Y, (float)item.IndexToItem(index));

            posXitem.Activated +=
                (sender, item) =>
                    SetMarkerVector(ent, GetSafeFloat(Game.GetUserInput(ent.Position.X.ToString(CultureInfo.InvariantCulture), 10), ent.Position.X), ent.Position.Y, ent.Position.Z);
            posYitem.Activated +=
                (sender, item) =>
                    SetMarkerVector(ent, ent.Position.X, GetSafeFloat(Game.GetUserInput(ent.Position.Y.ToString(CultureInfo.InvariantCulture), 10), ent.Position.Y), ent.Position.Z);
            posZitem.Activated +=
                (sender, item) =>
                    SetMarkerVector(ent, ent.Position.X, ent.Position.Y, GetSafeFloat(Game.GetUserInput(ent.Position.Z.ToString(CultureInfo.InvariantCulture), 10), ent.Position.Z));

            rotXitem.OnListChanged += (item, index) => ent.Rotation = new Vector3((float)item.IndexToItem(index), ent.Rotation.Y, ent.Rotation.Z);
            rotYitem.OnListChanged += (item, index) => ent.Rotation = new Vector3(ent.Rotation.X, (float)item.IndexToItem(index), ent.Rotation.Z);
            rotZitem.OnListChanged += (item, index) => ent.Rotation = new Vector3(ent.Rotation.X, ent.Rotation.Y, (float)item.IndexToItem(index));

            rotXitem.Activated +=
                (sender, item) =>
                    SetMarkerRotation(ent, GetSafeFloat(Game.GetUserInput(ent.Rotation.X.ToString(CultureInfo.InvariantCulture), 10), ent.Rotation.X), ent.Rotation.Y, ent.Rotation.Z);
            rotYitem.Activated +=
                (sender, item) =>
                    SetMarkerRotation(ent, ent.Rotation.X, GetSafeFloat(Game.GetUserInput(ent.Rotation.Y.ToString(CultureInfo.InvariantCulture), 10), ent.Rotation.Y), ent.Rotation.Z);
            rotZitem.Activated +=
                (sender, item) =>
                    SetMarkerRotation(ent, ent.Rotation.X, ent.Rotation.Y, GetSafeFloat(Game.GetUserInput(ent.Rotation.Z.ToString(CultureInfo.InvariantCulture), 10), ent.Rotation.Z));

            scaleXitem.OnListChanged += (item, index) => ent.Scale = new Vector3((float)item.IndexToItem(index), ent.Scale.Y, ent.Scale.Z);
            scaleYitem.OnListChanged += (item, index) => ent.Scale = new Vector3(ent.Scale.X, (float)item.IndexToItem(index), ent.Scale.Z);
            scaleZitem.OnListChanged += (item, index) => ent.Scale = new Vector3(ent.Scale.X, ent.Scale.Y, (float)item.IndexToItem(index));

            scaleXitem.Activated +=
                (sender, item) =>
                    SetMarkerScale(ent, GetSafeFloat(Game.GetUserInput(ent.Scale.X.ToString(CultureInfo.InvariantCulture), 10), ent.Scale.X), ent.Scale.Y, ent.Scale.Z);
            scaleYitem.Activated +=
                (sender, item) =>
                    SetMarkerScale(ent, ent.Scale.X, GetSafeFloat(Game.GetUserInput(ent.Scale.Y.ToString(CultureInfo.InvariantCulture), 10), ent.Scale.Y), ent.Scale.Z);
            scaleZitem.Activated +=
                (sender, item) =>
                    SetMarkerScale(ent, ent.Scale.X, ent.Scale.Y, GetSafeFloat(Game.GetUserInput(ent.Scale.Z.ToString(CultureInfo.InvariantCulture), 10), ent.Scale.Z));

            colorR.OnListChanged += (item, index) => ent.Red = index;
            colorG.OnListChanged += (item, index) => ent.Green = index;
            colorB.OnListChanged += (item, index) => ent.Blue = index;
            colorA.OnListChanged += (item, index) => ent.Alpha = index;

            if (refreshIndex)
                _objectInfoMenu.RefreshIndex();
        }
Ejemplo n.º 12
0
        private void RedrawObjectInfoMenu(Entity ent, bool refreshIndex)
        {
            if(ent == null) return;
            string name = "";

            if (Function.Call<bool>(Hash.IS_ENTITY_AN_OBJECT, ent.Handle))
            {
                name = ObjectDatabase.MainDb.ContainsValue(ent.Model.Hash) ? ObjectDatabase.MainDb.First(x => x.Value == ent.Model.Hash).Key.ToUpper() : "Unknown Prop";
            }
            if (Function.Call<bool>(Hash.IS_ENTITY_A_VEHICLE, ent.Handle))
                name = ObjectDatabase.VehicleDb.ContainsValue(ent.Model.Hash) ? ObjectDatabase.VehicleDb.First(x => x.Value == ent.Model.Hash).Key.ToUpper() : "Unknown Vehicle";
            if (Function.Call<bool>(Hash.IS_ENTITY_A_PED, ent.Handle))
                name = ObjectDatabase.PedDb.ContainsValue(ent.Model.Hash) ? ObjectDatabase.PedDb.First(x => x.Value == ent.Model.Hash).Key.ToUpper() : "Unknown Ped";

            _objectInfoMenu.Subtitle.Caption = "~b~" + name;
            _objectInfoMenu.Clear();

            var posXitem = new UIMenuListItem(Translation.Translate("Position X"), _possiblePositions, (int)(Math.Round((ent.Position.X * 100) + _possibleRange)));
            var posYitem = new UIMenuListItem(Translation.Translate("Position Y"), _possiblePositions, (int)(Math.Round((ent.Position.Y * 100) + _possibleRange)));
            var posZitem = new UIMenuListItem(Translation.Translate("Position Z"), _possiblePositions, (int)(Math.Round((ent.Position.Z * 100) + _possibleRange)));

            var itemRot = ent.Quaternion.ToEuler();

            var rotXitem = new UIMenuListItem(Translation.Translate("Pitch"), _possibleRoll, (int)Math.Round((itemRot.Y * 100 * -1) + 36000));
            var rotYitem = new UIMenuListItem(Translation.Translate("Roll"), _possibleRoll, (int)Math.Round((itemRot.X * 100) + 36000));
            var rotZitem = new UIMenuListItem(Translation.Translate("Yaw"), _possibleRoll, (int)Math.Round((itemRot.Z * 100) + 36000));

            var dynamic = new UIMenuCheckboxItem(Translation.Translate("Dynamic"), !PropStreamer.StaticProps.Contains(ent.Handle));
            dynamic.CheckboxEvent += (ite, checkd) =>
            {
                if (checkd && PropStreamer.StaticProps.Contains(ent.Handle)) { PropStreamer.StaticProps.Remove(ent.Handle);}
                else if (!checkd && !PropStreamer.StaticProps.Contains(ent.Handle)) PropStreamer.StaticProps.Add(ent.Handle);

                ent.FreezePosition = PropStreamer.StaticProps.Contains(ent.Handle);
            };

            var ident = new UIMenuItem("Identification", "Optional identification for easier access during scripting.");
            if (PropStreamer.Identifications.ContainsKey(ent.Handle))
                ident.SetRightLabel(PropStreamer.Identifications[ent.Handle]);

            ident.Activated += (sender, item) =>
            {
                if (PropStreamer.Identifications.ContainsKey(ent.Handle))
                {
                    var newLabel = Game.GetUserInput(PropStreamer.Identifications[ent.Handle], 20);
                    if (PropStreamer.Identifications.ContainsValue(newLabel))
                    {
                        UI.Notify(Translation.Translate("~r~~h~Map Editor~h~~w~~n~The identification must be unique!"));
                        return;
                    }

                    if (newLabel.Length > 0 && (Regex.IsMatch(newLabel, @"^\d") || newLabel.StartsWith(".") || newLabel.StartsWith(",") || newLabel.StartsWith("\\")))
                    {
                        UI.Notify(Translation.Translate("~r~~h~Map Editor~h~~w~~n~This identification is invalid!"));
                        return;
                    }

                    PropStreamer.Identifications[ent.Handle] = newLabel;
                    ident.SetRightLabel(newLabel);
                }
                else
                {
                    var newLabel = Game.GetUserInput(20);
                    if (PropStreamer.Identifications.ContainsValue(newLabel))
                    {
                        UI.Notify(Translation.Translate("~r~~h~Map Editor~h~~w~~n~The identification must be unique!"));
                        return;
                    }
                    if (newLabel.Length > 0 && (Regex.IsMatch(newLabel, @"^\d") || newLabel.StartsWith(".") || newLabel.StartsWith(",") || newLabel.StartsWith("\\")))
                    {
                        UI.Notify(Translation.Translate("~r~~h~Map Editor~h~~w~~n~This identification is invalid!"));
                        return;
                    }
                    PropStreamer.Identifications.Add(ent.Handle, newLabel);
                    ident.SetRightLabel(newLabel);
                }
            };

            _objectInfoMenu.AddItem(posXitem);
            _objectInfoMenu.AddItem(posYitem);
            _objectInfoMenu.AddItem(posZitem);
            _objectInfoMenu.AddItem(rotXitem);
            _objectInfoMenu.AddItem(rotYitem);
            _objectInfoMenu.AddItem(rotZitem);
            _objectInfoMenu.AddItem(dynamic);
            _objectInfoMenu.AddItem(ident);

            if (Function.Call<bool>(Hash.IS_ENTITY_AN_OBJECT, ent.Handle))
            {
                var doorItem = new UIMenuCheckboxItem("Door", PropStreamer.Doors.Contains(ent.Handle), Translation.Translate("This option overrides the \"Dynamic\" setting."));
                doorItem.CheckboxEvent += (sender, @checked) =>
                {
                    if (@checked)
                    {
                        PropStreamer.Doors.Add(ent.Handle);
                        Function.Call(Hash.SET_ENTITY_DYNAMIC, ent.Handle, false);
                        ent.FreezePosition = false;
                    }
                    else
                    {
                        PropStreamer.Doors.Remove(ent.Handle);
                        var isDynamic = !PropStreamer.StaticProps.Contains(ent.Handle);
                        Function.Call(Hash.SET_ENTITY_DYNAMIC, ent.Handle, isDynamic);
                        ent.FreezePosition = !isDynamic;
                    }
                };
                _objectInfoMenu.AddItem(doorItem);
            }

            if (Function.Call<bool>(Hash.IS_ENTITY_A_PED, ent.Handle))
            {
                List<dynamic> actions = new List<dynamic> {"None", "Any - Walk", "Any - Warp", "Wander"};
                actions.AddRange(ObjectDatabase.ScrenarioDatabase.Keys);
                var scenarioItem = new UIMenuListItem(Translation.Translate("Idle Action"), actions, actions.IndexOf(PropStreamer.ActiveScenarios[ent.Handle]));
                scenarioItem.OnListChanged += (item, index) =>
                {
                    PropStreamer.ActiveScenarios[ent.Handle] = item.IndexToItem(index).ToString();
                    _changesMade++;
                };
                scenarioItem.Activated += (item, index) =>
                {
                    if (PropStreamer.ActiveScenarios[ent.Handle] == "None")
                    {
                        ((Ped)ent).Task.ClearAll();
                        return;
                    }
                    if (PropStreamer.ActiveScenarios[ent.Handle] == "Any - Walk" || PropStreamer.ActiveScenarios[ent.Handle] == "Any")
                    {
                        Function.Call(Hash.TASK_USE_NEAREST_SCENARIO_TO_COORD, ent.Handle, ent.Position.X, ent.Position.Y, ent.Position.Z, 100f, -1);
                        return;
                    }
                    if (PropStreamer.ActiveScenarios[ent.Handle] == "Any - Warp")
                    {
                        Function.Call(Hash.TASK_USE_NEAREST_SCENARIO_TO_COORD_WARP, ent.Handle, ent.Position.X, ent.Position.Y, ent.Position.Z, 100f, -1);
                        return;
                    }
                    if (PropStreamer.ActiveScenarios[ent.Handle] == "Wander")
                    {
                        Function.Call(Hash.TASK_WANDER_STANDARD, ent.Handle, 0, 0);
                        return;
                    }
                    string scenario = ObjectDatabase.ScrenarioDatabase[PropStreamer.ActiveScenarios[ent.Handle]];
                    if (Function.Call<bool>(Hash.IS_PED_USING_SCENARIO, ent.Handle, scenario))
                        ((Ped) ent).Task.ClearAll();
                    else
                    {
                        Function.Call(Hash.TASK_START_SCENARIO_IN_PLACE, ent.Handle, scenario, 0, 0);
                    }
                };
                _objectInfoMenu.AddItem(scenarioItem);

                List<dynamic> rels = new List<dynamic> { "Ballas", "Grove"};
                Enum.GetNames(typeof(Relationship)).ToList().ForEach(rel => rels.Add(rel));
                var relItem = new UIMenuListItem(Translation.Translate("Relationship"), rels, rels.IndexOf(PropStreamer.ActiveRelationships[ent.Handle]));
                relItem.OnListChanged += (item, index) =>
                {
                    PropStreamer.ActiveRelationships[ent.Handle] = item.IndexToItem(index).ToString();
                    _changesMade++;
                };
                relItem.Activated += (item, index) =>
                {
                    ObjectDatabase.SetPedRelationshipGroup((Ped) ent, PropStreamer.ActiveRelationships[ent.Handle]);
                };
                _objectInfoMenu.AddItem(relItem);

                List<dynamic> weps = new List<dynamic>();
                Enum.GetNames(typeof(WeaponHash)).ToList().ForEach(rel => weps.Add(rel));
                var wepItem = new UIMenuListItem(Translation.Translate("Weapon"), weps, weps.IndexOf(PropStreamer.ActiveWeapons[ent.Handle].ToString()));
                wepItem.OnListChanged += (item, index) =>
                {
                    PropStreamer.ActiveWeapons[ent.Handle] = Enum.Parse(typeof(WeaponHash), item.IndexToItem(index).ToString());
                    _changesMade++;
                };
                wepItem.Activated += (item, index) =>
                {
                    ((Ped)ent).Weapons.RemoveAll();
                    if(PropStreamer.ActiveWeapons[ent.Handle] == WeaponHash.Unarmed) return;
                    ((Ped) ent).Weapons.Give(PropStreamer.ActiveWeapons[ent.Handle], 999, true, true);
                };
                _objectInfoMenu.AddItem(wepItem);
            }

            if (Function.Call<bool>(Hash.IS_ENTITY_A_VEHICLE, ent.Handle))
            {
                var sirentBool = new UIMenuCheckboxItem(Translation.Translate("Siren"), PropStreamer.ActiveSirens.Contains(ent.Handle));
                sirentBool.CheckboxEvent += (item, check) =>
                {
                    if (check && !PropStreamer.ActiveSirens.Contains(ent.Handle)) PropStreamer.ActiveSirens.Add(ent.Handle);
                    else if (!check && PropStreamer.ActiveSirens.Contains(ent.Handle)) PropStreamer.ActiveSirens.Remove(ent.Handle);
                    ((Vehicle) ent).SirenActive = check;
                    _changesMade++;
                };
                _objectInfoMenu.AddItem(sirentBool);
            }

            if (PropStreamer.IsPickup(ent.Handle))
            {
                var pickup = PropStreamer.GetPickup(ent.Handle);
                var amountList = new UIMenuItem(Translation.Translate("Amount"));
                amountList.SetRightLabel(pickup.Amount.ToString());
                amountList.Activated += (sender, item) =>
                {
                    string playerInput = Game.GetUserInput(10);
                    int newValue;
                    if (!int.TryParse(playerInput, out newValue) || newValue < -1)
                    {
                        UI.Notify("~r~~h~Map Editor~h~~n~~w~" +
                                  Translation.Translate("Input was not in the correct format."));
                        return;
                    }
                    pickup.SetAmount(newValue);
                    amountList.SetRightLabel(pickup.Amount.ToString());
                    _selectedProp = new Prop(pickup.ObjectHandle);
                    if (_settings.SnapCameraToSelectedObject)
                        _mainCamera.PointAt(_selectedProp);
                };
                _objectInfoMenu.AddItem(amountList);

                var pickupTypesList =
                    Enum.GetValues(typeof (ObjectDatabase.PickupHash)).Cast<ObjectDatabase.PickupHash>().ToList();
                var itemIndex = pickupTypesList.IndexOf((ObjectDatabase.PickupHash) pickup.PickupHash);

                var pickupTypeItem = new UIMenuListItem("Type", pickupTypesList.Select(s => (dynamic)(s.ToString())).ToList(), itemIndex);
                pickupTypeItem.OnListChanged += (sender, index) =>
                {
                    pickup.SetPickupHash((int)pickupTypesList[index]);
                    _selectedProp = new Prop(pickup.ObjectHandle);
                    if (_settings.SnapCameraToSelectedObject)
                        _mainCamera.PointAt(_selectedProp);
                };
                _objectInfoMenu.AddItem(pickupTypeItem);

                var timeoutTime = new UIMenuItem("Regeneration Time");
                timeoutTime.SetRightLabel(pickup.Timeout.ToString());

                timeoutTime.Activated += (sender, item) =>
                {
                    string playerInput = Game.GetUserInput(10);
                    int newValue;
                    if (!int.TryParse(playerInput, out newValue) || newValue < 0)
                    {
                        UI.Notify("~r~~h~Map Editor~h~~n~~w~" +
                                  Translation.Translate("Input was not in the correct format."));
                        return;
                    }
                    pickup.Timeout = newValue;
                    timeoutTime.SetRightLabel((newValue).ToString());
                };

                _objectInfoMenu.AddItem(timeoutTime);
            }

            posXitem.Activated +=
                (sender, item) =>
                    SetObjectVector(ent, posXitem, GetSafeFloat(Game.GetUserInput(ent.Position.X.ToString(CultureInfo.InvariantCulture), 10), ent.Position.X), ent.Position.Y, ent.Position.Z);
            posYitem.Activated +=
                (sender, item) =>
                    SetObjectVector(ent, posYitem, ent.Position.X, GetSafeFloat(Game.GetUserInput(ent.Position.Y.ToString(CultureInfo.InvariantCulture), 10), ent.Position.Y), ent.Position.Z);
            posZitem.Activated +=
                (sender, item) =>
                    SetObjectVector(ent, posZitem, ent.Position.X, ent.Position.Y, GetSafeFloat(Game.GetUserInput(ent.Position.Z.ToString(CultureInfo.InvariantCulture), 10), ent.Position.Z));

            posXitem.OnListChanged += (item, index) =>
            {
                if (!IsProp(ent) )
                    ent.Position = new Vector3((float) item.IndexToItem(index), ent.Position.Y, ent.Position.Z);
                else
                    ent.PositionNoOffset = new Vector3((float)item.IndexToItem(index), ent.Position.Y, ent.Position.Z);

                if (PropStreamer.IsPickup(ent.Handle))
                {
                    PropStreamer.GetPickup(ent.Handle).UpdatePos();
                }

                _changesMade++;
            };
            posYitem.OnListChanged += (item, index) =>
            {
                if (!IsProp(ent))
                    ent.Position = new Vector3(ent.Position.X, (float) item.IndexToItem(index), ent.Position.Z);
                else
                    ent.PositionNoOffset = new Vector3(ent.Position.X, (float)item.IndexToItem(index), ent.Position.Z);

                if (PropStreamer.IsPickup(ent.Handle))
                {
                    PropStreamer.GetPickup(ent.Handle).UpdatePos();
                }
                _changesMade++;
            };
            posZitem.OnListChanged += (item, index) =>
            {
                if (!IsProp(ent) )
                    ent.Position = new Vector3(ent.Position.X, ent.Position.Y, (float)item.IndexToItem(index));
                else
                    ent.PositionNoOffset = new Vector3(ent.Position.X, ent.Position.Y, (float)item.IndexToItem(index));

                if (PropStreamer.IsPickup(ent.Handle))
                {
                    PropStreamer.GetPickup(ent.Handle).UpdatePos();
                }
                _changesMade++;
            };

            rotXitem.Activated +=
                (sender, item) =>
                {
                    var rot = ent.Quaternion.ToEuler();
                    SetObjectRotation(ent,
                        GetSafeFloat(Game.GetUserInput(rot.X.ToString(CultureInfo.InvariantCulture).Limit(10), 10),
                            rot.X), rot.Y, rot.Z);
                };
            rotYitem.Activated +=
                (sender, item) =>
                {
                    var rot = ent.Quaternion.ToEuler();
                    SetObjectRotation(ent, rot.X,
                        GetSafeFloat(Game.GetUserInput(rot.Y.ToString(CultureInfo.InvariantCulture).Limit(10), 10),
                            rot.Y), rot.Z);
                };
            rotZitem.Activated +=
                (sender, item) =>
                {
                    var rot = ent.Quaternion.ToEuler();
                    SetObjectRotation(ent, rot.X, rot.Y,
                        GetSafeFloat(Game.GetUserInput(rot.Z.ToString(CultureInfo.InvariantCulture).Limit(10), 10),
                            rot.Z));
                };

            rotYitem.OnListChanged += (item, index) =>
            {
                var change = (float)item.IndexToItem(index);
                ent.Quaternion = new Vector3(change, ent.Rotation.Y, ent.Rotation.Z).ToQuaternion();
                _changesMade++;
            };

            rotZitem.OnListChanged += (item, index) =>
            {
                var change = (float) item.IndexToItem(index);
                ent.Quaternion = new Vector3(ent.Rotation.X, ent.Rotation.Y, change).ToQuaternion();
                _changesMade++;
            };

            rotXitem.OnListChanged += (item, index) =>
            {
                var change = (float)item.IndexToItem(index);
                ent.Quaternion = new Vector3(ent.Rotation.X, change, ent.Rotation.Z).ToQuaternion();
                _changesMade++;
            };

            if (refreshIndex)
                _objectInfoMenu.RefreshIndex();
        }
Ejemplo n.º 13
0
        private void CreateMenu()
        {
            _mainMenu = new UIMenu("Tobii Eye Tracking", "~b~SETTINGS");
            _mainMenu.SetMenuWidthOffset(50);
            //_mainMenu.ControlDisablingEnabled = false;
            _menuPool.Add(_mainMenu);

            InitLists();

            var firstPersonFreelook = new UIMenuCheckboxItem("Extended View", _settings.ExtendedViewEnabled, "Extend your view by looking at the edges of the screen");
            firstPersonFreelook.CheckboxEvent += (sender, args) => { _settings.ExtendedViewEnabled = firstPersonFreelook.Checked; };
            _mainMenu.AddItem(firstPersonFreelook);

            var extendedViewSensitivitySlider = new UIMenuListItem("Extended View Sensitivity", _values0To1, (int)Math.Round(_settings.ExtendedViewSensitivity / 0.1), "Extended View sensitivity");
            extendedViewSensitivitySlider.OnListChanged +=
                (sender, args) =>
                {
                    _settings.ExtendedViewSensitivity =
                        (float)extendedViewSensitivitySlider.IndexToItem(extendedViewSensitivitySlider.Index);
                };
            _mainMenu.AddItem(extendedViewSensitivitySlider);

            var fireAtGaze = new UIMenuCheckboxItem("Shoot At Gaze", _settings.FireAtGazeEnabled, "Your gun will shoot where you look. Move the RIGHT JOYSTICK while HOLDING LEFT THUMB to fine adjust the crosshair around your gaze point while shooting.");
            fireAtGaze.CheckboxEvent += (sender, args) => { _settings.FireAtGazeEnabled = fireAtGaze.Checked; };
            _mainMenu.AddItem(fireAtGaze);

            var aimAtGaze = new UIMenuCheckboxItem("Aim At Gaze", _settings.AimAtGazeEnabled, "You camera will turn towards the target when you press aim button.");
            aimAtGaze.CheckboxEvent += (sender, args) => { _settings.AimAtGazeEnabled = aimAtGaze.Checked; };
            _mainMenu.AddItem(aimAtGaze);

            var snapAtTargets = new UIMenuCheckboxItem("Snap At Targets", _settings.SnapAtTargetsEnabled, "Snap crosshair at targets. Makes it less challenging to use Aim At Gaze and Shoot At Gaze features.");
            snapAtTargets.CheckboxEvent += (sender, args) => { _settings.SnapAtTargetsEnabled = snapAtTargets.Checked; };
            _mainMenu.AddItem(snapAtTargets);

            var gazeFilteringSlider = new UIMenuListItem("Gaze Filter", _values0To1, (int)Math.Round(_settings.GazeFiltering / 0.1), "Filter gaze data. Higher values will make crosshair movements smoother, but will increase the latency.");
            gazeFilteringSlider.OnListChanged += (sender, args) => { _settings.GazeFiltering = (float)gazeFilteringSlider.IndexToItem(gazeFilteringSlider.Index); };
            _mainMenu.AddItem(gazeFilteringSlider);

            var incinerateAtGaze = new UIMenuCheckboxItem("Incinerate At Gaze", _settings.IncinerateAtGazeEnabled, "Push A button to burn things where you look. This feature replaces the default command for A button.");
            incinerateAtGaze.CheckboxEvent += (sender, args) => { _settings.IncinerateAtGazeEnabled = incinerateAtGaze.Checked; };
            _mainMenu.AddItem(incinerateAtGaze);

            var taseAtGaze = new UIMenuCheckboxItem("Tase At Gaze", _settings.TaseAtGazeEnabled, "Push RB to tase people remotely with your eyes. Doesn't work in aircrafts. This feature replaces the default command for RB.");
            taseAtGaze.CheckboxEvent += (sender, args) => { _settings.TaseAtGazeEnabled = taseAtGaze.Checked; };
            _mainMenu.AddItem(taseAtGaze);

            var missilesAtGaze = new UIMenuCheckboxItem("Launch Missiles At Gaze", _settings.MissilesAtGazeEnabled, "Push B button to launch missiles at gaze. This feature replaces the default command for B button.");
            missilesAtGaze.CheckboxEvent += (sender, args) => { _settings.MissilesAtGazeEnabled = missilesAtGaze.Checked; };
            _mainMenu.AddItem(missilesAtGaze);

            var alwaysShowCrosshair = new UIMenuCheckboxItem("Always Show Crosshair", _settings.AlwaysShowCrosshairEnabled, "Show crosshair even when you are not aiming or shooting");
            alwaysShowCrosshair.CheckboxEvent += (sender, args) => { _settings.AlwaysShowCrosshairEnabled = alwaysShowCrosshair.Checked; };
            _mainMenu.AddItem(alwaysShowCrosshair);

            var dontFallFromBikes = new UIMenuCheckboxItem("Don't Fall From Bikes", _settings.DontFallFromBikesEnabled, "You won't fall from a bike when you crash into something");
            dontFallFromBikes.CheckboxEvent += (sender, args) => { _settings.DontFallFromBikesEnabled = dontFallFromBikes.Checked; };
            _mainMenu.AddItem(dontFallFromBikes);

            const string privacyPolicyText = "By selecting to send usage statistics you agree that your usage statistics, such as a game session time, " +
                                             "mod settings and mod features you use will be collected by the developer. The data will be collected " +
                                             "anonymously, processed on Google Analytics and used solely to enhance user experience.";

            _sendUsageStatistics = new UIMenuCheckboxItem("Send Usage Statistics", _settings.SendUsageStatistics, privacyPolicyText);
            _sendUsageStatistics.CheckboxEvent += (sender, args) => { _settings.SendUsageStatistics = _sendUsageStatistics.Checked; };
            _mainMenu.AddItem(_sendUsageStatistics);

            _mainMenu.RefreshIndex();
        }
Ejemplo n.º 14
0
		public void BuildMenu(Race race)
		{
			GUI.MainMenu.Clear();
			GUI.MainMenu.SetBannerType(new UIResRectangle());
			_raceSettings.Clear();

			_raceSettings["TOD"] = "Current";
			_raceSettings["Weather"] = "Current";
			_raceSettings["Wanted"] = false;
			_raceSettings["Opponents"] = "Random";
			_raceSettings["Traffic"] = true;
			_raceSettings["Laps"] = 1;

			_previewVehicle = World.CreateVehicle(Helpers.RequestModel((int)race.AvailableVehicles[0]), race.Trigger);
			_previewVehicle.IsPersistent = false;

			List<dynamic> timeList = new List<dynamic> { "Current", "Sunrise", "Day", "Sunset", "Night" };
			var timeItem = new UIMenuListItem("Time of Day", timeList, 0);
			timeItem.OnListChanged += (item, index) =>
			{
				_raceSettings["TOD"] = item.IndexToItem(index);
			};

			var weatherList = new List<dynamic> { "Current" };
			Enum.GetNames(typeof(Weather)).ToList().ForEach(w => weatherList.Add(w));
			var weatherItem = new UIMenuListItem("Weather", weatherList, 0);
			weatherItem.OnListChanged += (item, index) =>
			{
				_raceSettings["Weather"] = item.IndexToItem(index);
			};

			var copItem = new UIMenuCheckboxItem("Wanted Levels", false);
			copItem.CheckboxEvent += (i, checkd) =>
			{
				_raceSettings["Wanted"] = checkd;
			};

			var opponentsList = new List<dynamic> { "Random" };
			Enumerable.Range(1, race.SpawnPoints.Length - 1).ToList().ForEach(n => opponentsList.Add(n));
			var opponentsItem = new UIMenuListItem("Number of Opponents", opponentsList, 0);
			opponentsItem.OnListChanged += (item, index) =>
			{
				_raceSettings["Opponents"] = item.IndexToItem(index);
			};

			var trafficItem = new UIMenuCheckboxItem("Traffic", true);
			trafficItem.CheckboxEvent += (i, checkd) =>
			{
				_raceSettings["Traffic"] = checkd;
			};

			List<dynamic> tmpList = new List<dynamic>();
			race.AvailableVehicles.ToList().ForEach(x => tmpList.Add(x));
			var carItem = new UIMenuListItem("Vehicle", tmpList, 0);
			carItem.OnListChanged += (item, index) =>
			{
				VehicleHash outHash;
				Enum.TryParse(item.IndexToItem(index).ToString(), out outHash);
				var oldC = _previewVehicle.PrimaryColor;
				_previewVehicle?.Delete();
				_previewVehicle = World.CreateVehicle(Helpers.RequestModel((int) outHash), race.Trigger);
				if(_previewVehicle == null) return;
				_previewVehicle.PrimaryColor = oldC;
				_previewVehicle.SecondaryColor = oldC;
				_previewVehicle.IsPersistent = false;
			};
			
			List<dynamic> colors = new List<dynamic>
			{
				VehicleColor.MatteYellow,
                VehicleColor.Orange,
                VehicleColor.MatteRed,
                VehicleColor.HotPink,
                VehicleColor.MattePurple,
                VehicleColor.MatteDarkBlue,
                VehicleColor.Blue,
                VehicleColor.EpsilonBlue,
                VehicleColor.MatteLimeGreen,
                VehicleColor.Green,
            };
			var colorItem = new UIMenuListItem("Color", colors, 0);
			colorItem.OnListChanged += (ite, index) =>
			{
				VehicleColor outHash;
				Enum.TryParse(ite.IndexToItem(index).ToString(), out outHash);
				_previewVehicle.PrimaryColor = outHash;
				_previewVehicle.SecondaryColor = outHash;
			};

			var confimItem = new UIMenuItem("Start Race");
			confimItem.Activated += (item, index) =>
			{
				GUI.MainMenu.Visible = false;
				GUI.IsInMenu = false;
				Game.Player.CanControlCharacter = true;
				World.RenderingCamera = null;
				StartRace(race);
			};

			GUI.MainMenu.OnMenuClose += menu =>
			{
				World.RenderingCamera = null;
				GUI.IsInMenu = false;
				Game.Player.CanControlCharacter = true;
				_previewVehicle?.Delete();
			};

			GUI.MainMenu.AddItem(timeItem);
			GUI.MainMenu.AddItem(weatherItem);
			GUI.MainMenu.AddItem(copItem);
			GUI.MainMenu.AddItem(carItem);
			GUI.MainMenu.AddItem(colorItem);
			GUI.MainMenu.AddItem(opponentsItem);
			GUI.MainMenu.AddItem(trafficItem);
			if (race.LapsAvailable)
			{
				var lapList = new List<dynamic>();
				Enumerable.Range(1, 20).ToList().ForEach(n => lapList.Add(n));
				var lapItem = new UIMenuListItem("Laps", lapList, 0);
				lapItem.OnListChanged += (item, index) =>
				{
					_raceSettings["Laps"] = item.IndexToItem(index);
				};
				GUI.MainMenu.AddItem(lapItem);
			}
			GUI.MainMenu.AddItem(confimItem);
			GUI.MainMenu.RefreshIndex();
		}
Ejemplo n.º 15
0
	    private void CreateThirdPersonFreelookMenu()
	    {
            ThirdPersonFreelookMenu = new UIMenu("Tobii Eye Tracking", "~b~THIRD PERSON FREELOOK SETTINGS");
            ThirdPersonFreelookMenu.SetMenuWidthOffset(50);
	        {
	            var thirdPersonFreelook = new UIMenuCheckboxItem("TPS Freelook", _settings.ThirdPersonFreelookEnabled,
	                "Control camera with gaze");
	            thirdPersonFreelook.CheckboxEvent +=
	                (sender, args) => { _settings.ThirdPersonFreelookEnabled = thirdPersonFreelook.Checked; };
                ThirdPersonFreelookMenu.AddItem(thirdPersonFreelook);

	            var thirdPersonSensitivitySlider = new UIMenuListItem("TPS Freelook Sensitivity", _values0To1,
	                (int) Math.Round(_settings.ThirdPersonSensitivity/0.1), "Freelook sensitivity");
	            thirdPersonSensitivitySlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonSensitivity =
	                        thirdPersonSensitivitySlider.IndexToItem(thirdPersonSensitivitySlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonSensitivitySlider);

	            var thirdPersonYOffsetSlider = new UIMenuListItem("TPS Freelook Vertical Offset", _valuesMinus1To1,
	                (int) Math.Round((_settings.ThirdPersonYOffset + 1)/0.1), "Freelook vertical offset");
	            thirdPersonYOffsetSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonYOffset = thirdPersonYOffsetSlider.IndexToItem(thirdPersonYOffsetSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonYOffsetSlider);

	            var thirdPersonDeadZoneWidthSlider = new UIMenuListItem("TPS Freelook Deadzone Width", _values0To1,
	                (int) Math.Round(_settings.ThirdPersonDeadZoneWidth/0.1), "Freelook deadzone");
	            thirdPersonDeadZoneWidthSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonDeadZoneWidth =
	                        thirdPersonDeadZoneWidthSlider.IndexToItem(thirdPersonDeadZoneWidthSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneWidthSlider);

	            var thirdPersonDeadZoneHeightSlider = new UIMenuListItem("TPS Freelook Deadzone Height", _values0To1,
	                (int) Math.Round(_settings.ThirdPersonDeadZoneHeight/0.1), "Freelook deadzone");
	            thirdPersonDeadZoneHeightSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonDeadZoneHeight =
	                        thirdPersonDeadZoneHeightSlider.IndexToItem(thirdPersonDeadZoneHeightSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneHeightSlider);

	            var thirdPersonMinPitchSlider = new UIMenuListItem("TPS Min Pitch", _valuesMinus70To0,
	                (int) Math.Round((_settings.ThirdPersonMinPitchDeg + 70)/1), "Freelook min pitch angle");
	            thirdPersonMinPitchSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonMinPitchDeg = thirdPersonMinPitchSlider.IndexToItem(thirdPersonMinPitchSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonMinPitchSlider);

	            var thirdPersonMaxPitchSlider = new UIMenuListItem("TPS Max Pitch", _values0To70,
	                (int) Math.Round((_settings.ThirdPersonMaxPitchDeg)/1), "Freelook max pitch angle");
	            thirdPersonMaxPitchSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonMaxPitchDeg = thirdPersonMaxPitchSlider.IndexToItem(thirdPersonMaxPitchSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonMaxPitchSlider);
	        }

	        {
	            var thirdPersonYOffsetDrivingSlider = new UIMenuListItem("TPS Freelook Vertical Offset Driving",
	                _valuesMinus1To1, (int) Math.Round((_settings.ThirdPersonYOffsetDriving + 1)/0.1),
	                "Freelook vertical offset");
	            thirdPersonYOffsetDrivingSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonYOffsetDriving =
	                        thirdPersonYOffsetDrivingSlider.IndexToItem(thirdPersonYOffsetDrivingSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonYOffsetDrivingSlider);

	            var thirdPersonDeadZoneWidthDrivingSlider = new UIMenuListItem("TPS Freelook Deadzone Width Driving",
	                _values0To1, (int) Math.Round(_settings.ThirdPersonDeadZoneWidthDriving/0.1), "Freelook deadzone");
	            thirdPersonDeadZoneWidthDrivingSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonDeadZoneWidthDriving =
	                        thirdPersonDeadZoneWidthDrivingSlider.IndexToItem(thirdPersonDeadZoneWidthDrivingSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneWidthDrivingSlider);

	            var thirdPersonDeadZoneHeightDrivingSlider = new UIMenuListItem("TPS Freelook Deadzone Height Driving",
	                _values0To1, (int) Math.Round(_settings.ThirdPersonDeadZoneHeightDriving/0.1), "Freelook deadzone");
	            thirdPersonDeadZoneHeightDrivingSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonDeadZoneHeightDriving =
	                        thirdPersonDeadZoneHeightDrivingSlider.IndexToItem(thirdPersonDeadZoneHeightDrivingSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneHeightDrivingSlider);

	            var thirdPersonMinPitchDrivingSlider = new UIMenuListItem("TPS Min Pitch Driving", _valuesMinus70To0,
	                (int) Math.Round((_settings.ThirdPersonMinPitchDrivingDeg + 70)/1), "Freelook min pitch angle");
	            thirdPersonMinPitchDrivingSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonMinPitchDrivingDeg =
	                        thirdPersonMinPitchDrivingSlider.IndexToItem(thirdPersonMinPitchDrivingSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonMinPitchDrivingSlider);

	            var thirdPersonMaxPitchDrivingSlider = new UIMenuListItem("TPS Max Pitch Driving", _values0To70,
	                (int) Math.Round((_settings.ThirdPersonMaxPitchDeg)/1), "Freelook max pitch angle");
	            thirdPersonMaxPitchDrivingSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonMaxPitchDrivingDeg =
	                        thirdPersonMaxPitchDrivingSlider.IndexToItem(thirdPersonMaxPitchDrivingSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonMaxPitchDrivingSlider);
	        }

	        {
	            var thirdPersonYOffsetPlaneSlider = new UIMenuListItem("TPS Freelook Vertical Offset Plane", _valuesMinus1To1,
	                (int) Math.Round((_settings.ThirdPersonYOffsetPlane + 1)/0.1), "Freelook vertical offset");
	            thirdPersonYOffsetPlaneSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonYOffsetPlane =
	                        thirdPersonYOffsetPlaneSlider.IndexToItem(thirdPersonYOffsetPlaneSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonYOffsetPlaneSlider);

	            var thirdPersonDeadZoneWidthPlaneSlider = new UIMenuListItem("TPS Freelook Deadzone Width Plane", _values0To1,
	                (int) Math.Round(_settings.ThirdPersonDeadZoneWidthPlane/0.1), "Freelook deadzone");
	            thirdPersonDeadZoneWidthPlaneSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonDeadZoneWidthPlane =
	                        thirdPersonDeadZoneWidthPlaneSlider.IndexToItem(thirdPersonDeadZoneWidthPlaneSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneWidthPlaneSlider);

	            var thirdPersonDeadZoneHeightPlaneSlider = new UIMenuListItem("TPS Freelook Deadzone Height Plane", _values0To1,
	                (int) Math.Round(_settings.ThirdPersonDeadZoneHeightPlane/0.1), "Freelook deadzone");
	            thirdPersonDeadZoneHeightPlaneSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonDeadZoneHeightPlane =
	                        thirdPersonDeadZoneHeightPlaneSlider.IndexToItem(thirdPersonDeadZoneHeightPlaneSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneHeightPlaneSlider);

	            var thirdPersonMinPitchPlaneSlider = new UIMenuListItem("TPS Min Pitch Plane", _valuesMinus70To0,
	                (int) Math.Round((_settings.ThirdPersonMinPitchPlaneDeg + 70)/1), "Freelook min pitch angle");
	            thirdPersonMinPitchPlaneSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonMinPitchPlaneDeg =
	                        thirdPersonMinPitchPlaneSlider.IndexToItem(thirdPersonMinPitchPlaneSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonMinPitchPlaneSlider);

	            var thirdPersonMaxPitchPlaneSlider = new UIMenuListItem("TPS Max Pitch Plane", _values0To70,
	                (int) Math.Round((_settings.ThirdPersonMaxPitchPlaneDeg)/1), "Freelook max pitch angle");
	            thirdPersonMaxPitchPlaneSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonMaxPitchPlaneDeg =
	                        thirdPersonMaxPitchPlaneSlider.IndexToItem(thirdPersonMaxPitchPlaneSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonMaxPitchPlaneSlider);
	        }


	        {
	            var thirdPersonYOffsetHeliSlider = new UIMenuListItem("TPS Freelook Vertical Offset Heli", _valuesMinus1To1,
	                (int) Math.Round((_settings.ThirdPersonYOffsetHeli + 1)/0.1), "Freelook vertical offset");
	            thirdPersonYOffsetHeliSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonYOffsetHeli =
	                        thirdPersonYOffsetHeliSlider.IndexToItem(thirdPersonYOffsetHeliSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonYOffsetHeliSlider);

	            var thirdPersonDeadZoneWidthHeliSlider = new UIMenuListItem("TPS Freelook Deadzone Width Heli", _values0To1,
	                (int) Math.Round(_settings.ThirdPersonDeadZoneWidthHeli/0.1), "Freelook deadzone");
	            thirdPersonDeadZoneWidthHeliSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonDeadZoneWidthHeli =
	                        thirdPersonDeadZoneWidthHeliSlider.IndexToItem(thirdPersonDeadZoneWidthHeliSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneWidthHeliSlider);

	            var thirdPersonDeadZoneHeightHeliSlider = new UIMenuListItem("TPS Freelook Deadzone Height Heli", _values0To1,
	                (int) Math.Round(_settings.ThirdPersonDeadZoneHeightHeli/0.1), "Freelook deadzone");
	            thirdPersonDeadZoneHeightHeliSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonDeadZoneHeightHeli =
	                        thirdPersonDeadZoneHeightHeliSlider.IndexToItem(thirdPersonDeadZoneHeightHeliSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneHeightHeliSlider);

	            var thirdPersonMinPitchHeliSlider = new UIMenuListItem("TPS Min Pitch Heli", _valuesMinus70To0,
	                (int) Math.Round((_settings.ThirdPersonMinPitchHeliDeg + 70)/1), "Freelook min pitch angle");
	            thirdPersonMinPitchHeliSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonMinPitchHeliDeg =
	                        thirdPersonMinPitchHeliSlider.IndexToItem(thirdPersonMinPitchHeliSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonMinPitchHeliSlider);

	            var thirdPersonMaxPitchHeliSlider = new UIMenuListItem("TPS Max Pitch Heli", _values0To70,
	                (int) Math.Round((_settings.ThirdPersonMaxPitchDeg)/1), "Freelook max pitch angle");
	            thirdPersonMaxPitchHeliSlider.OnListChanged +=
	                (sender, args) =>
	                {
	                    _settings.ThirdPersonMaxPitchHeliDeg =
	                        thirdPersonMaxPitchHeliSlider.IndexToItem(thirdPersonMaxPitchHeliSlider.Index);
	                };
                ThirdPersonFreelookMenu.AddItem(thirdPersonMaxPitchHeliSlider);
	        }
            ThirdPersonFreelookMenu.RefreshIndex();
            _menuPool.Add(ThirdPersonFreelookMenu);
	    }
Ejemplo n.º 16
0
 protected virtual void CheckboxChange(UIMenuCheckboxItem sender, bool Checked)
 {
     OnCheckboxChange?.Invoke(this, sender, Checked);
 }
Ejemplo n.º 17
0
        public DemagoMenu(List<Mission> missions = null)
        {
            if (missions == null)
            {
                missions = new List<Mission>();
            }

            #region Controls gestion
            this.OnKeysPressedEvent += (Keys key) => {
                if (key == Keys.F5)
                {
                    this.toggleDisplay();
                }
            };
            this.OnControlDoublePressed += (GTA.Control control) => {
                if (control == GTA.Control.SelectWeapon)
                {
                    this.toggleDisplay();
                }
            };
            #endregion

            #region Menu creation
            menuPool = new MenuPool();
            mainMenu = new UIMenu("GTA Demago", "~b~Configuration du mod");
            menuPool.Add(mainMenu);

            //Missions
            var missionsMenu = menuPool.AddSubMenu(mainMenu, "Missions");
            foreach (Mission mission in missions)
            {
                var missionMenu = menuPool.AddSubMenu(missionsMenu, mission.getName());
                var startItem = mission.addStartItem(ref missionMenu);

                missionMenu.OnItemSelect += (sender, item, index) =>
                {
                    if (item == startItem)
                    {
                        DemagoScript.stopCurrentMission(true);
                        mission.start();
                    }
                };
            }

            var teleportToTaxiItem = new UIMenuItem("Se téléporter à la mission taxi");
            var stopCurrentMissionItem = new UIMenuItem("Stopper la mission");

            missionsMenu.AddItem(teleportToTaxiItem);
            missionsMenu.AddItem(stopCurrentMissionItem);

            missionsMenu.OnItemSelect += (sender, item, index) =>
            {
                if (item == stopCurrentMissionItem)
                {
                    DemagoScript.stopCurrentMission(true);
                }

                if (item == teleportToTaxiItem)
                {
                    Function.Call(Hash.SET_NEW_WAYPOINT, -197f, 4213f);
                    Game.Player.Character.Position = PlacesPositions.TaxiMission;
                }
            };

            //Modèles
            var joeModelItem = new UIMenuItem("Joe l'anticonformiste");
            var fourasModelItem = new UIMenuItem("Père Fouras", "La fonctionnalité est en cours de développement");
            var gastrowModelItem = new UIMenuItem("Gastrow Nomie", "La fonctionnalité est en cours de développement");
            var dissociateModelItem = new UIMenuItem("Dissocier", "Dissocier son corps avec le personnage le plus proche");
            var resetModelItem = new UIMenuItem("Récupérer le modèle de base");

            var modelMenu = menuPool.AddSubMenu(mainMenu, "Modèles");
            modelMenu.AddItem(joeModelItem);
            modelMenu.AddItem(fourasModelItem);
            modelMenu.AddItem(gastrowModelItem);
            modelMenu.AddItem(dissociateModelItem);
            modelMenu.AddItem(resetModelItem);

            modelMenu.OnItemSelect += (sender, item, index) =>
            {
                if ((PedHash)Game.Player.Character.Model.Hash == PedHash.Michael || (PedHash)Game.Player.Character.Model.Hash == PedHash.Franklin || (PedHash)Game.Player.Character.Model.Hash == PedHash.Trevor)
                {
                    DemagoScript.savedPlayerModelHash = (PedHash)Game.Player.Character.Model.Hash;
                }

                if (item == resetModelItem && DemagoScript.savedPlayerModelHash == (PedHash)Game.Player.Character.Model.Hash)
                {
                    UI.Notify("Vous possédez déjà le modèle de base !");
                }

                if (DemagoScript.savedPlayerModelHash != (PedHash)Game.Player.Character.Model.Hash)
                {
                    //Reset to old model
                    Function.Call(Hash.SET_PLAYER_MODEL, Game.Player.Handle, (int)DemagoScript.savedPlayerModelHash);
                }

                if (item == dissociateModelItem)
                {
                    Ped closestPed = Tools.GetClosestPedAroundPlayer();
                    if (closestPed != null && closestPed.Exists())
                    {
                        Tools.setModel(closestPed.Model);

                        if (closestPed.Position != Vector3.Zero)
                        {
                            Vector3 oldPlayerPosition = Game.Player.Character.Position;
                            Game.Player.Character.Position = closestPed.Position;
                            closestPed.Position = oldPlayerPosition;
                        }
                        else
                        {
                            Tools.log("Closest ped position == 0 ...");
                        }
                    }
                    else
                    {
                        GTA.UI.Notify("Pas de personnage proche...");
                    }
                }

                if (item == joeModelItem)
                {
                    ModelManager.Instance.setDemagoModel(DemagoModel.Joe);
                }

                if (item == fourasModelItem)
                {
                    ModelManager.Instance.setDemagoModel(DemagoModel.Fouras);
                }

                if (item == gastrowModelItem)
                {
                    ModelManager.Instance.setDemagoModel(DemagoModel.Gastrow);
                }
            };

            //Vehicules
            var destroyCarsItem = new UIMenuItem("Supprimer les véhicules proches");
            var spawnCarItem = new UIMenuItem("Faire apparaitre un véhicule aléatoire");
            var spawnNiceCarItem = new UIMenuItem("Faire apparaitre un véhicule rapide");
            var healPlayerItem = new UIMenuItem("Se soigner et réparer le véhicule");
            var bikeJoe = new UIMenuItem("Le vélo de Joe");
            var carFouras = new UIMenuItem("La voiture du père Fouras", "La fonctionnalité est en cours de développement");

            var vehiclesMenu = menuPool.AddSubMenu(mainMenu, "Véhicules");
            vehiclesMenu.AddItem(healPlayerItem);
            vehiclesMenu.AddItem(spawnCarItem);
            vehiclesMenu.AddItem(spawnNiceCarItem);
            vehiclesMenu.AddItem(destroyCarsItem);
            vehiclesMenu.OnItemSelect += (sender, item, index) =>
            {
                if (item == destroyCarsItem)
                {
                    int counter = 0;
                    foreach (Vehicle vehicle in World.GetNearbyVehicles(Game.Player.Character, 10))
                    {
                        if (vehicle != Game.Player.Character.CurrentVehicle)
                        {
                            counter++;
                            vehicle.Delete();
                        }
                    }
                    GTA.UI.Notify(counter + " véhicule(s) supprimé(s) !");
                }
                if (item == spawnCarItem)
                {
                    Array vehicleValues = Enum.GetValues(typeof(VehicleHash));
                    Random random = new Random();
                    VehicleHash randomValue = (VehicleHash)vehicleValues.GetValue(random.Next(vehicleValues.Length));
                    if (lastSpawnedVehicle != null && lastSpawnedVehicle != Game.Player.Character.CurrentVehicle)
                    {
                        lastSpawnedVehicle.Delete();
                    }
                    lastSpawnedVehicle = World.CreateVehicle(randomValue, Tools.GetSafeRoadPos(Game.Player.Character.Position));
                }
                if (item == spawnNiceCarItem)
                {
                    if (lastSpawnedVehicle != null && lastSpawnedVehicle != Game.Player.Character.CurrentVehicle)
                    {
                        lastSpawnedVehicle.Delete();
                    }
                    lastSpawnedVehicle = World.CreateVehicle(VehicleHash.T20, Tools.GetSafeRoadPos(Game.Player.Character.Position));
                }
                if (item == healPlayerItem)
                {
                    Game.Player.Character.Health = Game.Player.Character.MaxHealth;
                    Game.Player.Character.Armor = 100;
                    if (Game.Player.Character.IsInVehicle())
                    {
                        Game.Player.Character.CurrentVehicle.Repair();
                    }
                }
            };

            var specialVehiclesMenu = menuPool.AddSubMenu(vehiclesMenu, "Véhicules spéciaux");
            specialVehiclesMenu.AddItem(bikeJoe);
            specialVehiclesMenu.AddItem(carFouras);
            specialVehiclesMenu.OnItemSelect += (sender, item, index) =>
            {
                if (lastSpecialVehicle != null && lastSpecialVehicle.Exists())
                {
                    lastSpecialVehicle.Delete();
                    lastSpecialVehicle = null;
                }

                if (item == bikeJoe)
                {
                    Vehicle bike = null;
                    do
                    {
                        bike = World.CreateVehicle(VehicleHash.TriBike, Game.Player.Character.Position.Around(2));
                    } while (bike == null || !bike.Exists());

                    lastSpecialVehicle = bike;
                }
                if (item == carFouras)
                {
                    //TODO : Spawn de la voiture de Fouras
                }
            };

            //Outils
            seePlayerActiveItem = new UIMenuCheckboxItem("Personnage invisible", seePlayer, "Si la case est cochée, votre personnage est invisible");
            godPlayerActiveItem = new UIMenuCheckboxItem("Personnage invincible", godPlayer, "Si la case est cochée, votre personnage est invincible");
            seeVehicleActiveItem = new UIMenuCheckboxItem("Vehicle invisible", seeVehicle, "Si la case est cochée, votre véhicule est invisible");
            godVehicleActiveItem = new UIMenuCheckboxItem("Vehicle invincible", godVehicle, "Si la case est cochée, votre véhicule est invincible");
            var teleportMarkerItem = new UIMenuItem("Se téléporter au marqueur");
            var wantedUpItem = new UIMenuItem("Ajouter une étoile");
            var wantedDownItem = new UIMenuItem("Supprimer une étoile");
            var wantedLevelItem = new UIMenuItem("Supprimer toutes les étoiles");
            var addMoney = new UIMenuItem("Ajouter 50.000$");
            var removeMoney = new UIMenuItem("Enlever 50.000$");
            var gravityActiveItem = new UIMenuCheckboxItem("Zéro gravité", zeroGravity, "Si la case est cochée, il n'y aura plus de gravité sur la map entière");
            var showPositionItem = new UIMenuItem("Afficher la position");
            var showRotationItem = new UIMenuItem("Afficher la rotation");

            var toolsMenu = menuPool.AddSubMenu(mainMenu, "Outils");
            toolsMenu.AddItem(wantedLevelItem);
            toolsMenu.AddItem(wantedDownItem);
            toolsMenu.AddItem(wantedUpItem);
            toolsMenu.AddItem(teleportMarkerItem);
            toolsMenu.AddItem(addMoney);
            toolsMenu.AddItem(removeMoney);
            toolsMenu.AddItem(gravityActiveItem);
            toolsMenu.AddItem(seePlayerActiveItem);
            toolsMenu.AddItem(godPlayerActiveItem);
            toolsMenu.AddItem(seeVehicleActiveItem);
            toolsMenu.AddItem(godVehicleActiveItem);
            toolsMenu.AddItem(showPositionItem);
            toolsMenu.AddItem(showRotationItem);

            toolsMenu.OnItemSelect += (sender, item, checked_) =>
            {
                if (item == teleportMarkerItem)
                {
                    Tools.TeleportPlayerToWaypoint();
                }

                if (item == showPositionItem)
                {
                    GTA.UI.Notify("player X : " + Game.Player.Character.Position.X + " / Y : " + Game.Player.Character.Position.Y + " / Z : " + Game.Player.Character.Position.Z);
                }
                if (item == showRotationItem)
                {
                    GTA.UI.Notify("rot X : " + Game.Player.Character.Rotation.X + " / Y : " + Game.Player.Character.Rotation.Y + " / Z : " + Game.Player.Character.Rotation.Z);
                }
                if (item == wantedDownItem)
                {
                    if (Game.Player.WantedLevel > 0)
                        Game.Player.WantedLevel--;
                }
                if (item == wantedLevelItem)
                {
                    Game.Player.WantedLevel = 0;
                }
                if (item == wantedUpItem)
                {
                    if (Game.Player.WantedLevel < 5)
                        Game.Player.WantedLevel++;
                }
                if (item == addMoney)
                {
                    Game.Player.Money += 50000;
                }
                if (item == removeMoney)
                {
                    if (Game.Player.Money > 50000)
                        Game.Player.Money -= 50000;
                    else
                        Game.Player.Money = 0;
                }
            };

            toolsMenu.OnCheckboxChange += (sender, item, checked_) =>
            {
                Ped player = Game.Player.Character;
                if (item == gravityActiveItem)
                {
                    zeroGravity = checked_;
                    if (zeroGravity)
                    {
                        Function.Call(Hash.SET_GRAVITY_LEVEL, 3);
                    }
                    else
                    {
                        Function.Call(Hash.SET_GRAVITY_LEVEL, 0);
                    }
                }
                if (item == seePlayerActiveItem)
                {
                    seePlayer = checked_;
                    player.IsVisible = !seePlayer;
                }
                if (item == godPlayerActiveItem)
                {
                    godPlayer = checked_;
                    Game.Player.IsInvincible = godPlayer;
                }

                if (item == seeVehicleActiveItem)
                {
                    if (player.IsInVehicle())
                    {
                        seeVehicle = checked_;
                        toChangeVehicle.IsVisible = !seeVehicle;
                        player.IsVisible = !seePlayer;
                    }
                    else
                    {
                        seeVehicleActiveItem.Checked = false;
                        UI.Notify("Impossible , vous êtes à pied !");
                    }
                }
                if (item == godVehicleActiveItem)
                {
                    if (player.IsInVehicle())
                    {
                        godVehicle = checked_;
                        toChangeVehicle.IsInvincible = godVehicle;
                        toChangeVehicle.CanTiresBurst = godVehicle;
                    }
                    else
                    {
                        godVehicleActiveItem.Checked = false;
                        UI.Notify("Impossible , vous êtes à pied !");
                    }
                }
            };
            #endregion
        }