Exemple #1
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");
            }
        }
Exemple #2
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 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;
        }
    }
 public void Load()
 {
     _Distance_Of_Reach = _settings.GetValue(_section, "Distance_Of_Reach", _Distance_Of_Reach);
     _Restrict_When_Stars_Bigger_Then = _settings.GetValue(_section, "Restrict_When_Stars_Bigger_Then", _Restrict_When_Stars_Bigger_Then);
     _Quick_Rob_People_No_Pickup      = _settings.GetValue(_section, "Quick_Rob_People_No_Pickup", _Quick_Rob_People_No_Pickup);
     _Help_Message_Beep_Sound         = _settings.GetValue(_section, "Help_Message_Beep_Sound", _Help_Message_Beep_Sound);
 }
Exemple #5
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();
        }
Exemple #6
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);
        }
 public void Load()
 {
     _Virtual_Timerate     = _settings.GetValue(_section, "Virtual_Timerate", _Virtual_Timerate);
     _Enable_Top_Clock     = _settings.GetValue(_section, "Enable_Top_Clock", _Enable_Top_Clock);
     _Show_Seconds         = _settings.GetValue(_section, "Show_Seconds", _Show_Seconds);
     _Military_Time_Format = _settings.GetValue(_section, "Military_Time_Format", _Military_Time_Format);
     _Clock_Mode           = _settings.GetValue(_section, "Clock_Mode", _Clock_Mode);
 }
 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;
 }
 public void Load()
 {
     _Show_Ammunations    = _settings.GetValue <bool>(_section, "Show_Ammunations", _Show_Ammunations);
     _Show_Atm            = _settings.GetValue <bool>(_section, "Show_Atm", _Show_Atm);
     _Show_Stores         = _settings.GetValue <bool>(_section, "Show_Stores", _Show_Stores);
     _Show_Hospitals      = _settings.GetValue <bool>(_section, "Show_Hospitals", _Show_Hospitals);
     _Show_PoliceStations = _settings.GetValue <bool>(_section, "Show_PoliceStations", _Show_PoliceStations);
 }
Exemple #10
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;
        }
Exemple #11
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);
 }
        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);
        }
        /// <summary>
        /// Create instance of GroundCrewSettings from an INI file
        /// </summary>
        /// <param name="ini">instance of <c>IniFile</c></param>
        public GroundCrewSettings(ScriptSettings ss)
        {
            const string section = "GroundCrew";

            modelArray   = parseModelSettings(ss.GetValue <string>(section, "models", "s_m_y_blackops_01"));
            health       = ss.GetValue <int>(section, "health", health);
            isInvincible = ss.GetValue <bool>(section, "invincible", isInvincible);
            canRagdoll   = ss.GetValue <bool>(section, "canRagdoll", canRagdoll);
            canWrithe    = ss.GetValue <bool>(section, "canWrithe", canWrithe);
        }
Exemple #15
0
    public ToggleFPS()
    {
        ScriptSettings config = ScriptSettings.Load(@"scripts\ToggleFPS.config");

        toggle_fps = config.GetValue <Keys>("SETTINGS", "toggle_fps", Keys.F7);
        update     = config.GetValue <int>("SETTINGS", "counter_update_speed", 100);

        KeyUp   += OnKeyUp;
        Tick    += OnTick;
        Interval = update;
    }
Exemple #16
0
        public void ReadSettings(ScriptSettings scriptSettings)
        {
            cameraSensitivity = scriptSettings.GetValue("editor_camera", "camera_sensitivity", cameraSensitivity);
            scriptSettings.SetValue("editor_camera", "camera_sensitivity", cameraSensitivity);

            cameraFieldOfView = scriptSettings.GetValue("editor_camera", "camera_field_of_view", cameraFieldOfView);
            scriptSettings.SetValue("editor_camera", "camera_field_of_view", cameraFieldOfView);

            movementSpeed = scriptSettings.GetValue("editor_camera", "movement_speed", movementSpeed);
            scriptSettings.SetValue("editor_camera", "movement_speed", movementSpeed);
        }
        public void onKeyUp(object sender, KeyEventArgs e)
        {
            if (!this.keyLock)
            {
                if (e.KeyCode == iniFile.GetValue <Keys>("Keys", "OpenTrunkKey", Keys.F7))
                {
                    Vehicle closestVehicle = World.GetClosestVehicle(Game.Player.Character.Position, 5.0f);
                    if (closestVehicle != null)
                    {
                        Vector3 trunkOffset = closestVehicle.GetOffsetInWorldCoords(new Vector3(0, TRUNK_OFFSET, 0));                                                                        //Get vehicle offset of the trunk
                        if (Game.Player.Character.Position.DistanceTo(trunkOffset) < DISTANCE_TO_TRUNK && !Game.Player.Character.IsInVehicle() && policeCars.Contains(closestVehicle.Model)) //If player is close enough to the trunk and it is a police vehicle
                        {
                            closestVehicle.OpenDoor(VehicleDoor.Trunk, false, false);
                        }
                    }
                }

                if (e.KeyCode == iniFile.GetValue <Keys>("Keys", "InteractionKey", Keys.F5))
                {
                    //Cones
                    if (trunkMenu.ConesItem.Checked)
                    {
                        cones.Add(new Cone(Game.Player.Character.GetOffsetInWorldCoords(new Vector3(0, 0.8f, 0))));
                    }

                    //Spike Strips
                    else if (trunkMenu.SpikeStripItem.Checked)
                    {
                        Game.Player.Character.Task.PlayAnimation("mp_weapons_deal_sting", "crackhead_bag_loop");
                        spikes.Add(new Spike(Game.Player.Character.GetOffsetInWorldCoords(new Vector3(0, 2.5f, 0))));
                    }
                }

                if (e.KeyCode == iniFile.GetValue <Keys>("Keys", "ToggleSpecialFunctionality", Keys.F3))
                {
                    specialFunctionality = !specialFunctionality;
                    string str = specialFunctionality ? "~g~ENABLED~w~" : "~r~DISABLED~w~";
                    //UI.Notify("Special Functionality: " + str);
                    UI.ShowHelpMessage("Special Functionality: " + str);
                    foreach (Cone cone in cones)
                    {
                        cone.FreezeNearbyVehicles(false);
                    }
                }
            }

            if (e.KeyCode == iniFile.GetValue <Keys>("Keys", "ToggleKeyLockKey", Keys.F4))
            {
                this.keyLock = !this.keyLock;
                string str = this.keyLock ? "~r~LOCKED" : "~g~UNLOCKED";
                UI.ShowHelpMessage("Keys: " + str);
            }
        }
        public DSF()
        {
            this.Tick  += cameraMovement;
            this.Tick  += vehicleDetection;
            this.Tick  += controllerSupport;
            this.KeyUp += keyUp;
            this.KeyUp += modActivateKey;

            config       = ScriptSettings.Load("scripts\\DSF Vehicle Switch.ini");
            Switch       = config.GetValue("Options", "switch", Switch);
            effectToggle = config.GetValue("Options", "effect", effectToggle);
        }
Exemple #19
0
        private void LoadValuesFromIniFile()
        {
            ScriptSettings scriptSettings = ScriptSettings.Load(INIpath);

            CinematicKey         = (Keys)scriptSettings.GetValue <Keys>("Keyboard", "CinematicKey", Keys.R);
            CinematicModifierKey = (Keys)scriptSettings.GetValue <Keys>("Keyboard", "CinematicModifierKey", Keys.ControlKey);

            CinematicButton         = (ControllerKeybinds)scriptSettings.GetValue <ControllerKeybinds>("Controller", "CinematicButton", ControllerKeybinds.None);
            CinematicModifierButton = (ControllerKeybinds)scriptSettings.GetValue <ControllerKeybinds>("Controller", "CinematicModifierButton", ControllerKeybinds.None);

            ShowDebug = (bool)scriptSettings.GetValue <bool>("Other", "ShowDebug", false);
            Command_Debug("Debug: ELS Cinematic INI loaded");
        }
Exemple #20
0
 void LoadIniFile(string iniName)
 {
     try
     {
         Config        = ScriptSettings.Load(iniName);
         this.port     = Config.GetValue <int>("Configurations", "Port", 4915);
         this.hostname = Config.GetValue <String>("Configurations", "Hostname", "127.0.0.1");
     }
     catch (Exception e)
     {
         UI.Notify("~r~Error~w~: Config.ini Failed To Load.");
     }
 }
    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;
        }
    }
Exemple #22
0
 void LoadSettings()
 {
     try
     {
         ScriptSettings config = ScriptSettings.Load(@".\scripts\MultiWaypoint.ini");
         removeAll     = config.GetValue("Keys", "RemoveAllWaypoints", "J");
         removeNearest = config.GetValue("Keys", "RemoveNearestWaypoint", "K");
         toggleMod     = config.GetValue("Keys", "Toggle", "P");
     } catch (Exception ex)
     {
         UI.Notify("Failed to load INI, check MW.log");
         File.WriteAllLines(@".\scripts\MW.log", new string[] { "ERROR: ", ex.ToString(), });
     }
 }
Exemple #23
0
 // reads the config file in scripts to set keybindings etc.
 private void readConfigurationFile()
 {
     if (File.Exists(configFile))
     {
         config        = ScriptSettings.Load(configFile);
         spawnPedKey   = config.GetValue <Keys>("KeyBindings", "spawnPed", Keys.H);
         fixVehicleKey = config.GetValue <Keys>("KeyBindings", "fixVehicle", Keys.X);
     }
     else
     {
         UI.ShowSubtitle("Could not load " + configFile + ", file has now been created in /scripts");
         CreateSettingsFile();
     }
 }
Exemple #24
0
        void LoadSettings()
        {
            ScriptSettings settings = ScriptSettings.Load(@".\scripts\CoordRecorder.ini");

            this.enable    = settings.GetValue("Core", "Enable", true);
            this.enableKey = (Keys)Enum.Parse(typeof(Keys), settings.GetValue("Core", "EnableKey"), true);
            this.saveKey   = (Keys)Enum.Parse(typeof(Keys), settings.GetValue("Core", "SaveKey"), true);

            container = new UIContainer(new Point(UI.WIDTH / 2 - PANEL_WIDTH / 2, 0), new Size(PANEL_WIDTH, PANEL_HEIGHT), backColor);
            text      = new UIText("", new Point(PANEL_WIDTH / 2, 0), 0.42f, textColor, GTA.Font.Pricedown, true);
            container.Items.Add(text);

            nameText = new UIText("", new Point(UI.WIDTH / 2, UI.HEIGHT / 2), 0.5f, Color.White, 0, true);
        }
Exemple #25
0
        void ReadSCHelperINI()
        {
            string filepath = @"scripts\ScriptCommunicator.ini";

            if (File.Exists(@"scripts\ScriptCommunicator.dll"))
            {
                ScriptSettings config = ScriptSettings.Load(filepath);

                MenuKey       = config.GetValue <Keys>("Keyboard Controls", "Menu Toggle Key 1", Keys.ShiftKey);
                MenuKey2      = config.GetValue <Keys>("Keyboard Controls", "Menu Toggle Key 2", Keys.N);
                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);
            }
        }
        void LoadSettings(string filepath)
        {
            try
            {
                Config = ScriptSettings.Load(filepath);
                activate = Config.GetValue("Keys", "Activate", "U");
                name = Config.GetValue("Settings", "YourName", "127");
            }
            catch (Exception e)
            {
                UI.Notify("~r~ERROR ~w~loading .ini file, ~b~make sure it exists.");

                UI.ShowSubtitle("~r~error: \n" + e.ToString());
            }
        }
 public void Load()
 {
     _Save_Directory_Path         = _settings.GetValue(_section, "Save_Directory_Path", _Save_Directory_Path);
     _Save_Player_Filename        = _settings.GetValue(_section, "Save_Player_Filename", _Save_Player_Filename);
     _Auto_Save_Enabled           = _settings.GetValue(_section, "Auto_Save_Enabled", _Auto_Save_Enabled);
     _Auto_Save_Delay             = _settings.GetValue(_section, "Auto_Save_Delay", _Auto_Save_Delay);
     _Auto_Save_Show_Spinner_text = _settings.GetValue(_section, "Auto_Save_Show_Spinner_text", _Auto_Save_Show_Spinner_text);
     _Auto_Save_After_DeathArrest = _settings.GetValue(_section, "Auto_Save_After_DeathArrest", _Auto_Save_After_DeathArrest);
     _Auto_Save_When_Wanted       = _settings.GetValue(_section, "Auto_Save_When_Wanted", _Auto_Save_When_Wanted);
     _Auto_Save_In_Vehicle        = _settings.GetValue(_section, "Auto_Save_In_Vehicle", _Auto_Save_In_Vehicle);
     _Auto_Save_On_Transaction    = _settings.GetValue(_section, "Auto_Save_On_Transaction", _Auto_Save_On_Transaction);
 }
 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);
 }
Exemple #29
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);
        }
 // 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");
     }
 }
Exemple #31
0
        /// <summary>
        /// Loads the config from the hard drive.
        /// </summary>
        public void LoadConfig()
        {
            // Check if config file exists.
            if (!File.Exists(@"scripts\SpotifyRage.ini"))
            {
                // Write to SpotifyRage.ini if it can't be found.
                File.WriteAllLines(@"scripts\SpotifyRage.ini",
                                   new string[] { "[Spotify]", "RadioStation=0", "DebugMode = false" });
            }

            // Load the config file.
            Settings = ScriptSettings.Load(@"scripts\SpotifyRage.ini");

            // Set all values.
            DebugDraw    = Settings.GetValue <bool>("Spotify", "DebugMode", false);
            RadioStation = Settings.GetValue <int>("Spotify", "RadioStation", 0);
        }
Exemple #32
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!");
            }
        }