void ShowHelpTexts()
        {
            ControlNextWheel = GTAFunction.UsingGamepad() ? GTA.Control.VehicleAccelerate : GTA.Control.WeaponWheelPrev;
            ControlPrevWheel = GTAFunction.UsingGamepad() ? GTA.Control.VehicleBrake : GTA.Control.WeaponWheelNext;

            if (!Config.DisplayHelpText)
            {
                return;
            }

            string nativeWheelText = (int)Game.Version < (int)GameVersion.VER_1_0_1493_0_STEAM ?
                                     "" :
                                     (WheelListIsPopulated() ?
                                      "\n" +
                                      GTAFunction.InputString(ControlNextWheel) + " " +
                                      GTAFunction.InputString(ControlPrevWheel) +
                                      " : Next / Prev Wheel\n" +
                                      "Wheel: " + currentWheel.Name
                : "");

            GTAFunction.DisplayHelpTextThisFrame(
                GTAFunction.InputString(Config.KB_Toggle, Config.GP_Toggle) +
                " : Switch to Custom Wheels" +
                nativeWheelText
                , false, false
                );
        }
示例#2
0
        public static void LoadINI()
        {
            ForceDecimal();

            ScriptSettings config = ScriptSettings.Load(iniPath);

            SoundFile.SoundEngine.SoundVolume = config.GetValue <float>(INI_SECTION_GENERAL, "DEFAULT VOLUME (0 to 1.0)", 0.3f);
            CustomWheelAsDefault = config.GetValue <bool>(INI_SECTION_GENERAL, "First Custom Wheel Is Default On Startup", true);
            WheelActionDelay     = config.GetValue <int>(INI_SECTION_GENERAL, "WHEEL ACTION DELAY", 500);
            LoadMS                = config.GetValue <int>(INI_SECTION_GENERAL, "Load milliseconds (Higher number > increased load time but more stable)", 1);
            LoadStartDelay        = config.GetValue <int>(INI_SECTION_GENERAL, "Load Start Delay (Milliseconds)", 30000);
            DisplayHelpText       = config.GetValue <bool>(INI_SECTION_GENERAL, "Display Help Text and Subtitles", true);
            EnableWheelSlowmotion = config.GetValue <bool>(INI_SECTION_GENERAL, "Enable Wheel Slowmotion", true);

            IconX              = config.GetValue <int>(INI_SECTION_GRAPHICS, "ICON X SIZE", 30);
            IconY              = config.GetValue <int>(INI_SECTION_GRAPHICS, "ICON Y SIZE", 30);
            WheelRadius        = config.GetValue <float>(INI_SECTION_GRAPHICS, "WHEEL RADIUS", 300f);
            IconBG             = GeneralHelper.HexToColor(config.GetValue <string>(INI_SECTION_GRAPHICS, "ICON BACKGROUND COLOR", "#CC000000"));
            IconHL             = GeneralHelper.HexToColor(config.GetValue <string>(INI_SECTION_GRAPHICS, "ICON HIGHLIGHT COLOR", "#FF00CFEE"));
            IconBgSizeMultiple = config.GetValue <double>(INI_SECTION_GRAPHICS, "BACKGROUND ICON SIZE MULTIPLE", 1.35);
            IconHlSizeMultiple = config.GetValue <double>(INI_SECTION_GRAPHICS, "HIGHLIGHT ICON SIZE MULTIPLE", 1.45);

            KB_Toggle      = config.GetValue <Keys>(INI_SECTION_KEYBOARD_CONTROLS, "Toggle: Q +", Keys.E);
            KB_Skip_Track  = config.GetValue <Control>(INI_SECTION_KEYBOARD_CONTROLS, "Skip Track", Control.PhoneRight);
            KB_Volume_Up   = config.GetValue <Control>(INI_SECTION_KEYBOARD_CONTROLS, "Volume Up", Control.PhoneUp);
            KB_Volume_Down = config.GetValue <Control>(INI_SECTION_KEYBOARD_CONTROLS, "Volume Down", Control.PhoneDown);

            GP_Toggle      = config.GetValue <Control>(INI_SECTION_GAMEPAD_CONTROLS, "Toggle: D-Pad Left +", Control.VehicleDuck);
            GP_Skip_Track  = config.GetValue <Control>(INI_SECTION_GAMEPAD_CONTROLS, "Skip Track", Control.VehicleHandbrake);
            GP_Volume_Up   = config.GetValue <Control>(INI_SECTION_GAMEPAD_CONTROLS, "Volume Up", Control.MoveUpOnly);
            GP_Volume_Down = config.GetValue <Control>(INI_SECTION_GAMEPAD_CONTROLS, "Volume Down", Control.MoveDownOnly);

            SaveINI();
        }
        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);
        }
示例#4
0
 public static string InputString(System.Windows.Forms.Keys key, GTA.Control control, int controlInt = -1)
 {
     if (!UsingGamepad())
     {
         return(key.ToString());
     }
     else
     {
         int controlID = controlInt == -1 ? (int)control : controlInt;
         return("~" + (ControlString)controlID + "~");
     }
 }
示例#5
0
 public static string InputString(string keyboardKey, GTA.Control control, int controlInt = -1)
 {
     if (!UsingGamepad())
     {
         return(keyboardKey);
     }
     else
     {
         int controlID = controlInt == -1 ? (int)control : controlInt;
         return("~" + (ControlString)controlID + "~");
     }
 }
        public void HandleRadioWheelExtraControls()
        {
            if (WheelVars.CurrentRadioWheel.Visible)
            {
                if (RadioStation.CurrentPlaying != null)
                {
                    ControlSkipTrack  = GTAFunction.UsingGamepad() ? Config.GP_Skip_Track : Config.KB_Skip_Track;
                    ControlVolumeUp   = GTAFunction.UsingGamepad() ? Config.GP_Volume_Up : Config.KB_Volume_Up;
                    ControlVolumeDown = GTAFunction.UsingGamepad() ? Config.GP_Volume_Down : Config.KB_Volume_Down;
                    ControlNextWheel  = GTAFunction.UsingGamepad() ? GTA.Control.VehicleAccelerate : GTA.Control.WeaponWheelPrev;
                    ControlPrevWheel  = GTAFunction.UsingGamepad() ? GTA.Control.VehicleBrake : GTA.Control.WeaponWheelNext;

                    if (Config.DisplayHelpText)
                    {
                        GTAFunction.DisplayHelpTextThisFrame(
                            GTAFunction.InputString(ControlSkipTrack) +
                            " : Skip Track\n" +
                            GTAFunction.InputString(ControlVolumeUp) + " " +
                            GTAFunction.InputString(ControlVolumeDown) +
                            " : Volume: " +
                            Math.Round(SoundFile.SoundEngine.SoundVolume * 100, 0) + "%\n" +
                            GTAFunction.InputString(ControlNextWheel) + " " +
                            GTAFunction.InputString(ControlPrevWheel) +
                            " : Next / Prev Wheel\n", false, false);
                    }

                    if (Game.IsControlJustPressed(2, ControlSkipTrack))
                    {
                        RadioStation.CurrentPlaying.PlayNextSong();
                    }
                    else if (Game.IsControlJustPressed(2, ControlVolumeUp))
                    {
                        SoundFile.StepVolume(0.05f, 2);
                    }
                    else if (Game.IsControlJustPressed(2, ControlVolumeDown))
                    {
                        SoundFile.StepVolume(-0.05f, 2);
                    }
                }
            }
            if (RadioStation.CurrentPlaying != null)
            {
                Game.DisableControlThisFrame(2, GTA.Control.VehicleNextRadio);
                Game.DisableControlThisFrame(2, GTA.Control.VehicleNextRadioTrack);
                Game.DisableControlThisFrame(2, GTA.Control.VehiclePrevRadio);
                Game.DisableControlThisFrame(2, GTA.Control.VehiclePrevRadioTrack);

                RadioNativeFunctions.SetVanillaRadioOff();
            }
        }
示例#7
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);
            }
        }
示例#8
0
 /// <summary>
 /// Set a GTA.Control to control a menu only on a specific index.
 /// </summary>
 /// <param name="control"></param>
 /// <param name="gtaControl"></param>
 /// <param name="controlIndex"></param>
 public void SetKey(MenuControls control, Control gtaControl, int controlIndex)
 {
     if (_keyDictionary.ContainsKey(control))
         _keyDictionary[control].Item2.Add(new Tuple<Control, int>(gtaControl, controlIndex));
     else
     {
         _keyDictionary.Add(control,
             new Tuple<List<Keys>, List<Tuple<Control, int>>>(new List<Keys>(), new List<Tuple<Control, int>>()));
         _keyDictionary[control].Item2.Add(new Tuple<Control, int>(gtaControl, controlIndex));
     }
 }
示例#9
0
 /// <summary>
 /// Set a GTA.Control to control a menu. Can be multiple controls. This applies it to all indexes.
 /// </summary>
 /// <param name="control"></param>
 /// <param name="gtaControl"></param>
 public void SetKey(MenuControls control, Control gtaControl)
 {
     SetKey(control, gtaControl, 0);
     SetKey(control, gtaControl, 1);
     SetKey(control, gtaControl, 2);
 }
 bool ControlPressed(Control control)
 {
     return(Game.IsControlPressed(2, control));
 }
示例#11
0
 public void SetKey(UIMenu.MenuControls menuControl, Control control, int controllerIndex)
 {
     _menuList.ForEach(m => m.SetKey(menuControl, control, controllerIndex));
 }
示例#12
0
 public void SetKey(UIMenu.MenuControls menuControl, Control control)
 {
     _menuList.ForEach(m => m.SetKey(menuControl, control));
 }
示例#13
0
        public static string InputString(GTA.Control control, int controlInt = -1)
        {
            int controlID = controlInt == -1 ? (int)control : controlInt;

            return("~" + (ControlString)controlID + "~");
        }
示例#14
0
 public ControlInfo(Control control)
 {
     Control = control;
 }
示例#15
0
 public static int IndexOf(Control control)
 {
     return(CustomControls.IndexOf(CustomControls.Single(x => x.Control == control)));
 }