private static InstructionalButton buttonCancelEvent = new InstructionalButton(Controls.TertiaryAction, Text.buttonCancelEvent); // Creating the Cancel Event button public Controller() { Tracks.AddTracks(); // Adding all tracks Collections.AddCollections(); // Adding all collections Intensities.AddIntensities(); // Adding all intensities controllerMenuPool = new MenuPool(); #if DLCPACK controllerMain = new UIMenu("", Text.controllerSubtitle); // With custom banner #else controllerMain = new UIMenu(Text.controllerTitle, Text.controllerSubtitle); // Without custom banner #endif #if DEBUG testingMain = new UIMenu("Testing", "TESTING OPTIONS"); // #DEBUG #endif controllerMain.AddItem(mainScoreCollection = new UIMenuListItem(Text.mainScoreCollectionTitle, Collections.scoreCollections, 0, Text.mainScoreCollectionDescr)); controllerMain.AddItem(mainScoreTrack = new UIMenuListItem(Text.mainScoreTrackTitle, Tracks.scoreLists[0], 0, Text.mainScoreTrackDescr)); controllerMain.AddItem(mainScoreIntensity = new UIMenuListItem(Text.mainScoreIntensityTitle, Intensities.listIntensities, 0, Text.mainScoreIntensityDescr)); controllerMain.AddItem(mainMuteSound = new UIMenuCheckboxItem(Text.mainMuteSoundTitle, false, Text.mainMuteSoundDescr)); controllerMain.AddItem(mainMuteRadio = new UIMenuCheckboxItem(Text.mainMuteRadioTitle, false, Text.mainMuteRadioDescr)); controllerMain.AddItem(mainDisableWanted = new UIMenuCheckboxItem(Text.mainDisableWantedTitle, false, Text.mainDisableWantedDescr)); controllerMain.AddItem(mainDisableFlight = new UIMenuCheckboxItem(Text.mainDisableFlightTitle, false, Text.mainDisableFlightDescr)); controllerMain.AddItem(mainDisableOnDeath = new UIMenuCheckboxItem(Text.mainDisableOnDeathTitle, true, Text.mainDisableOnDeathDescr)); #if DEBUG controllerMain.AddItem(mainCustomEvent = new UIMenuItem(Text.mainCustomEventTitle, Text.mainCustomEventDescr)); // #DEBUG // controllerMain.AddItem(mainCustomScene = new UIMenuItem(Text.mainCustomSceneTitle, Text.mainCustomSceneDescr)); #DEBUG controllerMain.AddItem(mainTesting = new UIMenuItem("Testing", "Testing stuff.")); // #DEBUG testingMain.AddItem(testingFinaleTrack = new UIMenuItem("Trigger CH Finale Track", "Testing stuff.")); // #DEBUG #endif #if DLCPACK controllerMain.SetBannerType(bannerScoreController); // Adding the banner #endif controllerMain.AddInstructionalButton(buttonStopScore); // Adding the Stop Score button #if DEBUG controllerMain.AddInstructionalButton(buttonCancelEvent); // Adding the Cancel event button #DEBUG #endif controllerMenuPool.Add(controllerMain); #if DEBUG controllerMenuPool.Add(testingMain); // #DEBUG #endif Tick += OnTick; KeyDown += OnKeyDown; controllerMain.OnIndexChange += OnIndexChange; controllerMain.OnItemSelect += OnItemSelect; controllerMain.OnListChange += ListChangeHandler; controllerMain.OnCheckboxChange += OnCheckboxChange; WarningMessage.OnWarningMessage += OnWarningMessage; controllerMain.RefreshIndex(); #if DEBUG testingMain.OnItemSelect += OnItemSelect; // #DEBUG #endif }
public void LoadMenus() { InventoryMenu = new NativeUI.UIMenu("Inventory", "SELECT AN ITEM"); ResourceMenu = new NativeUI.UIMenu("Resources", "SELECT AN ITEM"); AddItemsToMenu(InventoryMenu, Items, ItemType.Item); AddItemsToMenu(ResourceMenu, Resources, ItemType.Resource); MenuConrtoller.MenuPool.Add(InventoryMenu); MenuConrtoller.MenuPool.Add(ResourceMenu); RefreshMenu(); InventoryMenu.RefreshIndex(); ResourceMenu.RefreshIndex(); if (MenuType == MenuType.Player) { InventoryMenu.AddInstructionalButton(new InstructionalButton(GTA.Control.Enter, "Blueprint")); InventoryMenu.AddInstructionalButton(new InstructionalButton(GTA.Control.LookBehind, "Craft")); } }
/// <summary> /// Setting up the menu. /// </summary> private void Setup() { noclipMenu = new UIMenu("No Clip", "Controls", true) { MouseControlsEnabled = false, MouseEdgeEnabled = false, ControlDisablingEnabled = false, ScaleWithSafezone = false }; noclipMenu.SetMenuWidthOffset(50); UIMenuItem speed = new UIMenuItem("Current Moving Speed", "This is your current moving speed."); speed.SetRightLabel(speeds[currentSpeed]); noclipMenu.AddItem(speed); noclipMenu.DisableInstructionalButtons(true); noclipMenu.DisableInstructionalButtons(false); // Only disable the default instructional buttons (back & select) (requires modified NativeUI build.) noclipMenu.DisableInstructionalButtons(false, disableDefaultButtons: true); noclipMenu.AddInstructionalButton(new InstructionalButton(Control.Sprint, "Change Speed")); noclipMenu.AddInstructionalButton(new InstructionalButton(Control.MoveUpDown, "Go Forwards/Backwards")); noclipMenu.AddInstructionalButton(new InstructionalButton(Control.MoveLeftRight, "Turn Left/Right")); noclipMenu.AddInstructionalButton(new InstructionalButton(Control.Cover, "Go Up")); noclipMenu.AddInstructionalButton(new InstructionalButton(Control.MultiplayerInfo, "Go Down")); MainMenu.Mp.Add(noclipMenu); setupDone = true; }
public static void initMainMenu() { current_item = "Bolingbroke"; // The current item of the list of police stations is updated to Bolingbroke, this fixes a bug where upon first loading the plugin, a user // Would have to switch to a different location before being able to teleport back to Bolingbroke. GoMenu = new UIMenu("GoThere", "~b~LET'S MOVE!"); StationList = new UIMenuListItem("~g~List of Stations: ", "", "Bolingbroke", "Davis", "Downtown Vinewood", "La Mesa", "LSIA", "Mission Row", "Paleto Bay", "Rockford Hills", "Sandy Shores", "Vespucci", "Vinewood Hills"); menu_pool = new MenuPool(); MenuProcessFiber = new GameFiber(ProcessLoop); menu_pool.Add(GoMenu); // Add our menu to the menu pool GoMenu.AddItem(StationList); // Add a list of destinations -- maybe we want to hold destination OBJECTS. We shall see. GoMenu.OnItemSelect += OnItemSelect; GoMenu.OnListChange += OnListChange; if (customLocationsEnabled) // If custom locations are enabled { navigateToLocMenu = new UIMenuItem("Custom Locations"); LocMenu = new UIMenu("Custom Locations", "Teleport to custom locations."); // Initialize the locations menu menu_pool.Add(LocMenu); // Add the locations menu to the menu pool GoMenu.AddItem(navigateToLocMenu); // Add the ui item to the main menu GoMenu.BindMenuToItem(LocMenu, navigateToLocMenu); // Bind the locations menu to the ui item LocMenu.ParentMenu = GoMenu; // Set the parent menu of the locations menu to be the main menu InstructionalButton removeButtonKeyButton = new InstructionalButton(removeKey.ToString(), "Remove Destination"); // Add instructional button showing users how to remove a dest. LocMenu.AddInstructionalButton(removeButtonKeyButton); RefreshCustomLocationsMenu(); } GoMenu.RefreshIndex(); // Set the index at 0 by using the RefreshIndex method MenuProcessFiber.Start(); // Start process fiber Game.DisplayNotification("~r~[GoThere] \nGoThere v1.0 ~w~by ~b~Cavasi ~w~has loaded successfully!"); // Display a notification above the radar that the plugin loaded successfully GameFiber.Hibernate(); // Continue with our plugin. Prevent it from being unloaded }
public Main() { _menu = new UIMenu("BepMod", "~b~Bicycle Experiment Program"); _menu.AddItem(new UIMenuItem("Spawn bicycle", "You know you want it!")); _menu.AddItem(new UIMenuItem("Load scenario", "Example scenario")); _menu.AddItem(new UIMenuCheckboxItem("Remove traffic", false, "All except for your bike")); _menu.AddItem(new UIMenuCheckboxItem("Hide radar and HUD", false, "For the full immersive experience")); _menu.RefreshIndex(); _menu.OnItemSelect += _menu_OnItemSelect; _menu.OnCheckboxChange += _menu_OnCheckboxChange; _menuPool.Add(_menu); UI.Notify("For the Bicycle Experiment Program press ~b~B"); _button = new InstructionalButton("B", "Bicycle Experiment Program"); _menu.AddInstructionalButton(_button); KeyDown += Main_KeyDown; Tick += Main_Tick; }
public Main() { Log("Main.Main()"); _logger = new Logger(_smartEye); scenarios.Add(new Scenario1()); // scenarios.Add(new Scenario2()); menu = new UIMenu("BepMod", ""); foreach (Scenario scenario in scenarios) { scenariosCount++; UIMenu scenarioSubMenu = menuPool.AddSubMenu( menu, String.Format("Scenario {0}", scenariosCount.ToString()) ); scenarioSubMenu.AddItem(new UIMenuItem( "Run", "" )); int pointIndex = 0; int scenarioIndex = scenariosCount - 1; scenarioSubMenu.OnItemSelect += (UIMenu sender, UIMenuItem item, int index) => { Log("Dingen: " + index.ToString()); if (index == 0) { RunScenario(scenarioIndex); menu.Visible = false; scenarioSubMenu.Visible = false; } }; var pointsList = new List <dynamic> { }; for (int i = 0; i < scenario.Points.Length; i++) { pointsList.Add(String.Format("Point {0}", i)); } UIMenuListItem pointMenuListItem = new UIMenuListItem("Teleport", pointsList, 0); scenarioSubMenu.AddItem(pointMenuListItem); scenarioSubMenu.OnItemSelect += (sender, item, index) => { if (index == 1) { Vector3 position = scenario.Points[pointIndex]; UI.Notify("Teleport to: " + position.ToString()); Game.Player.Character.Position = position; } }; scenarioSubMenu.OnListChange += (sender, item, index) => { if (item == pointMenuListItem) { pointIndex = index; } }; } Log("Loaded " + scenariosCount.ToString() + " scenario(s)"); menu.AddItem(new UIMenuItem("Stop running scenario", "")); var debugLevels = new List <dynamic> { "None", "Gaze", "Info", "Verbose", "Full" }; UIMenuListItem debugLevelMenuItem = new UIMenuListItem("Debug level", debugLevels, debugLevel); menu.AddItem(debugLevelMenuItem); menu.OnListChange += (sender, item, index) => { if (item == debugLevelMenuItem) { debugLevel = index; ClearMessages(); } }; menu.RefreshIndex(); menu.OnItemSelect += Menu_OnItemSelect; menu.OnCheckboxChange += Menu_OnCheckboxChange; menuPool.Add(menu); UI.Notify("For the Bicycle Experiment Program press ~b~B"); menu.AddInstructionalButton(new InstructionalButton("B", "BepMod menu")); menu.AddInstructionalButton(new InstructionalButton("N", "Save location")); menu.AddInstructionalButton(new InstructionalButton("I", "Load scenario")); KeyDown += DoKeyDown; Tick += MainTick; Aborted += MainAborted; Game.Player.Character.IsInvincible = true; if (Game.IsScreenFadedOut) { Game.FadeScreenIn(0); } }