public CopyMenu(EmergencyLightingMenu parent) { this.ParentMenu = parent; Menu = new UIMenu("Edit Siren", parent.Menu.SubtitleText + " > Copy Siren Properties"); DestinationSirenSelectorMenu.Menu.SubtitleText = "~b~Copy Siren Properties > Select Destination Sirens"; TargetMenu = new SirenSettingsSelectionMenu(ParentELS); allSirenCopyCheckboxes.Add(SequencesCheckbox); allSirenCopyCheckboxes.Add(DeltasCheckbox); allSirenCopyCheckboxes.Add(FlashinessCheckbox); allSirenCopyCheckboxes.Add(RotationCheckbox); allSirenCopyCheckboxes.Add(EnvLightingCheckbox); allSirenCopyCheckboxes.Add(CoronaCheckbox); allSirenCopyCheckboxes.Add(ColorCheckbox); allGeneralCopyCheckboxes.Add(SettingEnvCheckbox); allGeneralCopyCheckboxes.Add(SettingSpeedCheckbox); allGeneralCopyCheckboxes.Add(HeadTailCheckbox); Menu.AddItem(AllSirenPropertiesCheckbox); foreach (UIMenuCheckboxItem checkbox in allSirenCopyCheckboxes) { checkbox.BackColor = Color.FromArgb(100, Color.DarkGray); checkbox.ForeColor = Color.WhiteSmoke; checkbox.Text = " " + checkbox.Text; Menu.AddItem(checkbox); } Menu.AddItem(AllGeneralPropertiesCheckbox); foreach (UIMenuCheckboxItem checkbox in allGeneralCopyCheckboxes) { checkbox.BackColor = Color.FromArgb(100, Color.DarkGray); checkbox.ForeColor = Color.WhiteSmoke; checkbox.Text = " " + checkbox.Text; Menu.AddItem(checkbox); } AllSirenPropertiesCheckbox.CheckboxEvent += OnAllPropertiesChecked; AllGeneralPropertiesCheckbox.CheckboxEvent += OnAllPropertiesChecked; Menu.AddItem(CopyModeItem); TargetMenuItem = TargetMenu.CreateAndBindToSubmenuItem(this.Menu, "Target", "Select target siren setting to copy to/from", true); Menu.AddItem(SourceSirenSelector); Menu.AddItem(DestinationSirenMenuItem); Menu.BindMenuAndCopyProperties(DestinationSirenSelectorMenu.Menu, DestinationSirenMenuItem); DestinationSirenMenuItem.RightLabel = "None →"; Menu.AddItem(CopyItem); CopyModeItem.OnListChanged += OnCopyModeChanged; CopyItem.Activated += OnCopyActivated; CopyItem.BackColor = Color.DarkGreen; CopyItem.ForeColor = Color.White; CopyItem.HighlightedBackColor = Color.PaleGreen; CopyItem.HighlightedForeColor = Color.DarkGreen; OnCopyModeChanged(CopyModeItem, 0); Menu.RefreshIndex(); }
static VehicleMenu() { Menu = new UIMenuRefreshable("Siren Configuration", "~y~No vehicle selected"); MenuController.Pool.AddAfterYield(Menu); Menu.WidthOffset = 250; Menu.ControlDisablingEnabled = true; Menu.MouseControlsEnabled = false; Menu.AllowCameraMovement = true; BannerItem = new UIMenuItem("LiveLights by PNWParksFan", $"LiveLights was created by ~g~PNWParksFan~w~ using the RPH emergency lighting SDK. If you found this plugin useful and made something cool with it, ~y~please mention it in your credits/readme~w~. If you'd like to say thanks, you can donate to support my various modding projects at ~b~parksmods.com/donate~w~ and get member-exclusive perks. Press Enter to learn more!"); BannerItem.RightLabel = "v" + EntryPoint.CurrentFileVersion.ToString(); BannerItem.LeftBadge = UIMenuItem.BadgeStyle.Heart; BannerItem.BackColor = Color.Black; BannerItem.ForeColor = Color.LightSkyBlue; BannerItem.HighlightedBackColor = Color.LightSkyBlue; BannerItem.Activated += OnBannerClicked; Menu.AddItem(BannerItem); if (EntryPoint.VersionCheck?.IsUpdateAvailable() == true) { UpdateItem = new UIMenuItem("Update Available", $"Version ~y~{EntryPoint.VersionCheck.LatestRelease.TagName}~w~ is available for download. Press ~b~Enter~w~ to download ~y~{EntryPoint.VersionCheck.LatestRelease.Name}~w~."); UpdateItem.RightLabel = "~o~" + EntryPoint.VersionCheck.LatestRelease.TagName; UpdateItem.LeftBadge = UIMenuItem.BadgeStyle.Alert; UpdateItem.BackColor = Color.Black; UpdateItem.ForeColor = Color.LightSkyBlue; UpdateItem.HighlightedBackColor = Color.LightSkyBlue; Menu.AddItem(UpdateItem); UpdateItem.Activated += OnUpdateClicked; } SirenSettingMenu = new SirenSettingsSelectionMenu(null, true, true, true, false); SirenSettingSelectorItem = SirenSettingMenu.CreateAndBindToSubmenuItem(Menu); SirenConfigMenu = null; // new EmergencyLightingMenu(null); SirenConfigItem = new UIMenuItem("Edit Emergency Lighting", defaultConfigMenuDesc); SirenConfigItem.RightLabel = "→"; Menu.AddItem(SirenConfigItem); // Menu.BindMenuToItem(SirenConfigMenu.Menu, SirenConfigItem); EmergencyLightsOnItem = new UIMenuRefreshableCheckboxItem("Emergency Lights Enabled", false, "Toggle flashing lights on this vehicle"); Menu.AddMenuDataBinding(EmergencyLightsOnItem, (x) => Vehicle.IsSirenOn = x, () => Vehicle.IsSirenOn); SirenAudioOnItem = new UIMenuRefreshableCheckboxItem("Siren Audio Enabled", false, "Toggle siren audio on this vehicle"); Menu.AddMenuDataBinding(SirenAudioOnItem, (x) => Vehicle.IsSirenSilent = !x, () => !Vehicle.IsSirenSilent); SirenSettingMenu.OnSirenSettingSelected += OnSirenSelectionChanged; Refresh(); Menu.RefreshIndex(); if (UpdateItem != null) { Menu.CurrentSelection = 2; } else { Menu.CurrentSelection = 1; } }
private static void OnSirenSelectionChanged(SirenSettingsSelectionMenu sender, UIMenu menu, SirenSettingsSelectionMenu.SirenSettingMenuItem item, EmergencyLighting setting) { // EmergencyLighting els = setting.GetCustomOrClone(); if (Vehicle) { Vehicle.EmergencyLightingOverride = setting; Vehicle.RefreshSiren(); } ResetConfigMenu(); }