From 6ee16dec9c8271046574cfef7f8527ddbf5a613a Mon Sep 17 00:00:00 2001 From: Gurge44 Date: Tue, 13 Jan 2026 13:58:57 +0100 Subject: [PATCH] CNOs are bye bye on vanilla regions --- Main.cs | 4 ++-- Patches/GameOptionsMenuPatch.cs | 20 +++++++++++++++----- SubmergedCompatibility.cs | 4 ++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Main.cs b/Main.cs index 6c67a704e..0b1824157 100644 --- a/Main.cs +++ b/Main.cs @@ -42,8 +42,8 @@ public class Main : BasePlugin private const string DebugKeyHash = "c0fd562955ba56af3ae20d7ec9e64c664f0facecef4b3e366e109306adeae29d"; private const string DebugKeySalt = "59687b"; private const string PluginGuid = "com.gurge44.endlesshostroles"; - public const string PluginVersion = "7.1.0"; - public const string PluginDisplayVersion = "7.1.0"; + public const string PluginVersion = "7.1.1"; + public const string PluginDisplayVersion = "7.1.1"; public const bool TestBuild = false; public const string NeutralColor = "#ffab1b"; diff --git a/Patches/GameOptionsMenuPatch.cs b/Patches/GameOptionsMenuPatch.cs index 701f042bc..4e1e4b4c5 100644 --- a/Patches/GameOptionsMenuPatch.cs +++ b/Patches/GameOptionsMenuPatch.cs @@ -1170,14 +1170,24 @@ public static class GameSettingMenuPatch Vector3 gameSettingsLabelPos = gameSettingsLabel.transform.localPosition; - CustomGameMode[] gms = Enum.GetValues()[..^1]; - gms = gms.Without(CustomGameMode.TheMindGame).ToArray(); - if (SubmergedCompatibility.Loaded && Main.NormalOptions.MapId == 6) gms = gms.Where(SubmergedCompatibility.IsSupported).ToArray(); - int totalCols = Mathf.Max(1, Mathf.CeilToInt(gms.Length / 7f)); + var gms = Enum.GetValues()[..^1].ToList(); + gms.Remove(CustomGameMode.TheMindGame); + + if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) + { + gms.Remove(CustomGameMode.CaptureTheFlag); + gms.Remove(CustomGameMode.NaturalDisasters); + gms.Remove(CustomGameMode.BedWars); + } + + if (SubmergedCompatibility.Loaded && Main.NormalOptions.MapId == 6) + gms.RemoveAll(SubmergedCompatibility.IsNotSupported); + + int totalCols = Mathf.Max(1, Mathf.CeilToInt(gms.Count / 7f)); GMButtons = []; - for (var index = 0; index < gms.Length; index++) + for (var index = 0; index < gms.Count; index++) { CustomGameMode gm = gms[index]; diff --git a/SubmergedCompatibility.cs b/SubmergedCompatibility.cs index 01702ab11..715319cb5 100644 --- a/SubmergedCompatibility.cs +++ b/SubmergedCompatibility.cs @@ -259,9 +259,9 @@ public static class SubmergedCompatibility return (IList)Activator.CreateInstance(genericListType); } - public static bool IsSupported(CustomGameMode mode) + public static bool IsNotSupported(CustomGameMode mode) { - return mode is CustomGameMode.Standard or CustomGameMode.SoloPVP or CustomGameMode.FFA or CustomGameMode.StopAndGo or CustomGameMode.HotPotato or CustomGameMode.HideAndSeek or CustomGameMode.Speedrun or CustomGameMode.CaptureTheFlag or CustomGameMode.RoomRush or CustomGameMode.KingOfTheZones or CustomGameMode.Quiz or CustomGameMode.TheMindGame or CustomGameMode.BedWars; + return mode is CustomGameMode.NaturalDisasters; } public enum SubmergedSystemTypes : byte