void OnTick(object sender, EventArgs e) { if (GTAFunction.HasCheatStringJustBeenEntered("radio_reload")) { UnhideAllStations(); NativeWheel.WheelList = null; currentWheel = null; GetOrganizationLists(); loaded = true; Wait(150); } if (RadioNativeFunctions.IsRadioHudComponentVisible()) { if (!loaded && Game.Player.CanControlCharacter) { LogAllStations(); GetOrganizationLists(); loaded = true; } ShowHelpTexts(); ControlWheelChange(); if (Event_JUST_OPENED_OnNextOpen) { OnJustOpened(); } DisableNativeScrollRadioControls(); Event_JUST_OPENED_OnNextOpen = false; } else { if (!loaded) { return; } if (!Event_JUST_OPENED_OnNextOpen) { OnJustClosed(); Event_JUST_OPENED_OnNextOpen = true; } } }
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(); }