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
                );
        }
        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();
            }
        }
        public void HandleGamePause()
        {
            if (Game.IsControlJustPressed(2, GTAFunction.UsingGamepad() ? GTA.Control.FrontendPause : GTA.Control.FrontendPauseAlternate))
            {
                if (RadioStation.CurrentPlaying != null)
                {
                    RadioStation.CurrentPlaying.CurrentSoundIsPaused = true;
                    doUnpauseNextFrame = true;
                    Wait(500);
                }
            }

            if (doUnpauseNextFrame)
            {
                RadioStation.CurrentPlaying.CurrentSoundIsPaused = false;
                doUnpauseNextFrame = false;
            }
        }
        void OnTick(object sender, EventArgs e)
        {
            if (!loaded)
            {
                if (!Game.Player.CanControlCharacter || Game.IsLoading)
                {
                    return;
                }

                if (loadDelayTimer == null)
                {
                    loadDelayTimer = DateTime.Now.AddMilliseconds(Config.LoadStartDelay);
                }

                Decorators.DEntity = Game.Player.Character;

                if (loadDelayTimer < DateTime.Now || Decorators.ScriptHasLoadedOnce)
                {
                    if (Config.DisplayHelpText)
                    {
                        UI.ShowSubtitle("Loading Custom Radios...");
                    }

                    SetupRadio();
                    SetupEvents();

                    // Allow playing MP audio sounds and scenes
                    Function.Call(Hash.SET_AUDIO_FLAG, "LoadMPData", true);

                    RadioNativeFunctions.DashboardScaleform = new ScaleformHelper.Scaleform("dashboard", true);

                    if (!Decorators.ScriptHasLoadedOnce)
                    {
                        Decorators.Init(Game.Player.Character);
                    }

                    loaded = true;

                    if (Config.DisplayHelpText)
                    {
                        UI.ShowSubtitle("Custom Radios Loaded");
                    }

                    if (Config.CustomWheelAsDefault && WheelVars.RadioWheels.Count > 0)
                    {
                        lastRadioWasCustom     = true;
                        canResumeCustomStation = true;
                    }
                }

                return; // Return if loaded is still not true
            }

            if (WheelVars.RadioWheels.Count == 0)
            {
                return;
            }

            if (GTAFunction.HasCheatStringJustBeenEntered("radio_reload"))
            {
                Config.LoadINI();
                Config.UpdateWheelsVisuals();
                Config.ReloadStationINIs();
                Config.RescanForTracklists();
                UI.ShowSubtitle("Custom Radio INIs reloaded:\n- settings.ini\n- station.ini files\n- Scanned for tracklists");
                Wait(150);
            }

            if (VanillaOrCustomRadioWheelIsVisible())
            {
                if (GTAFunction.UsingGamepad() && Game.IsControlJustPressed(2, Config.GP_Toggle))
                {
                    HandleRadioWheelToggle();
                }

                if (lastRadioWasCustom)
                {
                    WheelVars.CurrentRadioWheel.Visible = true;
                }

                lastPlayedOnFoot = Game.Player.Character.IsInVehicle() ? false : true;
            }

            if (Game.IsControlJustReleased(2, GTA.Control.VehicleRadioWheel))
            {
                if (WheelVars.CurrentRadioWheel.Visible)
                {
                    WheelVars.CurrentRadioWheel.Visible = false;
                }
            }

            Wheel.ControlTransitions(Config.EnableWheelSlowmotion);
            WheelVars.RadioWheels.ForEach(w => w.ProcessSelectorWheel());
            HandleRadioWheelQueue();
            SoundFile.ManageSoundEngine();
            RadioStation.ManageStations();
            HandleRadioWheelExtraControls();
            HandleQueuedStationActions();
            HandleEnterExitVehicles();
            UpdateDashboardInfo();
            HandleGamePause();
            GeneralEvents.Update();
        }