Example #1
0
        public MainScript()
        {
            config = ScriptSettings.Load("scripts\\3dMarker.ini");

            Tick    += OnTick;
            Interval = 1;
        }
Example #2
0
        private void ParseConfig()
        {
            ScriptSettings settings;
            string         path1        = @".\scripts\WebScriptHook.ini";
            string         pathFallback = @".\scripts\WebScriptHook\WebScriptHook.ini";

            if (File.Exists(path1))
            {
                settings = ScriptSettings.Load(path1);
            }
            else
            {
                // fallback
                settings = ScriptSettings.Load(pathFallback);
            }
            string host     = settings.GetValue("Core", "HOST", "localhost");
            string port     = settings.GetValue("Core", "PORT", "25555");
            int    interval = settings.GetValue("Core", "INTERVAL", 10);

            Logger.Enable = settings.GetValue("Core", "LOGGING", false);

            //url = "http://localhost:" + port + "/push";
            url       = "ws://" + host + ":" + port + "/pushws";
            sleepTime = interval;
        }
Example #3
0
    public IAAsite()
    {
        IniSettings = ScriptSettings.Load("scripts\\IAAsite.ini");
        BlipsActive = IniSettings.GetValue <bool>("Site Configuration", "Blips Active", false);
        BlipsLR     = IniSettings.GetValue <bool>("Site Configuration", "Blips Borders", false);
        ProcessingZoneIAABlipColor = IniSettings.GetValue <int>("Blip Colors", "ProcessingZoneIAA bc", 0);
        Tick += OnTick;
        IPL();

        if (BlipsActive)
        {
            Blip ProcessingZoneIAA = World.CreateBlip(new Vector3(2521.03f, -414.84f, 94.13f));
            Function.Call(Hash.SET_BLIP_SPRITE, ProcessingZoneIAA, 468);
            Function.Call(Hash.SET_BLIP_COLOUR, ProcessingZoneIAA, ProcessingZoneIAABlipColor);
            Function.Call(Hash._0xF9113A30DE5C6670, "STRING");
            Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, "IAA Data Processing Zone");
            Function.Call(Hash._0xBC38B49BCB83BC9B, ProcessingZoneIAA);


            if (!BlipsLR)
            {
                Function.Call(Hash.SET_BLIP_AS_SHORT_RANGE, ProcessingZoneIAA, true);
            }
        }
    }
    void LoadSettings()
    {
        if (File.Exists(@"scripts\IdleAnimations.ini"))
        {
            ScriptSettings config = ScriptSettings.Load(@"scripts\IdleAnimations.ini");
            string         idle   = config.GetValue <string>("SETTINGS", "IdleAnimation", "");

            if (idle != "")
            {
                Idles.Add(config.GetValue <string>("SETTINGS", "IdleAnimation", ""));
            }
            if (idle != "")
            {
                Idles.Add(config.GetValue <string>("SETTINGS", "IdleAnimation2", ""));
            }
            if (idle != "")
            {
                Idles.Add(config.GetValue <string>("SETTINGS", "IdleAnimation3", ""));
            }
            if (idle != "")
            {
                Idles.Add(config.GetValue <string>("SETTINGS", "IdleAnimation4", ""));
            }
            if (idle != "")
            {
                Idles.Add(config.GetValue <string>("SETTINGS", "IdleAnimation5", ""));
            }
            GangIdle   = config.GetValue <bool>("SETTINGS", "GangIdlesToo", true);
            TimeToIdle = config.GetValue <int>("SETTINGS", "TimeToIdle", 10) * 1000;
        }
    }
Example #5
0
        /// <summary>
        /// Write our property values to the ini at <see cref="Path"/>.
        /// </summary>
        public void Write()
        {
            // Initialize variables.
            var type       = GetType();
            var properties = type.GetProperties();
            var settings   = ScriptSettings.Load(Path);

            // Loop through each of our properties.
            foreach (var property in properties)
            {
                // Get the serialized property and
                // validate it.
                var sp = TryGetSerializedProperty(property);
                if (sp == null)
                {
                    continue;
                }

                // Now determine how to read this variable.
                GetInfo(property, sp, out var key, out var section, out var _);

                // Get and set the value.
                try
                {
                    settings.SetValue(section, key, property.GetValue(this));
                }
                catch
                {
                    // ignored
                }
            }

            // Save the settings.
            settings.Save();
        }
Example #6
0
        private void StartStarman()
        {
            string chosenTheme = starmanThemes[rnd.Next(1, starmanThemes.Length)];

            while (chosenTheme == previousTheme)
            {
                chosenTheme = starmanThemes[rnd.Next(1, starmanThemes.Length)];
            }
            previousTheme = chosenTheme;

            // get the settings when Starman is activated
            ScriptSettings tss = ScriptSettings.Load(@"scripts\Starman.ini");

            volume = float.Parse(tss.GetValue("Settings", "Volume", "0.4"));
            tss    = null;

            audioReader        = new AudioFileReader("scripts/starman/" + chosenTheme + ".mp3");
            audioReader.Volume = volume;
            DelayFadeOutSampleProvider fadeOut = new DelayFadeOutSampleProvider(audioReader);

            fadeOut.BeginFadeOut((starmanTime * 1000) - (fadeOutTime * 1000), fadeOutTime * 1000);
            waveOut = new WaveOutEvent();
            waveOut.PlaybackStopped += waveOut_PlaybackStopped;
            waveOut.Init(fadeOut);
            waveOut.Play();

            btb                 = new BarTimerBar("STARMAN POWER");
            btb.Percentage      = 1;
            btb.ForegroundColor = ExtendedColor.HSL2RGB(0, 1, 0.5);
            btb.BackgroundColor = ExtendedColor.HSL2RGB(0, 1, 0.3);
            tbPool.Add(btb);

            activated = true;
            SetInvulnerability(activated);
        }
Example #7
0
        private void LoadSettingsFile()
        {
            bool loadSettingsSuccess = true;

            try
            {
                ModSettings = ScriptSettings.Load(modSettingsFile);
            }
            catch (Exception ex)
            {
                loadSettingsSuccess = false;
                UI.Notify(ex.Message);
            }

            /*if (loadSettingsSuccess)
             * {
             *  keyCoordsKey = ModSettings.GetValue<Keys>("KEYS", "COORDKEY", Keys.F9);
             *  keySaveFileKey = ModSettings.GetValue<Keys>("KEYS", "SAVEKEY", Keys.F10);
             * }
             * else
             * {*/
            keyCoordsKey   = Keys.I;
            keySaveFileKey = Keys.O;
            //}
        }
Example #8
0
        private void LoadConfig(String fileName)
        {
            try
            {
                /*KEY SETTINGS*/
                configSettings = ScriptSettings.Load(fileName);
                StartMode      = configSettings.GetValue <Keys>("Key Settings", "StartSimplePowerMod", Keys.F10);
                StoreModel     = configSettings.GetValue <Keys>("Key Settings", "SaveModelWithStrength", Keys.F11);
                NextStrength   = configSettings.GetValue <Keys>("Key Settings", "NextStrength", Keys.F8);
                PrevStrength   = configSettings.GetValue <Keys>("Key Settings", "PrevStrength", Keys.F7);

                /*VALUES SETTINGS*/
                DEFAULT_STRENGTH = configSettings.GetValue <int>("Values Settings", "DefaultStrength", 30);
                STRENGTH_OFFSET  = configSettings.GetValue <int>("Values Settings", "StrengthIncreaseDecreaseBy", 10);
                if (STRENGTH_OFFSET < 1)
                {
                    STRENGTH_OFFSET = 1;
                }
                else if (STRENGTH_OFFSET > 2000)
                {
                    STRENGTH_OFFSET = 2000;
                }
                ThereIsNoStoppingMe        = configSettings.GetValue <bool>("Values Settings", "ThereIsNoStoppingMe", true);
                ThereIsNoStoppingMeAtAll   = configSettings.GetValue <bool>("Values Settings", "ThereIsNoStoppingMeAtAll", true);
                WhereYouAimIsWhereYouThrow = configSettings.GetValue <bool>("Values Settings", "WhereYouAimIsWhereYouThrow", true);
                NeverRagdoll = configSettings.GetValue <bool>("Values Settings", "NeverRagdoll", true);
                EveryOne     = configSettings.GetValue <bool>("Values Settings", "EveryOne", false);
            }
            catch (Exception e)
            {
                UI.Notify("~r~Error~w~: " + fileName.ToString() + " failed to load : " + e.ToString() + ".");
                DefaultValues();
            }
        }
Example #9
0
 public InverseTorqueSP()
 {
     Tick += OnTick;
     Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
     Settings = ScriptSettings.Load(@"scripts\InverseTorque\Options.ini");
     Scaler   = Settings.GetValue <float>("SETTINGS", "Scaler", 2f);
 }
Example #10
0
 private void LoadIniFile()
 {
     try
     {
         this.Config                     = ScriptSettings.Load(this.f_Settings);
         this.modEnabled                 = (bool)this.Config.GetValue <bool>("SETTINGS", "modEnabled", (M0)1);
         this.reallifeDateTime           = (bool)this.Config.GetValue <bool>("SETTINGS", "REALLIFE_DATETIME", (M0)0);
         this.displayArtificialHorizon   = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_ARTIFICIAL_HORIZON", (M0)1);
         this.display3DRadar             = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_3D_RADAR", (M0)1);
         this.displayMinimapRadar        = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_MINIMAP_RADAR", (M0)1);
         this.displayMissileWarnSystem   = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_MISSILE_WARN_SYSTEM", (M0)1);
         this.staticArtificialHorizon    = (bool)this.Config.GetValue <bool>("SETTINGS", "STATIC_ARTIFICIAL_HORIZON", (M0)0);
         this.gpsRefreshRate             = (long)this.Config.GetValue <long>("SETTINGS", "GPS_REFRESH_RATE", (M0)500L);
         this.getAllVehiclesInterval     = (long)this.Config.GetValue <long>("SETTINGS", "3D_RADAR_REFRESH_RATE", (M0)10000L);
         this.getAllPropsInterval        = (long)this.Config.GetValue <long>("SETTINGS", "MISSILE_WARN_SYSTEM_REFRESH_RATE", (M0)100L);
         this.color_HUD                  = Color.FromArgb((int)this.Config.GetValue <int>("SETTINGS", "HUD_A", (M0)(int)byte.MaxValue), (int)this.Config.GetValue <int>("SETTINGS", "HUD_R", (M0)67), (int)this.Config.GetValue <int>("SETTINGS", "HUD_G", (M0)197), (int)this.Config.GetValue <int>("SETTINGS", "HUD_B", (M0)0));
         this.xOffsetRight               = float.Parse(((string)this.Config.GetValue <string>("SETTINGS", "XOFFSET_RIGHT_ELEMENTS", (M0)"0.0")).Replace(',', '.'), (IFormatProvider)CultureInfo.InvariantCulture);
         this.SupportedAircraftList      = new List <string>((IEnumerable <string>)File.ReadAllLines(this.f_Aircrafts));
         this.blipRadius                 = 10000f;
         this.airplaneSprite             = (BlipSprite)423;
         this.helicopterSprite           = (BlipSprite)422;
         this.BlipColor                  = (BlipColor)2;
         this.onlyShowAircraftWithDriver = true;
     }
     catch (Exception ex)
     {
         UI.Notify("~r~Error~w~:Failed to load JET HUD settings.");
     }
 }
Example #11
0
        void ParseSettings()
        {
            try
            {
                Config      = ScriptSettings.Load(@".\scripts\DragRace.ini");
                activateKey = Config.GetValue("Keys", "OpenMenu", "O");
                disableKey  = Config.GetValue("Keys", "ManualEndRace", "NumPad1");
                maxSpeed    = Config.GetValue <int>("OpponentSettings", "MaxSpeed", 200);
                custom1x    = Config.GetValue <int>("Race1", "X", -1959);
                custom1y    = Config.GetValue <int>("Race1", "Y", 600);
                custom1z    = Config.GetValue <int>("Race1", "Z", 119);

                custom2x = Config.GetValue <int>("Race2", "X", 497);
                custom2y = Config.GetValue <int>("Race2", "Y", -1132);
                custom2z = Config.GetValue <int>("Race2", "Z", 29);

                customs3x = Config.GetValue <int>("Race3", "StartX", 0);
                customs3y = Config.GetValue <int>("Race3", "StartY", 0);
                customs3z = Config.GetValue <int>("Race3", "StartZ", 0);
                custom3x  = Config.GetValue <int>("Race3", "EndX", 0);
                custom3y  = Config.GetValue <int>("Race3", "EndY", 0);
                custom3z  = Config.GetValue <int>("Race3", "EndZ", 0);
                customh3  = Config.GetValue <int>("Race3", "StartHeading", 270);
            }
            catch
            {
                UI.Notify("There was an error loading the configuration file (.ini) make sure it exists!");
            }
        }
        public static void SaveSettings()
        {
            ScriptSettings settings = ScriptSettings.Load("./scripts/BackToTheFutureV/settings.ini");
            CultureInfo    info     = CultureInfo.CreateSpecificCulture("en-US");

            settings.SetValue("tcd", "position_x", TCDPosition.X.ToString("G", info));
            settings.SetValue("tcd", "position_y", TCDPosition.Y.ToString("G", info));
            settings.SetValue("tcd", "scale", TCDScale.ToString("G", info));
            settings.SetValue("tcd", "background", TCDBackground.ToString());

            settings.SetValue("time_circuits", "PlayFluxCapacitorSound", PlayFluxCapacitorSound);

            settings.SetValue("time_circuits", "play_diode_sound", PlayDiodeBeep);
            settings.SetValue("time_circuits", "use_input_toggle", UseInputToggle);

            settings.SetValue("speedo", "play_speedo_beep", PlaySpeedoBeep);

            settings.SetValue("vehicle", "PlayEngineSounds", PlayEngineSounds);

            settings.SetValue("vehicle", "CinematicSpawn", CinematicSpawn);

            settings.SetValue("fly_mode", "force_fly_mode", ForceFlyMode);
            settings.SetValue("fly_mode", "LandingSystem", LandingSystem);

            settings.SetValue("time_circuits", "GlowingWormholeEmitter", GlowingWormholeEmitter);
            settings.SetValue("time_circuits", "GlowingPlutoniumReactor", GlowingPlutoniumReactor);

            settings.SetValue("events", "LightningStrikeEvent", LightningStrikeEvent);
            settings.SetValue("events", "EngineStallEvent", EngineStallEvent);
            settings.SetValue("events", "TurbulenceEvent", TurbulenceEvent);

            settings.Save();
        }
Example #13
0
        void ReadINI()
        {
            ScriptSettings settings = ScriptSettings.Load(@"scripts\ParticleFxPlayer.ini");

            MenuKey  = settings.GetValue("Control", "Menu Key", Keys.ShiftKey);
            MenuKey2 = settings.GetValue("Control", "Menu Key 2", Keys.N);
        }
Example #14
0
    void ReadIni()
    {
        Logger.Clear();
        Logger.Log(Logger.Level.INFO, $"Indicators");
        Logger.Log(Logger.Level.INFO, $"Game version {Game.Version}");
        Extensions.Init();

        settings = ScriptSettings.Load("scripts\\tk0wnz-indicators.ini");
        int i = 0;

        while (true)
        {
            string modelName = settings.GetValue("CARS", "ModelName" + i, "RESERVED_NO_VALUE");
            int    duration  = settings.GetValue("CARS", "Duration" + i, -1);
            int    debug     = settings.GetValue("CARS", "Debug" + i, -1);

            if (modelName == null || modelName == "RESERVED_NO_VALUE" || duration == -1)
            {
                break;
            }

            blinkerParamsList.Add(
                new BlinkerParams
            {
                ModelName = modelName,
                Duration  = duration,
                Debug     = debug
            }
                );
            ++i;
        }
    }
Example #15
0
        private float destructionRadius = 6.0f; // game units

        public Main()
        {
            Tick  += onTick;
            KeyUp += onKeyUp;

            dateTimeThatStarmanWasInitiated = janFirst1970; // now we set the value

            ss = ScriptSettings.Load(@"scripts\Starman.ini");
            if (ss.GetValue("Settings", "JumpBoost") == null)
            {
                ss.SetValue("Settings", "JumpBoost", "true");
            }
            if (ss.GetValue("Settings", "Key") == null)
            {
                ss.SetValue("Settings", "Key", "105");
            }
            if (ss.GetValue("Settings", "VehiclePower") == null)
            {
                ss.SetValue("Settings", "VehiclePower", "20");
            }
            if (ss.GetValue("Settings", "Volume") == null)
            {
                ss.SetValue("Settings", "Volume", "0.4");
            }
            ss.Save();
        }
Example #16
0
        public SpotifyRadio()
        {
            spotify        = new SpotifyController();
            moodMatcher    = new MoodMatch();
            isEngineOn     = false;
            isSpotifyRadio = false;
            isEngineOn     = false;
            matchMood      = false;
            hasDevice      = false;
            time           = 0;

            File.Create("scripts/GTASpotify.log").Close();
            config  = ScriptSettings.Load("scripts/GTASpotify.ini");
            menuKey = config.GetValue("Options", "MenuKey", Keys.F10);
            volume  = config.GetValue <int>("Options", "Volume", 100);
            if (volume < 0 || volume > 100)
            {
                volume = 100;
            }
            defaultPlaylistId = config.GetValue <string>("Options", "DefaultPlaylist", "");
            spotify.GuaranteeLogin();
            if (spotify.obtainedSpotifyClient)
            {
                spotify.InitialSpotifyRequests(defaultPlaylistId);
                DisableRadioAds();
                SetupMenu();
                DashboardScaleform = new Scaleform("dashboard");
                KeyDown           += OnKeyDown;
                Tick += OnTick;
            }
            else
            {
                Logger.Log("ERROR: Did not login to Spotify");
            }
        }
Example #17
0
        public void initializeINI()
        {
            config           = ScriptSettings.Load("scripts\\DrugSelling.ini");
            SellDrugsKey     = config.GetValue <Keys>("Keys", "SellDrugsKey", Keys.O);
            OpenInventoryKey = config.GetValue <Keys>("Keys", "OpenInventoryKey", Keys.I);
            setDrugCarKey    = config.GetValue <Keys>("Keys", "setDrugCarKey", Keys.F10);
            unsetDrugCarKey  = config.GetValue <Keys>("Keys", "unsetDrugCarKey", Keys.F11);
            resetDealerKey   = config.GetValue <Keys>("Keys", "resetDealerKey", Keys.End);
            deleteDealerKey  = config.GetValue <Keys>("Keys", "deleteDealerKey", Keys.PageUp);

            marijuanaPrice   = config.GetValue <int>("Sell Prices", "MarijuanaSellPrice", 270);
            cocainePrice     = config.GetValue <int>("Sell Prices", "CocaineSellPrice", 600);
            crackPrice       = config.GetValue <int>("Sell Prices", "CrackSellPrice", 300);
            ecstasyPrice     = config.GetValue <int>("Sell Prices", "EcstasySellPrice", 150);
            amphetaminePrice = config.GetValue <int>("Sell Prices", "AmphetamineSellPrice", 75);
            heroinPrice      = config.GetValue <int>("Sell Prices", "HeroinSellPrice", 150);

            marijuanaBuyPrice   = config.GetValue <int>("Buy Prices", "MarijuanaBuyPrice", 270);
            cocaineBuyPrice     = config.GetValue <int>("Buy Prices", "CocaineBuyePrice", 600);
            crackBuyPrice       = config.GetValue <int>("Buy Prices", "CrackBuyPrice", 300);
            ecstasyBuyPrice     = config.GetValue <int>("Buy Prices", "EcstasyBuyPrice", 150);
            amphetamineBuyPrice = config.GetValue <int>("Buy Prices", "AmphetamineBuyPrice", 75);
            heroinBuyPrice      = config.GetValue <int>("Buy Prices", "HeroinBuyPrice", 150);

            sellerLocationX = config.GetValue <float>("Dealer Location", "sellerLocationX", 89.105f);
            sellerLocationY = config.GetValue <float>("Dealer Location", "sellerLocationY", -1912.354f);
            sellerLocationZ = config.GetValue <float>("Dealer Location", "sellerLocationZ", 20.867f);
            sellerAngle     = config.GetValue <float>("Dealer Location", "sellerAngle", 143.448f);
        }
Example #18
0
 // reads the config file in scripts to set keybindings etc.
 private void readConfigurationFile()
 {
     if (File.Exists(configFile))
     {
         config         = ScriptSettings.Load(configFile);
         IntoVehicleKey = config.GetValue <Keys>("KEYS", "BackToVehicle", Keys.E);
     }
 }
 bool DontSpawnOnfoot; // to make it work with assault teams mod
 public UndercoverCops()
 {
     IniSettings     = ScriptSettings.Load("scripts\\Config.ini");
     spawnrange      = IniSettings.GetValue <int>("CONFIG", "SpawnRange", 100);
     DontSpawnOnfoot = IniSettings.GetValue <bool>("CONFIG", "DontSpawnOnfoot", false);
     Tick           += update;
     Interval        = interval;
 }
Example #20
0
 // reads the config file in scripts to set keybindings etc.
 private void readConfigurationFile()
 {
     if (File.Exists(configFile))
     {
         config        = ScriptSettings.Load(configFile);
         defaultWeapon = config.GetValue <string>("SETTINGS", "DefaultWeapon", "Unarmed");
     }
 }
        public BetterCarjacking()
        {
            ScriptSettings scriptSettings = ScriptSettings.Load("scripts\\BetterCarjacking.ini");

            leaveCarChance = scriptSettings.GetValue("Main", "LeaveCarChance", 60);

            Tick += OnTick;
        }
Example #22
0
        public Main()
        {
            // Load settings
            try
            {
                string         configFile = Path.Combine("scripts", "spgunlocker_config.ini");
                ScriptSettings config     = ScriptSettings.Load(configFile);

                if (File.Exists(configFile))
                {
                    InteractionControl = config.GetValue("CONFIG", "InteractionControl", 51);
                    GunLockerPrice     = config.GetValue("CONFIG", "GunLockerPrice", 2500);
                }
                else
                {
                    config.SetValue("CONFIG", "InteractionControl", InteractionControl);
                    config.SetValue("CONFIG", "GunLockerPrice", GunLockerPrice);
                }

                config.Save();
            }
            catch (Exception e)
            {
                UI.Notify($"~r~SPGunLocker settings error: {e.Message}");
            }

            // Create menus
            SPGLMenuPool = new MenuPool();

            SPGLMainMenu             = new UIMenu("", "~b~GUN LOCKER", Point.Empty, "shopui_title_gr_gunmod", "shopui_title_gr_gunmod");
            SPGLWeaponsMenu          = new UIMenu("", "~b~GUN LOCKER: ~w~WEAPONS", Point.Empty, "shopui_title_gr_gunmod", "shopui_title_gr_gunmod");
            SPGLSellConfirmationMenu = new UIMenu("", "~b~GUN LOCKER: ~w~REFUND CONFIRMATION", Point.Empty, "shopui_title_gr_gunmod", "shopui_title_gr_gunmod");

            UIMenuItem putLinkItem  = new UIMenuItem("Put", "Put a weapon to the gun locker.");
            UIMenuItem takeLinkItem = new UIMenuItem("Take", "Take a weapon from the gun locker.");
            UIMenuItem sellItem     = new UIMenuItem("Refund", "Return the gun locker and get your money back. Will take you to the confirmation menu.");

            SPGLMainMenu.AddItem(putLinkItem);
            SPGLMainMenu.AddItem(takeLinkItem);
            SPGLMainMenu.AddItem(sellItem);
            SPGLSellConfirmationMenu.AddItem(new UIMenuItem("Confirm", "You'll be refunded the amount displayed on right. ~r~Weapons inside the gun locker will be lost!"));
            SPGLSellConfirmationMenu.AddItem(new UIMenuItem("Cancel", "Go back to the main menu."));

            SPGLMainMenu.BindMenuToItem(SPGLWeaponsMenu, putLinkItem);
            SPGLMainMenu.BindMenuToItem(SPGLWeaponsMenu, takeLinkItem);
            SPGLMainMenu.BindMenuToItem(SPGLSellConfirmationMenu, sellItem);

            SPGLMenuPool.Add(SPGLMainMenu);
            SPGLMenuPool.Add(SPGLWeaponsMenu);
            SPGLMenuPool.Add(SPGLSellConfirmationMenu);

            // Event handlers
            Tick    += Script_Tick;
            Aborted += Script_Aborted;
            SPGLMainMenu.OnItemSelect             += MainMenu_OnItemSelect;
            SPGLWeaponsMenu.OnItemSelect          += WeaponsMenu_OnItemSelect;
            SPGLSellConfirmationMenu.OnItemSelect += SellConfirmationMenu_OnItemSelect;
        }
        /// <summary>
        /// Starts a wizard in which the user gets asked for all buttons one by one
        /// </summary>
        /// <param name="iniFile">The target INI file</param>
        /// <returns></returns>
        public bool StartConfiguration(string iniFile)
        {
            DirectInputManager input = new DirectInputManager(stick);

            ScriptSettings data = ScriptSettings.Load(iniFile);
            string         guid = stick.Information.ProductGuid.ToString();

            DpadType dpadType = DetermineDpadType(input);

            if (dpadType == (DpadType)3)
            {
                return(false);
            }

            if (dpadType == DpadType.Unknown)
            {
                UI.Notify("Unknown Dpad type, controller configuration stopped.");
                return(false);
            }
            data.SetValue(guid, DirectInputManager.DpadTypeKey, dpadType.ToString());

            while (input.GetDpadValue() != -1)
            {
                UI.ShowSubtitle("Please let go the Dpad button.");
                Script.Wait(100);
            }

            Script.Wait(1000);

            UI.ShowSubtitle("Determined Dpad type: " + dpadType, 2500);

            Script.Wait(2500);

            foreach (DeviceButton btn in Enum.GetValues(typeof(DeviceButton)))
            {
                if (Array.Exists(dpads, item => { return(item == btn); }) && dpadType == DpadType.DigitalDpad)
                {
                    bool result = ConfigureDigitalDpadButton(btn, data, input, guid);
                    if (!result)
                    {
                        return(false);
                    }
                }
                else
                {
                    bool result = Configure(btn, data, input, guid);
                    if (!result)
                    {
                        return(false);
                    }
                }

                UI.Notify(GetBtnText(btn) + " button configured.");
            }

            data.Save();
            return(true);
        }
Example #24
0
    public BaseScript()
    {
        ScriptSettings config = ScriptSettings.Load(@"scripts\ToggleParachute.ini");

        tglChute = config.GetValue <Keys>("KEY", "chute_key", Keys.Space);

        KeyUp   += OnKeyUp;
        Interval = 1;
    }
Example #25
0
 public Main()
 {
     KeyDown          += OnKeyDown;
     Tick             += OnTick;
     iniConfig         = ScriptSettings.Load("scripts\\FlattenWater.ini");
     ActivationKey     = iniConfig.GetValue("General", "ActivationKey", Keys.F6);
     UseShiftKey       = iniConfig.GetValue("General", "UseShiftKey", false);
     ShouldBeOnDefault = iniConfig.GetValue("General", "ActivateScriptByDefault", false);
 }
 public LocationalDamage()
 {
     Tick          += OnTick;
     config         = ScriptSettings.Load("scripts\\LocationalDamage.ini");
     headshots      = config.GetValue <bool>("OPTIONS", "DeadlyHeadshots", false);
     heavyheadshots = config.GetValue <bool>("OPTIONS", "HeavyDamageHeadshots", false);
     debug          = config.GetValue <bool>("OPTIONS", "Debug", false);
     clearlastdmg   = config.GetValue <bool>("OPTIONS", "ClearLastDamaged", false);
 }
 private static void LoadConfigs()
 {
     try {
         Configs = ScriptSettings.Load(@"scripts\SinglePlayerOffice.ini");
     }
     catch (Exception ex) {
         Logger.Log(ex.Message);
     }
 }
Example #28
0
 static RPG()
 {
     PlayerData    = new PlayerData();
     WorldData     = new WorldData();
     SkillHandler  = new SkillHandler();
     WeaponHandler = new WeaponHandler();
     Settings      = ScriptSettings.Load("scripts\\GTARPG\\config.ini");
     InitSettings();
     GameMode = GameMode.NotPlaying;
 }
        void LoadMergerINI(string filepath)
        {
            ScriptSettings config = ScriptSettings.Load(filepath);

            KeyToggle1    = config.GetValue <Keys>("Keyboard Controls", "Menu Toggle Key 1", Keys.F10);
            KeyToggle2    = config.GetValue <Keys>("Keyboard Controls", "Menu Toggle Key 2", Keys.F10);
            buttonToggle1 = config.GetValue <Control>("Gamepad Controls", "Menu Toggle Button 1", Control.VehicleHandbrake);
            buttonToggle2 = config.GetValue <Control>("Gamepad Controls", "Menu Toggle Button 2", Control.VehicleHandbrake);
            buttonToggle3 = config.GetValue <Control>("Gamepad Controls", "Menu Toggle Button 3", Control.VehicleHorn);
        }
Example #30
0
    public MoneyScript()
    {
        UI.Notify("Loaded " + modName + " Made By: " + modCreatorName);

        Tick    += OnTick;
        KeyDown += OnKeyDown;
        KeyUp   += OnKeyUp;
        config   = ScriptSettings.Load("scripts\\MoneyScript.ini");
        Key      = config.GetValue <Keys>("Keys", "Key", Keys.J);
    }