private static void Update() { if (Core.Utility.IsPauseMenuActive) { // with ShouldTickInPauseMenu set the spotlight is still visible in the pause menu // without needing to do anything else, so if the pause menu is active don't do anything return; } while (PluginState.HasAnySpotlightRequest()) { Vehicle v = PluginState.PopSpotlightRequest(); if (v) { GetVehicleSpotlight(v); } } if (InputControllers.Any(c => c.ShouldToggleSpotlight())) { VehicleSpotlight s = GetPlayerCurrentVehicleSpotlight(); if (s != null) { s.IsActive = !s.IsActive; } } for (int i = Spotlights.Count - 1; i >= 0; i--) { VehicleSpotlight s = Spotlights[i]; if (!s.Vehicle || s.Vehicle.IsDead) { s.IsActive = false; s.OnRemoved(); Spotlights.RemoveAt(i); continue; } s.Update(InputControllers); } if ((Editor == null || !Editor.Window.IsVisible) && Game.IsKeyDown(Settings.EditorKey)) { if (Editor != null) { Editor?.Window?.Close(); Editor = null; } Editor = new EditorForm(); Editor.Show(); Editor.Position = new System.Drawing.Point(300, 300); } }
private static void Update() { if (SpotlightInputControllers.Any(c => c.ShouldToggleSpotlight())) { VehicleSpotlight s = GetPlayerCurrentVehicleSpotlight(); if (s != null) { s.IsActive = !s.IsActive; } } for (int i = Spotlights.Count - 1; i >= 0; i--) { VehicleSpotlight s = Spotlights[i]; if (!s.Vehicle || s.Vehicle.IsDead) { s.IsActive = false; Spotlights.RemoveAt(i); continue; } s.Update(SpotlightInputControllers); } if ((Editor == null || !Editor.Window.IsVisible) && Game.IsKeyDown(Settings.EditorKey)) { if (Editor != null) { Editor?.Window?.Close(); Editor = null; } Editor = new EditorForm(); Editor.Show(); Editor.Position = new System.Drawing.Point(300, 300); } }