Пример #1
0
        public static void Add_Option_HeadlightFlasher(NativeUI.UIMenu Menu)
        {
            UIMenuCheckboxItem newMenu = new UIMenuCheckboxItem("Headlight Flash on Horn", Helper.Globals.Settings.HeadlightFlasherEnabled);

            newMenu.CheckboxEvent += Option_HeadlightFlasher_OnCheckboxChange;
            Menu.AddItem(newMenu);
        }
Пример #2
0
        public SpawnMenu() : base(Game.GetLocalizedString("BTTFV_Input_SpawnMenu"), Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Description"))
        {
            AddItem(_baseType = new UIMenuListItem(Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Wormhole"), _listTypes, 0, Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Wormhole_Description")));

            AddItem(_powerSource = new UIMenuListItem(Game.GetLocalizedString("BTTFV_Input_SpawnMenu_PowerSource"), _listPowerSources, 0, Game.GetLocalizedString("BTTFV_Input_SpawnMenu_PowerSource_Description")));

            AddItem(_wheelsType = new UIMenuListItem(Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Wheel"), _listWheelTypes, 0, Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Wheel_Description")));

            AddItem(_canFly = new UIMenuCheckboxItem(Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Hover"), false, Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Hover_Description")));

            AddItem(_hoodBox = new UIMenuCheckboxItem(Game.GetLocalizedString("BTTFV_Input_SpawnMenu_ControlTubes"), false, Game.GetLocalizedString("BTTFV_Input_SpawnMenu_ControlTubes_Description")));

            AddItem(_hook = new UIMenuCheckboxItem(Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Hook"), false, Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Hook_Description")));

            AddItem(_plate = new UIMenuListItem(Game.GetLocalizedString("BTTFV_Input_SpawnMenu_LicPlate"), _listPlateTypes, 0, Game.GetLocalizedString("BTTFV_Input_SpawnMenu_LicPlate_Description")));

            AddItem(_exhaust = new UIMenuListItem(Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Exhaust"), _listExhaustTypes, 0, Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Exhaust_Description")));

            AddItem(_suspensions = new UIMenuListItem(Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Suspensions"), _listSuspensionsTypes, 0, Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Suspensions_Description")));

            AddItem(_saveConf = new UIMenuItem(Game.GetLocalizedString("BTTFV_Input_PresetsMenu_Save"), Game.GetLocalizedString("BTTFV_Input_PresetsMenu_Save_Description")));

            AddItem(_confirm = new UIMenuItem(Game.GetLocalizedString("BTTFV_Input_SpawnMenu_Confirm")));

            OnListChange     += SpawnMenu_OnListChange;
            OnCheckboxChange += SpawnMenu_OnCheckboxChange;
            OnItemSelect     += SpawnMenu_OnItemSelect;
            OnMenuOpen       += SpawnMenu_OnMenuOpen;
            OnMenuClose      += SpawnMenu_OnMenuClose;
        }
Пример #3
0
 internal override void onCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkbox, bool Checked)
 {
     if (checkbox == menu_blackout)
     {
         GTA.World.SetBlackout(menu_blackout.Checked);
     }
 }
Пример #4
0
        public void AddModMenu(UIMenu menu)
        {
            var modactivecheckbox = new UIMenuCheckboxItem("Activate Mod?", Main.Mod_Active, "Do you wish to activate the mod?");

            menu.AddItem(modactivecheckbox);

            var tipactivecheckbox = new UIMenuCheckboxItem("Give Tip?", Main.Mod_Active, "Do you wish to tip your riders for the ride?");

            menu.AddItem(tipactivecheckbox);

            menu.OnCheckboxChange += (sender, item, checked_) =>
            {
                if (item == modactivecheckbox)
                {
                    Main.Mod_Active = checked_;
                    UI.Notify("~r~" + main_menu.Mod_Name + " : ~b~" + Main.Mod_Active);
                }

                if (item == tipactivecheckbox)
                {
                    Main.Give_Tip = checked_;
                    UI.Notify("Auto Tip : ~b~" + Main.Give_Tip);
                }
            };
        }
Пример #5
0
        private void PowerWindowsControl(UIMenu mainMenu)
        {
            var newitem = new UIMenuCheckboxItem("Power windows control", false);

            mainMenu.AddItem(newitem);
            mainMenu.OnCheckboxChange += (sender, item, checked_) =>
            {
                if (item != newitem)
                {
                    return;
                }

                powerWindowsControl = checked_;

                if (!checked_)
                {
                    return;
                }
                UI.ShowSubtitle("Down/Up Front Left Window - NumPad4\n" +
                                "Down/Up Front Right Window - NumPad6\n" +
                                "Down/Up Back Left Window - NumPad7\n" +
                                "Downn/Up Back Right Window - NumPad9\n" +
                                "Down/Up All Window - NumPad5", 10000);
            };
        }
Пример #6
0
 internal override void onCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkbox, bool Checked)
 {
     if (checkbox == menu_godmode)
     {
         bool godmode = menu_godmode.Checked;
         if (playerPed.IsInVehicle())
         {
             playerVehicle.IsBulletProof       = godmode;
             playerVehicle.IsExplosionProof    = godmode;
             playerVehicle.IsFireProof         = godmode;
             playerVehicle.IsMeleeProof        = godmode;
             playerVehicle.IsInvincible        = godmode;
             playerVehicle.CanBeVisiblyDamaged = !godmode;
             playerVehicle.CanTiresBurst       = !godmode;
         }
     }
     else if (checkbox == menu_bullet_proof_tires)
     {
         if (menu_bullet_proof_tires.Checked && playerPed.IsInVehicle())
         {
             for (int i = 0; i < 4; i++)
             {
                 playerVehicle.FixTire(i);
             }
         }
     }
     UI.ShowSubtitle("Key: " + Main.Config.GetValue("Config", "Menu", Keys.F9).ToString());
 }
Пример #7
0
 public void OnCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkbox, bool Checked)
 {
     if (checkbox == DebugMode)
     {
         Debug = DebugMode.Checked;
     }
 }
Пример #8
0
        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
        }
Пример #9
0
        private void NeonLights(UIMenu mainMenu)
        {
            var newitem = new UIMenuCheckboxItem("NeonLights", false);

            mainMenu.AddItem(newitem);
            mainMenu.OnCheckboxChange += (sender, item, checked_) =>
            {
                if (item != newitem)
                {
                    return;
                }

                if (checked_)
                {
                    vehicle.SetNeonLightsOn(VehicleNeonLight.Back, true);
                    vehicle.SetNeonLightsOn(VehicleNeonLight.Front, true);
                    vehicle.SetNeonLightsOn(VehicleNeonLight.Left, true);
                    vehicle.SetNeonLightsOn(VehicleNeonLight.Right, true);
                }
                else
                {
                    vehicle.SetNeonLightsOn(VehicleNeonLight.Back, false);
                    vehicle.SetNeonLightsOn(VehicleNeonLight.Front, false);
                    vehicle.SetNeonLightsOn(VehicleNeonLight.Left, false);
                    vehicle.SetNeonLightsOn(VehicleNeonLight.Right, false);
                }
            };
        }
        private void OnCheckboxChanged(UIMenu sender, UIMenuCheckboxItem checkboxItem, bool Checked)
        {
            if (checkboxItem == SelectAllItem)
            {
                foreach (UIMenuCheckboxItem checkbox in checkboxes)
                {
                    checkbox.Checked = Checked;
                }
            }
            else
            {
                SelectAllItem.Checked = false;
            }

            if (Menu.ParentItem != null)
            {
                string label  = "";
                int[]  sirens = SelectedSirenIDs.ToArray();
                if (sirens.Length == 0)
                {
                    label = "None selected";
                }
                else if (sirens.Length == 20)
                {
                    label = "All";
                }
                else
                {
                    label = string.Join(", ", sirens);
                }
                label += " →";
                Menu.ParentItem.RightLabel = label;
            }
        }
Пример #11
0
    public void PlayerMenu(UIMenu menu)
    {
        UIMenuItem CantFallFromBike          = new UIMenuCheckboxItem("Can't fall from bike", CantFallFromBike_, "You can't fall from your bike when enabled");
        UIMenuItem CantBeDraggedOutOfVehicle = new UIMenuCheckboxItem("Can't be dragged out of vehicle", CantBeDraggedOutOfVehicle_, "You can't be dragged out of your vehicle when enabled");
        UIMenuItem CantFlyThroughWindscreen  = new UIMenuCheckboxItem("Can't fly through windscreen", CantFlyThroughWindscreen_, "Crashing at high speed won't make you fly through the windscreen");

        menu.AddItem(CantFallFromBike);
        menu.AddItem(CantBeDraggedOutOfVehicle);
        menu.AddItem(CantFlyThroughWindscreen);
        menu.OnCheckboxChange += (sender, item, checked_) =>
        {
            if (item == CantFallFromBike)
            {
                CantFallFromBike_ = checked_;
                config.SetValue <bool>("Options", "CantFallFromBike", checked_);
            }
            if (item == CantBeDraggedOutOfVehicle)
            {
                CantBeDraggedOutOfVehicle_ = checked_;
                config.SetValue <bool>("Options", "CantBeDraggedOutOfVehicle", checked_);
            }
            if (item == CantFlyThroughWindscreen)
            {
                CantFlyThroughWindscreen_ = checked_;
                config.SetValue <bool>("Options", "CantFlyThroughWindscreen", checked_);
            }
            config.Save();
        };
    }
Пример #12
0
        private void buildRaceControlMenu(UIMenu submenu)
        {
            submenu.Clear();

            // add checkbox to toggle lap mode
            string             lapModeDescription = "If checked, race is a circuit, and automatically restarts. If unchecked, race is point-to-point";
            UIMenuCheckboxItem lapModeItem        = new UIMenuCheckboxItem("Lap Mode", race.lapRace, lapModeDescription);

            lapModeItem.CheckboxEvent += (sender, status) => race.lapRace = status;
            submenu.AddItem(lapModeItem);

            // add button to place checkpoint
            UIMenuItem addCheckpointBtn = new UIMenuItem("Place checkpoint", "Place a checkpoint at the player's current location");

            addCheckpointBtn.Activated += (m, i) => race.createSectorCheckpoint();
            submenu.AddItem(addCheckpointBtn);

            // undo last placed checkpoint
            UIMenuItem undoCheckpointBtn = new UIMenuItem("Undo last checkpoint", "Remove the last checkpoint");

            undoCheckpointBtn.Activated += (m, i) => race.deleteLastSectorCheckpoint();
            submenu.AddItem(undoCheckpointBtn);

            // delete all checkpoints
            UIMenuItem deleteAllCheckpointsBtn = new UIMenuItem("Delete all checkpoints");

            deleteAllCheckpointsBtn.Activated += (m, i) => race.clearAllSectorCheckpoints();
            submenu.AddItem(deleteAllCheckpointsBtn);

            //return submenu;
        }
Пример #13
0
        public static void Add_Option_TurnLights(NativeUI.UIMenu Menu)
        {
            UIMenuCheckboxItem newMenu = new UIMenuCheckboxItem("Turn Lights", Helper.Globals.Settings.TurnLightsEnabled);

            newMenu.CheckboxEvent += Option_TurnLights_OnCheckboxChange;
            Menu.AddItem(newMenu);
        }
Пример #14
0
        public static void Add_Option_Speedometer(NativeUI.UIMenu Menu)
        {
            UIMenuCheckboxItem newMenu = new UIMenuCheckboxItem("Speedometer", Helper.Globals.Settings.SpeedometerEnabled);

            newMenu.CheckboxEvent += Option_Speedometer_OnCheckboxChange;
            Menu.AddItem(newMenu);
        }
Пример #15
0
        private void PhotoMenu_OnCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkboxItem, bool Checked)
        {
            if (checkboxItem == _wormhole)
            {
                _photoHandler.WormholeActive = Checked;
            }

            if (checkboxItem == _coils)
            {
                _photoHandler.GlowingCoilsActive = Checked;
            }

            if (checkboxItem == _ice)
            {
                _photoHandler.IceActive = Checked;
            }

            if (checkboxItem == _fluxCapacitor)
            {
                _photoHandler.FluxCapacitorActive = Checked;
            }

            if (checkboxItem == _hideHUD)
            {
                Main.HideGui = _hideHUD.Checked;
            }

            _photoHandler.SetPhotoMode();
        }
Пример #16
0
        private void SpawnMenu_OnCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkboxItem, bool Checked)
        {
            if (checkboxItem == _canFly)
            {
                _tempTimeMachine.Mods.HoverUnderbody = ConvertFromBool(Checked);

                _exhaust.Index     = 2;
                _suspensions.Index = 0;
            }
            else if (checkboxItem == _hoodBox)
            {
                _tempTimeMachine.Mods.Hoodbox = ConvertFromBool(Checked);
            }
            else if (checkboxItem == _hook)
            {
                if (Checked)
                {
                    _tempTimeMachine.Mods.Hook = HookState.OnDoor;
                }
                else
                {
                    _tempTimeMachine.Mods.Hook = HookState.Off;
                }
            }
        }
Пример #17
0
        private void AddItemsToMenu()
        {
            List <dynamic> cache;
            var            createCameraItem      = new UIMenuItem("Create Camera");
            var            removeCameraItem      = new UIMenuItem("Remove Camera");
            var            pivotOffsetMenu       = _menuPool.AddSubMenu(_mainMenu, "Pivot Offset", "Set the camera's pivot offset.");
            var            xPosItem              = new CustomListItem("X Offset", cache = Enumerable.Range(-500, 1000).Select(i => (dynamic)i / 10f).ToList(), cache.IndexOf(_xPos));
            var            yPosItem              = new CustomListItem("Y Offset", cache = Enumerable.Range(-500, 1000).Select(i => (dynamic)i / 10f).ToList(), cache.IndexOf(_yPos));
            var            zPosItem              = new CustomListItem("Z Offset", cache = Enumerable.Range(-500, 1000).Select(i => (dynamic)i / 10f).ToList(), cache.IndexOf(_zPos));
            var            cameraOffsetMenu      = _menuPool.AddSubMenu(_mainMenu, "Camera Offset", "Set the camera's offset from the pivot.");
            var            xPosItem2             = new CustomListItem("X Offset", cache = Enumerable.Range(-500, 1000).Select(i => (dynamic)i / 10f).ToList(), cache.IndexOf(_xPos2));
            var            yPosItem2             = new CustomListItem("Y Offset", cache = Enumerable.Range(-500, 1000).Select(i => (dynamic)i / 10f).ToList(), cache.IndexOf(_yPos2));
            var            zPosItem2             = new CustomListItem("Z Offset", cache = Enumerable.Range(-500, 1000).Select(i => (dynamic)i / 10f).ToList(), cache.IndexOf(_zPos2));
            var            cameraFieldOfViewItem = new CustomListItem("Field Of View", cache = Enumerable.Range(1, 179).Select(i => (dynamic)i).ToList(), cache.IndexOf(60));
            var            sensitivtyItem        = new UIMenuItem("Sensitivity", "Set the sensitivity.");
            var            invertLookItem        = new UIMenuCheckboxItem("Invert Look", false, "Invert up and down look.");
            var            speedBoostItem        = new CustomListItem("Player Speed Boost",
                                                                      cache = Enumerable.Range(0, 50).Select(i => (dynamic)(float)i).ToList(), cache.IndexOf(0f),
                                                                      "Used so larger characters " +
                                                                      "can walk and move faster since root motion keeps them at the same speed as a regular sized characters.");
            var disableInVehicleItem = new UIMenuCheckboxItem("Disable Cam In Vehicle", _disableInVehicle, "Disable the camera while in a vehicle.");

            sensitivtyItem.SetRightLabel(cameraFieldOfViewItem.Index.ToString());

            createCameraItem.Activated          += CreateCameraItemOnActivated;
            removeCameraItem.Activated          += RemoveCameraItemOnActivated;
            xPosItem.OnListChanged              += XPosItemOnOnListChanged;
            yPosItem.OnListChanged              += YPosItemOnOnListChanged;
            zPosItem.OnListChanged              += ZPosItemOnOnListChanged;
            xPosItem2.OnListChanged             += XPosItemOnOnListChanged2;
            yPosItem2.OnListChanged             += YPosItemOnOnListChanged2;
            zPosItem2.OnListChanged             += ZPosItemOnOnListChanged2;
            cameraFieldOfViewItem.OnListChanged += CameraFieldOfViewItemOnOnListChanged;
            sensitivtyItem.Activated            += (sender, item) => GetUserInput(item, 3, ref _sensitivity);
            invertLookItem.CheckboxEvent        += InvertLookItemOnCheckboxEvent;
            speedBoostItem.OnListChanged        += SpeedBoostItemOnOnListChanged;
            disableInVehicleItem.CheckboxEvent  += DisableInVehicleItemOnCheckboxEvent;

            xPosItem.Activated       += (sender, item) => GetUserInput(item, 10, ref _xPos, xPosItem.IndexToItem(xPosItem.Index).ToString());
            yPosItem.Activated       += (sender, item) => GetUserInput(item, 10, ref _yPos, yPosItem.IndexToItem(yPosItem.Index).ToString());
            zPosItem.Activated       += (sender, item) => GetUserInput(item, 10, ref _zPos, zPosItem.IndexToItem(zPosItem.Index).ToString());
            xPosItem2.Activated      += (sender, item) => GetUserInput(item, 10, ref _xPos2, xPosItem2.IndexToItem(xPosItem2.Index).ToString());
            yPosItem2.Activated      += (sender, item) => GetUserInput(item, 10, ref _yPos2, yPosItem2.IndexToItem(yPosItem2.Index).ToString());
            zPosItem2.Activated      += (sender, item) => GetUserInput(item, 10, ref _zPos2, zPosItem2.IndexToItem(zPosItem2.Index).ToString());
            speedBoostItem.Activated += (sender, item) => GetUserInput(item, 2, ref _speedBoost, speedBoostItem.IndexToItem(speedBoostItem.Index).ToString());

            pivotOffsetMenu.AddItem(xPosItem);
            pivotOffsetMenu.AddItem(yPosItem);
            pivotOffsetMenu.AddItem(zPosItem);
            cameraOffsetMenu.AddItem(xPosItem2);
            cameraOffsetMenu.AddItem(yPosItem2);
            cameraOffsetMenu.AddItem(zPosItem2);
            _mainMenu.AddItem(cameraFieldOfViewItem);
            _mainMenu.AddItem(invertLookItem);
            _mainMenu.AddItem(disableInVehicleItem);
            _mainMenu.AddItem(createCameraItem);
            _mainMenu.AddItem(removeCameraItem);
            _mainMenu.AddItem(speedBoostItem);
        }
Пример #18
0
 public static void OnCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkbox, bool Checked)
 {
     if (sender != mainMenu || checkbox != ketchupCheckbox)
     {
         return;                                                    // We only want to detect changes from our menu.
     }
     Game.DisplayNotification("~r~Ketchup status: ~b~" + Checked);
 }
Пример #19
0
 private static void OnCheckboxChange(UIMenu sender, UIMenuCheckboxItem changeditem, bool check)
 {
     if (sender == PursuitTacticsMenu && changeditem == AutomaticTacticsCheckboxItem)
     {
         EnhancedPursuitAI.AutomaticAI  = check;
         PursuitTacticsListItem.Enabled = !check;
     }
 }
Пример #20
0
 private static void Option_TurnLights_OnCheckboxChange(UIMenuCheckboxItem sender, bool Checked)
 {
     Helper.Globals.Settings.TurnLightsEnabled = Checked;
     if (Game.Player.Character.IsInVehicle())
     {
         GTA.Game.Player.Character.CurrentVehicle.LeftIndicatorLightOn  = false;
         GTA.Game.Player.Character.CurrentVehicle.RightIndicatorLightOn = false;
     }
 }
Пример #21
0
 // Token: 0x0600003D RID: 61 RVA: 0x00006610 File Offset: 0x00004810
 private static void OnCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkboxItem, bool Checked)
 {
     if (sender != UI.myMenu || checkboxItem != UI.heliCbx)
     {
         return;
     }
     Game.DisplayNotification("~r~Helicopter : ~b~" + Checked.ToString());
     UI.isHeliRequested = Checked;
 }
Пример #22
0
        private static void SettingsMenu_OnCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkboxItem, bool Checked)
        {
            if (checkboxItem == playDiodeSound)
            {
                ModSettings.PlayDiodeBeep = Checked;
            }
            else if (checkboxItem == useInputToggle)
            {
                ModSettings.UseInputToggle = Checked;
            }
            else if (checkboxItem == forceFlyMode)
            {
                ModSettings.ForceFlyMode = Checked;
            }
            else if (checkboxItem == playSpeedoBeep)
            {
                ModSettings.PlaySpeedoBeep = Checked;
            }
            else if (checkboxItem == GlowingWormholeEmitter)
            {
                ModSettings.GlowingWormholeEmitter = Checked;
            }
            else if (checkboxItem == GlowingPlutoniumReactor)
            {
                ModSettings.GlowingPlutoniumReactor = Checked;
            }
            else if (checkboxItem == playFluxCapacitorSound)
            {
                ModSettings.PlayFluxCapacitorSound = Checked;
            }
            else if (checkboxItem == playEngineSounds)
            {
                ModSettings.PlayEngineSounds = Checked;
            }
            else if (checkboxItem == cinematicSpawn)
            {
                ModSettings.CinematicSpawn = Checked;
            }
            else if (checkboxItem == LightningStrikeEvent)
            {
                ModSettings.LightningStrikeEvent = Checked;
            }
            else if (checkboxItem == EngineStallEvent)
            {
                ModSettings.EngineStallEvent = Checked;
            }
            else if (checkboxItem == TurbulenceEvent)
            {
                ModSettings.TurbulenceEvent = Checked;
            }
            else if (checkboxItem == LandingSystem)
            {
                ModSettings.LandingSystem = Checked;
            }

            ModSettings.SaveSettings();
        }
Пример #23
0
        /// <summary>
        /// Method that creates a custom submenu based on the specified Loadout.
        /// </summary>
        /// <param name="l"></param>
        /// <returns></returns>
        public UIMenu CreateOptionsMenu(Loadout l)
        {
            LoadoutOptionsMenu            = new UIMenu(l.Name, "Loadouts");
            LoadoutOptionsMenu.ParentMenu = DivisionMenu;
            List <UIMenuListItem> optionsListItems = new List <UIMenuListItem>();

            //For every option, create a UIMenuListItem with all the available options for that LoadoutOption.
            foreach (LoadoutOption opt in l.LoadoutOptions)
            {
                UIMenuListItem listitem;
                List <dynamic> optionNames = new List <dynamic>(opt.OptionNameToCustomisable.Keys);
                if (opt.NoneOption)
                {
                    optionNames.Insert(0, "None");
                }
                LoadoutOptionsMenu.AddItem(listitem = new UIMenuListItem(opt.Name, optionNames, 0));
                optionsListItems.Add(listitem);
            }

            //Create a taser option if specified.
            UIMenuCheckboxItem taseritem = null;

            if (l.TaserOption)
            {
                LoadoutOptionsMenu.AddItem(taseritem = new UIMenuCheckboxItem("Equip Taser", false));
            }

            UIMenuItem confirmitem = new UIMenuItem("Confirm");

            LoadoutOptionsMenu.AddItem(confirmitem);
            LoadoutOptionsMenu.MouseControlsEnabled = false;
            LoadoutOptionsMenu.MouseEdgeEnabled     = true;

            //When confirming selection, check which options have been selected and equip the Loadout with those options.
            LoadoutOptionsMenu.OnItemSelect += (sender, selectedItem, index) =>
            {
                if (selectedItem == confirmitem)
                {
                    List <IPedCustomisable> options = new List <IPedCustomisable>();
                    for (int i = 0; i < optionsListItems.Count; i++)
                    {
                        string optionChosen = optionsListItems[i].IndexToItem(optionsListItems[i].Index);
                        Dictionary <string, IPedCustomisable> dict = l.LoadoutOptions[i].OptionNameToCustomisable;
                        if (dict.ContainsKey(optionChosen))
                        {
                            options.Add(dict[optionChosen]);
                        }
                    }
                    l.Equip(taseritem != null && taseritem.Checked, options);
                    sender.Visible = false;
                }
            };

            LoadoutOptionsMenu.RefreshIndex();
            return(LoadoutOptionsMenu);
        }
Пример #24
0
 public void onCheckBoxChangedHandler(UIMenu sender, UIMenuCheckboxItem selectedCheckbox, bool isChecked)
 {
     foreach (BasicModule module in main.getModules())
     {
         if (selectedCheckbox.Text == module.getName())
         {
             module.toggle(isChecked);
         }
     }
 }
Пример #25
0
        public static UIMenuItem TempomatEnableMenuItem()
        {
            var tempomatEnableMenuItem = new UIMenuCheckboxItem("Enabled", Helper.Globals.Settings.TempomatEnabled);

            tempomatEnableMenuItem.CheckboxEvent += (sender, Checked) =>
            {
                Helper.Globals.Settings.TempomatEnabled = Checked;
            };
            return(tempomatEnableMenuItem);
        }
Пример #26
0
        public static UIMenuItem TempomatIgnoreVehicleInAirMenuItem()
        {
            var tempomatIgnoreVehicleInAirMenuItem = new UIMenuCheckboxItem("Ignore Vehicle in Air", Helper.Globals.Settings.TempomatIgnoreVehicleInAir);

            tempomatIgnoreVehicleInAirMenuItem.CheckboxEvent += (sender, Checked) =>
            {
                Helper.Globals.Settings.TempomatIgnoreVehicleInAir = Checked;
            };
            return(tempomatIgnoreVehicleInAirMenuItem);
        }
Пример #27
0
        /// <summary>
        ///     The AddMenuCheckBox
        /// </summary>
        /// <param name="_name">The _name<see cref="string" /></param>
        /// <param name="_description">The _description<see cref="string" /></param>
        /// <param name="_defaultValue">The _defaultValue<see cref="bool" /></param>
        /// <param name="_menu">The _menu<see cref="UIMenu" /></param>
        /// <returns>The <see cref="UIMenuCheckboxItem" /></returns>
        public UIMenuCheckboxItem AddMenuCheckBox(string _name, string _description, bool _defaultValue = false,
                                                  UIMenu _menu = null)
        {
            var menu    = _menu ?? mainMenu;
            var newitem = new UIMenuCheckboxItem(_name, _defaultValue, _description);

            menu.AddItem(newitem);
            menuPool.RefreshIndex();
            return(newitem);
        }
Пример #28
0
 internal override void onCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkbox, bool Checked)
 {
     if (checkbox == menu_npc_model)
     {
         menu_veh_model.Checked = false;
     }
     else if (checkbox == menu_veh_model)
     {
         menu_npc_model.Checked = false;
     }
 }
        public TrainMissionMenu() : base("Train Mission", "SELECT AN OPTION")
        {
            AddItem(SpawnTrain   = new UIMenuItem("Spawn train"));
            AddItem(DeleteTrain  = new UIMenuItem("Delete train"));
            AddItem(TrainMission = new UIMenuCheckboxItem("Toggle train mission", MissionHandler.TrainMission.IsPlaying, "Start (or stop) train mission."));
            AddItem(PlayMusic    = new UIMenuCheckboxItem("Play music", MissionHandler.TrainMission.PlayMusic, "If true, movie's soundtrack will be played in background."));
            AddItem(TimeSpeed    = new UIMenuDynamicListItem("Speed", "Set speed multipier of the mission. Lower the value, faster the speed and vice versa.", _speed.ToString(), ChangeCallback));

            OnItemSelect     += TrainMissionMenu_OnItemSelect;
            OnCheckboxChange += TrainMissionMenu_OnCheckboxChange;
            OnMenuOpen       += TrainMissionMenu_OnMenuOpen;
        }
Пример #30
0
        private void CreateMenuItems()
        {
            language                  = new UIMenuItem("Language", $"Gets the ~b~{nameof(Localization)}.{nameof(Localization.Language)}~s~ property.");
            systemLanguage            = new UIMenuItem("System Language", $"Gets the ~b~{nameof(Localization)}.{nameof(Localization.SystemLanguage)}~s~ property.");
            prefersMetricMeasurements = new UIMenuItem("Prefers Metric Measurements", $"Gets the ~b~{nameof(Localization)}.{nameof(Localization.PrefersMetricMeasurements)}~s~ property.");
            var resultExists = new UIMenuItem(
                "    Exists",
                $"Whether the input label ID exists, using ~b~{nameof(Localization)}.{nameof(Localization.DoesTextExist)}~s~.");
            var resultString = new UIMenuItem(
                "    Text",
                $"Value of the input label ID, using ~b~{nameof(Localization)}.{nameof(Localization.GetText)}~s~.");
            var labelId = new UIMenuItem("Label ID", $"Select to change the input label ID.")
                          .WithTextEditing(() => inputLabelId,
                                           s =>
            {
                inputLabelId = s;

                bool exists;
                string str;
                if (s.StartsWith("0x") && uint.TryParse(s.Substring(2), System.Globalization.NumberStyles.HexNumber, null, out uint hash))
                {
                    exists = Localization.DoesTextExist(hash);
                    str    = Localization.GetText(hash);
                }
                else
                {
                    exists = Localization.DoesTextExist(inputLabelId);
                    str    = Localization.GetText(inputLabelId);
                }

                resultExists.RightLabel = exists ? "Yes" : "No";
                resultString.RightLabel = str.Replace("~", "\\~");                      // basic token escaping
            });

            var overwriteTitle = new UIMenuCheckboxItem(
                "Overwrite Pause Menu Title",
                false,
                $"Overwrite or reset the pause menu title text label, `PM_PAUSE_HDR`, using ~b~{nameof(Localization)}.{nameof(Localization.SetText)}~s~/~b~{nameof(Localization.ClearTextOverride)}~s~.");

            overwriteTitle.CheckboxEvent += (s, isChecked) =>
            {
                if (isChecked)
                {
                    Localization.SetText("PM_PAUSE_HDR", "RAGENativeUI");
                }
                else
                {
                    Localization.ClearTextOverride("PM_PAUSE_HDR");
                }
            };

            AddItems(language, systemLanguage, prefersMetricMeasurements, labelId, resultExists, resultString, overwriteTitle);
        }