private void OpenWorldMenu() { var menuItems = new List<IMenuItem>(); var toggle = new MenuToggle("Blackout", "GTAV_DAWGS", isonblackout); toggle.Changed += (sender, args) => { var tg = sender as MenuToggle; if (tg == null) { return; } isonblackout = tg.Value; Blackout(tg.Value); }; menuItems.Add(toggle); toggle = new MenuToggle("Stop Time", "TODO: Add smth here", timestopped); toggle.Changed += (sender, args) => { var tg = sender as MenuToggle; if (tg == null) { return; } timestopped = tg.Value; Stoptime(tg.Value); }; menuItems.Add(toggle); //MenuNumericScroller var text = new MenuLabel("Time: " + World.CurrentDayTime.Hours + ":" + World.CurrentDayTime.Minutes, false); menuItems.Add(text); //TODO: MAKE THIS UPDATE var button = new MenuButton("+1 hour", "time flies yo"); button.Activated += (sender, args) => Function.Call(Hash.ADD_TO_CLOCK_TIME, 1, 0, 0); menuItems.Add(button); button = new MenuButton("-1 hour", "time flies yo"); button.Activated += (sender, args) => Function.Call(Hash.ADD_TO_CLOCK_TIME, -1, 0, 0); menuItems.Add(button); button = new MenuButton("Destroy Cameras", "ezpz heists (untested)"); button.Activated += (sender, args) => GTA.World.DestroyAllCameras(); menuItems.Add(button); button = new MenuButton("Weather: Clean", "Watch dem clouds"); button.Activated += (sender, args) => this.setweather(Weather.Clear); menuItems.Add(button); button = new MenuButton("Weather: ExtraSunny", "Watch dem clouds"); button.Activated += (sender, args) => this.setweather(Weather.ExtraSunny); menuItems.Add(button); button = new MenuButton("Weather: Christmas", "Watch dem clouds"); button.Activated += (sender, args) => this.setweather(Weather.Christmas); menuItems.Add(button); button = new MenuButton("Weather: Snow", "Watch dem clouds"); button.Activated += (sender, args) => this.setweather(Weather.Snowing); menuItems.Add(button); button = new MenuButton("Weather: Rain", "Watch dem clouds"); button.Activated += (sender, args) => this.setweather(Weather.Raining); menuItems.Add(button); button = new MenuButton("Weather: Blizzard", "Watch dem clouds"); button.Activated += (sender, args) => this.setweather(Weather.Blizzard); menuItems.Add(button); button = new MenuButton("Weather: ThunderStorm", "Watch dem clouds"); button.Activated += (sender, args) => this.setweather(Weather.ThunderStorm); menuItems.Add(button); var numerogg = new MenuNumericScroller(("Gravity Level"), "0 is normal, 3 is fly", 0, 3, 1, grav); numerogg.Changed += numerogg_Changed; menuItems.Add(numerogg); //button = new MenuButton("Goto Mission Marker" + GTA.World.GetActiveBlips().Length, "ezpz races"); //button.Activated += (sender, args) => this.GotoMissionMarker2(); //menuItems.Add(button); this.View.AddMenu(new Menu("World Menu", menuItems.ToArray())); }
internal static void SetWantedLevel(MenuNumericScroller sender) { WantedLevel = (int) sender.Value; }
private void OpenVehicleMenu(Vehicle veh) { var menuItems = new List<IMenuItem>(); curveh = veh; List<VehicleColor> colorlist = new List<VehicleColor>(); colorlist.AddRange((IEnumerable<VehicleColor>)Enum.GetValues(typeof(VehicleColor))); List<string> colornamelist = new List<string>(); int clrno = 1; int prlno = 1; int crntno = 0; foreach (VehicleColor clr in colorlist) { crntno++; if (veh.PrimaryColor.ToString() == clr.ToString()) { clrno = crntno; } if (veh.PearlescentColor.ToString() == clr.ToString()) { prlno = crntno; } colornamelist.Add(clr.ToString()); } var enumm = new MenuEnumScroller("Color", "Chrome, Epsilon, we have all", colornamelist.ToArray(), (clrno - 1)); enumm.Activated += enumm_Activated; menuItems.Add(enumm); var enumm2 = new MenuEnumScroller("Pearlescent", "Chrome, Epsilon, we have all", colornamelist.ToArray(), (prlno - 1)); enumm2.Activated += enumm2_Activated; menuItems.Add(enumm2); var button = new MenuButton("RGB car primary color", "First r, then g and then b"); button.Activated += (sender, args) => this.rgbcarprimcolor(veh); menuItems.Add(button); button = new MenuButton("RGB car secondary color", "First r, then g and then b"); button.Activated += (sender, args) => this.rgbcarseccolor(veh); menuItems.Add(button); button = new MenuButton("HEX car primary color", "Just hex like ff00ff"); button.Activated += (sender, args) => this.hexcarprimcolor(veh); menuItems.Add(button); button = new MenuButton("HEX car secondary color", "Just hex like ff00ff"); button.Activated += (sender, args) => this.hexcarseccolor(veh); menuItems.Add(button); button = new MenuButton("Clear car custom colors", ""); button.Activated += (sender, args) => this.rgbcarclean(veh); menuItems.Add(button); //button = new MenuButton("Save Car To file", "ex input: idkrly.txt"); //button.Activated += (sender, args) => this.SaveCarToFile(veh, Game.GetUserInput(26)); //menuItems.Add(button); //http://i1.kym-cdn.com/photos/images/newsfeed/000/232/114/e39.png //button = new MenuButton("Load Car From file", "ex input: idkrly.txt"); //button.Activated += (sender, args) => this.LoadCarFromFile(Game.GetUserInput(26)); //menuItems.Add(button); button = new MenuButton("Open All Doors", "titan ftw"); button.Activated += (sender, args) => this.Dooropen(veh); menuItems.Add(button); button = new MenuButton("Close All Doors", "titan ftw"); button.Activated += (sender, args) => this.Doorclose(veh); menuItems.Add(button); button = new MenuButton("Change Plate", "SWAGYOLO ftw"); button.Activated += (sender, args) => this.changeplate(veh); menuItems.Add(button); button = new MenuButton("Change Plate Type", "YANKTOOOOOOON"); button.Activated += (sender, args) => this.changeplatetype(veh); menuItems.Add(button); var numero = new MenuNumericScroller("Light multiplier", "", 1, 1001, 10); numero.Changed += numero_Changed; menuItems.Add(numero); var numero2 = new MenuNumericScroller("Speed multiplier", "", 1, 1001, 10); numero2.Changed += numero2_Changed; menuItems.Add(numero2); button = new MenuButton("Pimp My Ride", "Nice Wheels m8"); button.Activated += (sender, args) => this.pimpmyride(veh); menuItems.Add(button); button = new MenuButton("Depimp My Ride", "n00b Wheels m8"); button.Activated += (sender, args) => this.depimpmyride(veh); menuItems.Add(button); button = new MenuButton("Fix Dem Ride", "nice n clean"); button.Activated += (sender, args) => this.FixRide(veh); menuItems.Add(button); button = new MenuButton("Fix & God Dem Ride", "Dem wheels is broken"); button.Activated += (sender, args) => this.FixGodRide(veh); menuItems.Add(button); button = new MenuButton("RC Menu", "BTTF"); button.Activated += (sender, args) => this.OpenVehicleRCMenu(veh); menuItems.Add(button); button = new MenuButton("TP Menu", "Bzzzt"); button.Activated += (sender, args) => this.OpenVehicleTPMenu(veh); menuItems.Add(button); if (veh.FriendlyName.Length > 7) { this.View.AddMenu(new Menu(("Vehicle Menu (" + veh.FriendlyName.Substring(0, 7) + ")"), menuItems.ToArray())); } else { this.View.AddMenu(new Menu(("Vehicle Menu (" + veh.FriendlyName + ")"), menuItems.ToArray())); } }
//TODO: Animations private void OpenVehicleRCMenu(Vehicle veh) { var menuItems = new List<IMenuItem>(); var button = new MenuButton("Explode", "BOOOM"); button.Activated += (sender, args) => this.ExplodeVehicle(veh); menuItems.Add(button); var numero3 = new MenuNumericScroller("RC: Forward", "BTTF IS REAL", 1, 1001, 10); numero3.Activated += numero3_Changed; menuItems.Add(numero3); button = new MenuButton("RC: Stop", "BTTF IS REAL"); button.Activated += (sender, args) => car_go(veh, 0f); menuItems.Add(button); var numero4 = new MenuNumericScroller("RC: Use Horn", "DOOOOOOOOOOOOOOOT", 1000, 100000, 1000); numero4.Activated += numero4_Changed; menuItems.Add(numero4); var togglee = new MenuToggle("RC: Control Engine", "FTTF FTW", veh.EngineRunning); togglee.Changed += (sender, args) => { var tg = sender as MenuToggle; if (tg == null) { return; } veh.EngineRunning = tg.Value; veh.LightsOn = tg.Value; }; menuItems.Add(togglee); if (veh.FriendlyName.Length > 6) { this.View.AddMenu(new Menu(("Vehicle RC Menu (" + veh.FriendlyName.Substring(0, 6) + ")"), menuItems.ToArray())); } else { this.View.AddMenu(new Menu(("Vehicle RC Menu (" + veh.FriendlyName + ")"), menuItems.ToArray())); } }
private void OpenVehicleMarkMenu() { var menuItems = new List<IMenuItem>(); var text = (markedvehicle != null) ? new MenuLabel(("Marked Vehicle: " + markedvehicle.FriendlyName), true) : new MenuLabel(("Marked Vehicle: None"), true); menuItems.Add(text); if (Game.Player.Character.IsInVehicle()) { var button = new MenuButton("Mark the vehicle I'm in", (Game.Player.Character.CurrentVehicle.FriendlyName)); button.Activated += (sender, args) => this.MarkVehicleImIn(); menuItems.Add(button); } else { text = new MenuLabel("You are not in a Vehicle"); menuItems.Add(text); } var toggle = new MenuToggle("Use markgun", "Just aim at a vehicle", markgun); toggle.Changed += (sender, args) => { var tg = sender as MenuToggle; if (tg == null) { return; } markgun = tg.Value; }; menuItems.Add(toggle); if (Game.Player.LastVehicle != null || Game.Player.LastVehicle.FriendlyName != "NULL") { var button = new MenuButton("Mark my last vehicle", Game.Player.LastVehicle.FriendlyName); button.Activated += (sender, args) => this.MarkLastVehicle(); menuItems.Add(button); } else { text = new MenuLabel("You weren't in a Vehicle"); menuItems.Add(text); } if (markedvehicle != null && markedvehicle.Exists()) { var button = new MenuButton("Unmark", ""); button.Activated += (sender, args) => this.UnMark(); menuItems.Add(button); } else { markedvehicle = null; if (curmark == 1) { markedvehicle1 = markedvehicle; } else if (curmark == 2) { markedvehicle2 = markedvehicle; } else if (curmark == 3) { markedvehicle3 = markedvehicle; } } if (markedvehicle1 != null && markedvehicle1.FriendlyName != "NULL" && markedvehicle1.Exists()) { var button = new MenuButton("Open Marked Menu 1", ""); button.Activated += (sender, args) => this.OpenVehicleMenu(markedvehicle1); menuItems.Add(button); Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, (Entity)markedvehicle1, true); } else { markedvehicle1 = null; } if (markedvehicle2 != null && markedvehicle2.FriendlyName != "NULL" && markedvehicle2.Exists()) { var button = new MenuButton("Open Marked Menu 2", ""); button.Activated += (sender, args) => this.OpenVehicleMenu(markedvehicle2); menuItems.Add(button); Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, (Entity)markedvehicle2, true); } else { markedvehicle2 = null; } if (markedvehicle3 != null && markedvehicle3.FriendlyName != "NULL" && markedvehicle3.Exists()) { var button = new MenuButton("Open Marked Menu 3", ""); button.Activated += (sender, args) => this.OpenVehicleMenu(markedvehicle3); menuItems.Add(button); Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, (Entity)markedvehicle3, true); } else { markedvehicle3 = null; } var numero = new MenuNumericScroller(("Switch Marked Vehicle"), "", 1, 3, 1, (curmark - 1)); numero.Changed += numero_Activated; menuItems.Add(numero); Markmenu = new Menu("(Vehicle) Mark Menu", menuItems.ToArray()); this.View.AddMenu(Markmenu); }
private void OpenPedMarkMenu() { var menuItems = new List<IMenuItem>(); //TODO: Shoot with explosions of the selected ped var toggle = new MenuToggle("Use markgun", "Just aim at a ped", markgunped); toggle.Changed += (sender, args) => { var tg = sender as MenuToggle; if (tg == null) { return; } markgunped = tg.Value; }; menuItems.Add(toggle); if (markedped != null && markedped.Exists() && markedped.IsAlive) { var button = new MenuButton("Unmark", ""); button.Activated += (sender, args) => this.UnMark(); menuItems.Add(button); button = new MenuButton("Set as Framed Ped", "Go to weapon menu to activate"); button.Activated += (sender, args) => this.FramePed(); menuItems.Add(button); } else { markedped = null; if (curmarkped == 1) { markedped1 = markedped; } else if (curmarkped == 2) { markedped2 = markedped; } else if (curmarkped == 3) { markedped3 = markedped; } } if (markedped1 != null && markedped1.Exists() && markedped1.IsAlive) { var button = new MenuButton("Open Marked Menu 1", ""); button.Activated += (sender, args) => this.OpenPlayerMenu(markedped1); menuItems.Add(button); Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, (Entity)markedped1, true); } else { markedped1 = null; } if (markedped2 != null && markedped2.Exists() && markedped2.IsAlive) { var button = new MenuButton("Open Marked Menu 2", ""); button.Activated += (sender, args) => this.OpenPlayerMenu(markedped2); menuItems.Add(button); Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, (Entity)markedped2, true); } else { markedped2 = null; } if (markedped3 != null && markedped3.Exists() && markedped3.IsAlive) { var button = new MenuButton("Open Marked Menu 3", ""); button.Activated += (sender, args) => this.OpenPlayerMenu(markedped3); menuItems.Add(button); Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, (Entity)markedped3, true); } else { markedped3 = null; } var numerog = new MenuNumericScroller(("Switch Marked Ped"), "", 1, 3, 1, (curmarkped - 1)); numerog.Changed += numerog_Changed; menuItems.Add(numerog); Markmenu = new Menu("(Ped) Mark Menu", menuItems.ToArray()); this.View.AddMenu(Markmenu); }
public static MenuNumericScroller WithNumericActions(this MenuNumericScroller numScroller, Action <double> changeAction, Action <double> activateAction) { numScroller.Changed += (sender, args) => changeAction.Invoke(numScroller.Value); numScroller.Activated += (sender, args) => activateAction.Invoke(numScroller.Value); return(numScroller); }
internal static void SetWantedLevel(MenuNumericScroller sender) { WantedLevel = (int)sender.Value; }
private void SublimePlayerMenu() { List <IMenuItem> playerMenuItems = new List <IMenuItem>(); var buttonTeleport = new MenuButton("Teleport Menu"); buttonTeleport.Activated += (sender, args) => SublimeTeleportMenu(); playerMenuItems.Add(buttonTeleport); var buttonFixPlayer = new MenuButton("Fix Player"); buttonFixPlayer.Activated += (sender, args) => PlayerFunctions.FixPlayer(); playerMenuItems.Add(buttonFixPlayer); var buttonSetMoney = new MenuButton("Set Money"); buttonSetMoney.Activated += (sender, args) => PlayerFunctions.SetMoney(); playerMenuItems.Add(buttonSetMoney); var buttonAddMoney = new MenuButton("Add Money"); buttonAddMoney.Activated += (sender, args) => PlayerFunctions.AddMoney(); playerMenuItems.Add(buttonAddMoney); var numericWantedLevel = new MenuNumericScroller("Set Wanted Level", "", 0.0f, 5.0f, 1.0f, PlayerFunctions.WantedLevel); numericWantedLevel.Changed += (sender, args) => PlayerFunctions.SetWantedLevel(numericWantedLevel); playerMenuItems.Add(numericWantedLevel); var toggleNeverWanted = new MenuToggle("Never Wanted", "", PlayerFunctions.IsPlayerNeverWanted); toggleNeverWanted.Changed += (sender, args) => PlayerFunctions.ToggleNeverWanted(); playerMenuItems.Add(toggleNeverWanted); var toggleInvincible = new MenuToggle("Invincible", "", PlayerFunctions.IsPlayerInvincible); toggleInvincible.Changed += (sender, args) => PlayerFunctions.ToggleInvincibility(); playerMenuItems.Add(toggleInvincible); var toggleSuperJump = new MenuToggle("Super Jump", "", PlayerFunctions.CanPlayerSuperJump); toggleSuperJump.Changed += (sender, args) => PlayerFunctions.ToggleSuperJump(); playerMenuItems.Add(toggleSuperJump); var toggleFastRun = new MenuToggle("Fast Run", "", PlayerFunctions.CanPlayerFastRun); toggleFastRun.Changed += (sender, args) => PlayerFunctions.ToggleFastRun(); playerMenuItems.Add(toggleFastRun); var toggleFastSwim = new MenuToggle("Fast Swim", "", PlayerFunctions.CanPlayerFastSwim); toggleFastSwim.Changed += (sender, args) => PlayerFunctions.ToggleFastSwim(); playerMenuItems.Add(toggleFastSwim); var toggleNoNoise = new MenuToggle("No Noise", "", PlayerFunctions.IsPlayerNoiseless); toggleNoNoise.Changed += (sender, args) => PlayerFunctions.ToggleNoNoise(); playerMenuItems.Add(toggleNoNoise); var toggleUnlimitedStamina = new MenuToggle("Unlimited Stamina", "", PlayerFunctions.HasPlayerUnlimitedStamina); toggleUnlimitedStamina.Changed += (sender, args) => PlayerFunctions.ToggleUnlimitedStamina(); playerMenuItems.Add(toggleUnlimitedStamina); var toggleUnlimitedBreath = new MenuToggle("Unlimited Breath", "", PlayerFunctions.HasPlayerUnlimitedBreath); toggleUnlimitedBreath.Changed += (sender, args) => PlayerFunctions.ToggleUnlimitedBreath(); playerMenuItems.Add(toggleUnlimitedBreath); var toggleUnlimitedAbility = new MenuToggle("Unlimited Special Ability", "", PlayerFunctions.HasPlayerUnlimitedAbility); toggleUnlimitedAbility.Changed += (sender, args) => PlayerFunctions.ToggleUnlimitedAbility(); playerMenuItems.Add(toggleUnlimitedAbility); PlayerMenu = new GTA.Menu("Player Options", playerMenuItems.ToArray()); DrawMenu(PlayerMenu); }