Пример #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);
        }
Пример #2
1
    public PIMenu()
    {
        Tick += OnTick;
        KeyDown += OnKeyDown;

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

        MenuColor = Color.Blue;

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

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

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

        QuickGPSItem.Activated += (UIMenu sender, UIMenuItem selecteditem) =>
        {
            var tmpList = (UIMenuListItem)selecteditem;
            switch (tmpList.Index)
            {
                case 0:
                    Function.Call(Hash.SET_WAYPOINT_OFF);
                    break;
                case 1:
                    Vector3 NearestAmmunation = PointsOfInterest.GetClosestPoi(Game.Player.Character.Position, PointsOfInterest.Type.AmmuNation);
                    Function.Call(Hash.SET_NEW_WAYPOINT, NearestAmmunation.X, NearestAmmunation.Y);
                    break;
            }
        };

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

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

        MainMenu.AddItem(InventoryMenuItem);

        MainMenu.BindMenuToItem(InventoryMenu, InventoryMenuItem);

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

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

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

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

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

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

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

        MainMenu.AddItem(PassiveModeItem);

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

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

        MainMenu.AddItem(MenuOptionsMenuItem);

        MainMenu.BindMenuToItem(MenuOptionsMenu, MenuOptionsMenuItem);

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

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

        MenuOptionsMenu.BindMenuToItem(AboutMenu, AboutOptionsMenuItem);

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

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

        MenuOptionsMenu.AddItem(AboutOptionsMenuItem);

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

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

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

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

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

        MenuOptionsMenu.OnListChange += (UIMenu sender, UIMenuListItem listItem, int newIndex) =>
        {
            if (listItem == MenuColorItem)
            {
                switch (newIndex)
                {
                    case 0:
                        MenuColor = Color.Blue;
                        break;
                    case 1:
                        MenuColor = Color.Red;
                        break;
                    case 2:
                        MenuColor = Color.Green;
                        break;
                    case 3:
                        MenuColor = Color.Orange;
                        break;
                    case 4:
                        MenuColor = Color.Purple;
                        break;
                    case 5:
                        MenuColor = Color.Yellow;
                        break;
                }
            }

            if (listItem == WalkStyleItem)
            {
                switch (newIndex)
                {
                    case 0:
                        Game.Player.Character.Task.ClearAll();
                        Function.Call(Hash.RESET_PED_MOVEMENT_CLIPSET, Game.Player.Character, 0x3E800000);
                        break;
                    case 1:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@brave", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                    case 2:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@confident", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                    case 3:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@drunk@verydrunk", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                    case 4:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@fat@a", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                    case 5:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@shadyped@a", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                    case 6:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@hurry@a", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                    case 7:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@injured", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                    case 8:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@intimidation@1h", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                    case 9:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@quick", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                    case 10:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@sad@a", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                    case 11:
                        Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, Game.Player.Character, "move_m@tool_belt@a", 0x3E800000);
                        Game.Player.Character.Task.ClearAll();
                        break;
                }
            }

            if (listItem == PlayerMoodItem)
            {
                switch (newIndex)
                {
                    case 0:
                        Function.Call(Hash.CLEAR_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character);
                        break;
                    case 1:
                        Function.Call(Hash.SET_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character, "mood_normal_1", 0);
                        break;
                    case 2:
                        Function.Call(Hash.SET_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character, "mood_happy_1", 0);
                        break;
                    case 3:
                        Function.Call(Hash.SET_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character, "Mood_Angry_1", 0);
                        break;
                    case 4:
                        Function.Call(Hash.SET_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character, "Mood_Injured_1", 0);
                        break;
                    case 5:
                        Function.Call(Hash.SET_FACIAL_IDLE_ANIM_OVERRIDE, Game.Player.Character, "Mood_Stressed_1", 0);
                        break;
                }
            }

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

        var menu = new AmmoMenu();
        var ammoItem = new UIMenuItem("Ammo");
        InventoryMenu.AddItem(ammoItem);
        InventoryMenu.BindMenuToItem(menu, ammoItem);
        MenuPool.Add(menu);

        MainMenu.RefreshIndex();
        InventoryMenu.RefreshIndex();
    }
Пример #3
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);
    }
Пример #4
0
 public GameMenu()
 {
     mainMenu = new UIMenu("Air Superiority", "BETA");
     var menuItem = new UIMenuItem("~g~Start Script");
     menuItem.Activated += (x, y) => { GameManager.InitializeScript(); menuPool.CloseAllMenus(); };
     mainMenu.AddItem(menuItem);
     menuItem = new UIMenuItem("~r~Stop Script");
     menuItem.Activated += (x, y) => GameManager.StopScript();
     mainMenu.AddItem(menuItem);
     menuItem = new UIMenuItem("Unlocks (coming soon)");
     menuItem.Enabled = false;
     mainMenu.AddItem(menuItem);
     menuItem = new UIMenuItem("View Stats");
     mainMenu.AddItem(menuItem);
     statsMenu = new UIMenu("Player Stats", Game.Player.Name);
     menuItem = new UIMenuItem("Load Stats");
     menuItem.Activated += (x, y) => LoadStatsMenu();
     statsMenu.AddItem(menuItem);
     menuItem = new UIMenuItem("Player Kills: --");
     menuItem.Enabled = false;
     statsMenu.AddItem(menuItem);
     menuItem = new UIMenuItem("Player Deaths: --");
     menuItem.Enabled = false;
     statsMenu.AddItem(menuItem);
     menuItem = new UIMenuItem("Total Score: --");
     menuItem.Enabled = false;
     statsMenu.AddItem(menuItem);
     mainMenu.BindMenuToItem(statsMenu, mainMenu.MenuItems[3]);
     mainMenu.OnItemSelect += MainMenu_OnItemSelect;
     mainMenu.RefreshIndex();
     menuPool = new MenuPool();
     menuPool.Add(mainMenu);
     menuPool.Add(statsMenu);
     KeyDown += KeyPressed;
     Tick += OnTick;
 }
Пример #5
0
        public CommunityRaces()
	    {
		    Tick += OnTick;
		    int racesLoaded = LoadRaces();

			_quitMenu = new UIMenu("", "~r~ARE YOU SURE YOU WANT TO QUIT?", new Point(0, -107));
			var qitem = new UIMenuItem("Quit current race.");
			qitem.Activated += (item, index) =>
			{
				if (_currentRace == null) return;
				_quitMenu.Visible = false;
				Game.FadeScreenOut(500);
				Wait(1000);
				Game.Player.Character.Position = _currentRace.Trigger;
				EndRace();
				Game.FadeScreenIn(500);
			};
            _quitMenu.AddItem(qitem);
			var citem = new UIMenuItem("Cancel.");
			citem.Activated += (item, index) =>
			{
				_quitMenu.Visible = false;
			};
            _quitMenu.AddItem(citem);
			_quitMenu.RefreshIndex();
			_quitMenu.SetBannerType(new UIResRectangle());

		    foreach (Race race in _races)
		    {
			    var tmpBlip = World.CreateBlip(race.Trigger);
			    tmpBlip.IsShortRange = true;
				tmpBlip.Sprite = BlipSprite.Race;
		    }
		    UI.Notify("~b~~h~Community Races~h~~n~~w~Loaded ~b~" + racesLoaded + "~w~ race(s).");

		    if (File.Exists("scripts\\MapEditor.dll"))
				AttachMapEditor();
	    }
Пример #6
0
        private UIMenu route_menu()
        {
            rm = new UIMenu("", "GTAV BUS MOD");
            menu_p.Add(rm);
            List<dynamic> route_names = _get_routes_name();
            var start_but = new UIMenuItem("Start", "Click to start route.");
            rm.AddItem(start_but);
            var _routes_list = new UIMenuListItem("Routes List", route_names, 0, "Choose route");
            rm.AddItem(_routes_list);
            var _cancel = new UIMenuItem("Cancel", "Cancel current route");
            _cancel.Enabled = false;
            rm.AddItem(_cancel);

            if(__lock)
            {
                start_but.Enabled = false;
                _routes_list.Enabled = false;
                _cancel.Enabled = true;

            }
            rm.SetBannerType("scripts\\bus_mod.png");
            rm.OnItemSelect += OnItemSelect;
            rm.OnListChange += OnListChange;
            rm.RefreshIndex();
            return rm;
        }
Пример #7
0
        //menu
        private UIMenu mis_menu()
        {
            mi_menu = new UIMenu("", "GTAV BUS MOD");
            menu_p.Add(mi_menu);
            List<dynamic> mission_name = _get_mission_name();
            var start_but = new UIMenuItem("Start", "Click to start mission.");
            mi_menu.AddItem(start_but);
            var _mission_list = new UIMenuListItem("Missions List", mission_name, 0, "Choose mission");
            mi_menu.AddItem(_mission_list);
            var _cancel = new UIMenuItem("Cancel", "Cancel current mission");
            _cancel.Enabled = false;
            mi_menu.AddItem(_cancel);

            if (_lock)
            {
                start_but.Enabled = false;
                _mission_list.Enabled = false;
                _cancel.Enabled = true;

            }
            mi_menu.SetBannerType("scripts\\bus_mod.png");
            mi_menu.OnItemSelect += OnItemSelect;
            mi_menu.OnListChange += OnListChange;
            mi_menu.RefreshIndex();
            return mi_menu;
        }
Пример #8
0
        private UIMenu main_menu()
        {
            main_m = new UIMenu("", "GTAV BUS MOD");
            menu_p.Add(main_m);
            var mission_ = new UIMenuItem("Mission mod", "Click to start mission mod");
            main_m.AddItem(mission_);
            var routes_ = new UIMenuItem("Routes mod", "Click to start routes mod");
            main_m.AddItem(routes_);
            main_m.SetBannerType("scripts\\bus_mod.png");

            main_m.Visible = !main_m.Visible;
            main_m.OnItemSelect += OnItemSelect;
            main_m.BindMenuToItem(mis_menu(), mission_);
            main_m.BindMenuToItem(route_menu(), routes_);
            main_m.RefreshIndex();
            return main_m;
        }
Пример #9
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);
            }
        }
Пример #10
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();
		}
Пример #11
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);
	    }
Пример #12
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);
	    }
Пример #13
0
	    private void CreateDeadzoneMenu()
	    {
	        DeadzoneMenu = new UIMenu("Tobii Eye Tracking", "~b~FREELOOK DEADZONES");
	        DeadzoneMenu.SetMenuWidthOffset(50);
	            
	        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);
	    }
Пример #14
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);
        }
Пример #15
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();
        }
Пример #16
0
 // main function
 public Drag_Race()
 {
     var cars = new List<dynamic>
     {
         "Buffalo",
         "Bullet",
         "Adder",
         "Zentorno",
         "Banshee",
         "B-Type",
         "BATI",
         "Entity XF",
     };
     ParseSettings();
     Tick += OnTick;
     KeyDown += OnKeyDown;
     Interval = 1;
     mainMenu = new UIMenu("Drag Race", "~g~Main Menu");
     startOne = new UIMenuItem("Start Race: One!", "Starts race 1, the coordinates are changeable in the ini. \nX: " + custom1x + "\nY: " + custom1y + "\nZ: " + custom1z);
     startTwo = new UIMenuItem("Start Race: Two!", "Starts race 2, the coordinates are changeable in the ini. \nX: " + custom2x + "\nY: " + custom2y + "\nZ: " + custom2z);
     startThree = new UIMenuItem("Start Race: Custom Race!", "Starts race 3, ONLY USE IF YOU'VE CHANGED THE INI");
     startFour = new UIMenuItem("Start Race: Waypoint", "Starts waypoint race, will only start if you have a waypoint set.");
     carSel = new UIMenuListItem("Car", cars, 0, "Select your car.");
     mainMenu.AddItem(startOne);
     mainMenu.AddItem(startTwo);
     mainMenu.AddItem(startThree);
     mainMenu.AddItem(startFour);
     mainMenu.AddItem(carSel);
     mainMenu.RefreshIndex();
     menuPool.Add(mainMenu);
     mainMenu.OnItemSelect += ItemSelectHandler;
     mainMenu.OnListChange += OnListChange;
 }