diff --git a/src/BAUPlugin.cs b/src/BAUPlugin.cs
index 88b05a4..1c31fba 100644
--- a/src/BAUPlugin.cs
+++ b/src/BAUPlugin.cs
@@ -42,7 +42,7 @@ internal class BAUPlugin : BasePlugin
text = $"v{BetterAmongUsVersion}{newLineText}Beta {ModInfo.BetaNum}";
break;
case ReleaseTypes.Dev:
- text = $"v{BetterAmongUsVersion}{newLineText}Dev {ModInfo.ReleaseDate}";
+ text = $"v{BetterAmongUsVersion}{newLineText}Dev {ModInfo.CommitHash}-{ModInfo.BuildDate}";
break;
default:
break;
@@ -106,7 +106,7 @@ internal class BAUPlugin : BasePlugin
Logger_.Log("Better Among Us successfully loaded!");
string SupportedVersions = string.Join(" ", SupportedAmongUsVersions);
- Logger_.Log($"BetterAmongUs {BetterAmongUsVersion}-{ModInfo.ReleaseDate} - [{AppVersion} --> {SupportedVersions}] {Utils.GetPlatformName(PlatformData.Platform)}");
+ Logger_.Log($"BetterAmongUs {BetterAmongUsVersion}-{ModInfo.BuildDate} - [{AppVersion} --> {SupportedVersions}] {Utils.GetPlatformName(PlatformData.Platform)}");
}
catch (Exception ex)
{
diff --git a/src/BetterAmongUs.csproj b/src/BetterAmongUs.csproj
index 634c239..23c863e 100644
--- a/src/BetterAmongUs.csproj
+++ b/src/BetterAmongUs.csproj
@@ -7,10 +7,27 @@
preview
-
+
+ unknown
+ $([System.DateTime]::UtcNow.ToString(MM.dd.yyyy))
true
false
+
+
+
+
+
+ <_Parameter1>CommitHash
+ <_Parameter2>$(CommitHash)
+
+
+ <_Parameter1>BuildDate
+ <_Parameter2>$(BuildDate)
+
+
+
+
build\mod_folder_path
$([System.IO.File]::ReadAllText('$(ModPathFile)').Trim())
$(GamePath)
@@ -28,6 +45,7 @@
+
@@ -37,8 +55,8 @@
+
-
\ No newline at end of file
diff --git a/src/Helpers/EnumHelper.cs b/src/Helpers/EnumHelper.cs
index 71fbe43..b7bdcaa 100644
--- a/src/Helpers/EnumHelper.cs
+++ b/src/Helpers/EnumHelper.cs
@@ -7,7 +7,7 @@ internal static class EnumHelper
///
/// Type of enum to be obtained
/// All values of T
- internal static T[] GetAllValues() where T : Enum => Enum.GetValues(typeof(T)) as T[];
+ internal static T[]? GetAllValues() where T : Enum => Enum.GetValues(typeof(T)) as T[];
///
/// Get all names in enum
///
@@ -22,13 +22,13 @@ internal static class EnumHelper
/// Type of enum to be obtained
/// The number of elements each chunk should contain.
/// A list of arrays, each containing up to elements of the enum type.
- internal static List Achunk(int chunkSize, bool shuffle = false, Func exclude = null) where TEnum : Enum
+ internal static List Achunk(int chunkSize, bool shuffle = false, Func? exclude = null) where TEnum : Enum
{
List chunkedList = [];
- TEnum[] allValues = GetAllValues();
+ TEnum[]? allValues = GetAllValues();
var rnd = new Random();
- if (shuffle) allValues = allValues.Shuffle(rnd).ToArray();
- if (exclude != null) allValues = allValues.Where(exclude).ToArray();
+ if (shuffle) allValues = [.. allValues.Shuffle(rnd)];
+ if (exclude != null) allValues = [.. allValues.Where(exclude)];
for (int i = 0; i < allValues.Length; i += chunkSize)
{
diff --git a/src/Helpers/InnerNetClientHelper.cs b/src/Helpers/InnerNetClientHelper.cs
index 26df242..cb89170 100644
--- a/src/Helpers/InnerNetClientHelper.cs
+++ b/src/Helpers/InnerNetClientHelper.cs
@@ -359,7 +359,7 @@ internal static class InnerNetClientHelper
messageWriter.ForEach(mW => mW.Write("RPC TEST"));
AmongUsClient.Instance.FinishRpcDesync(messageWriter);
*/
- internal static List StartRpcDesync(this InnerNetClient client, uint playerNetId, byte callId, SendOption option, int ignoreClientId = -1, Func clientCheck = null)
+ internal static List StartRpcDesync(this InnerNetClient client, uint playerNetId, byte callId, SendOption option, int ignoreClientId = -1, Func? clientCheck = null)
{
List messageWriters = [];
diff --git a/src/Helpers/PlayerControlHelper.cs b/src/Helpers/PlayerControlHelper.cs
index b8f766d..55c7fff 100644
--- a/src/Helpers/PlayerControlHelper.cs
+++ b/src/Helpers/PlayerControlHelper.cs
@@ -124,14 +124,12 @@ static class PlayerControlHelper
{
longModeParts[i].material.SetFloat("_Outline", active ? 1 : 0);
}
- if (color != null)
+
+ player.cosmetics.currentBodySprite.BodySprite.material.SetColor("_OutlineColor", color);
+ longModeParts = player.cosmetics.currentBodySprite.LongModeParts;
+ for (int i = 0; i < longModeParts.Length; i++)
{
- player.cosmetics.currentBodySprite.BodySprite.material.SetColor("_OutlineColor", color);
- longModeParts = player.cosmetics.currentBodySprite.LongModeParts;
- for (int i = 0; i < longModeParts.Length; i++)
- {
- longModeParts[i].material.SetColor("_OutlineColor", color);
- }
+ longModeParts[i].material.SetColor("_OutlineColor", color);
}
}
diff --git a/src/Helpers/Utils.cs b/src/Helpers/Utils.cs
index c8f15f4..ba78b7e 100644
--- a/src/Helpers/Utils.cs
+++ b/src/Helpers/Utils.cs
@@ -67,7 +67,7 @@ internal static class Utils
if (Application.internetReachability == NetworkReachability.NotReachable)
return false;
- UnityWebRequest www = null;
+ UnityWebRequest? www = null;
try
{
www = UnityWebRequest.Get("http://clients3.google.com/generate_204");
@@ -317,7 +317,7 @@ internal static class Utils
}
// Resource loading
- internal static Sprite LoadSprite(string path, float pixelsPerUnit = 1f)
+ internal static Sprite? LoadSprite(string path, float pixelsPerUnit = 1f)
{
try
{
diff --git a/src/ModInfo.cs b/src/ModInfo.cs
index 042ddb6..5446242 100644
--- a/src/ModInfo.cs
+++ b/src/ModInfo.cs
@@ -1,15 +1,27 @@
-namespace BetterAmongUs;
+using System.Reflection;
+
+namespace BetterAmongUs;
internal static class ModInfo
{
- internal static readonly ReleaseTypes ReleaseBuildType = ReleaseTypes.Beta;
- internal const string BetaNum = "2";
- internal const string HotfixNum = "1";
- internal const bool IsHotFix = true;
+ internal static readonly ReleaseTypes ReleaseBuildType = ReleaseTypes.Release;
+ internal const string BetaNum = "0";
+ internal const string HotfixNum = "0";
+ internal const bool IsHotFix = false;
internal const string PluginName = "BetterAmongUs";
internal const string PluginGuid = "com.d1gq.betteramongus";
internal const string PluginVersion = "1.3.1";
- internal const string ReleaseDate = "01.09.2026"; // mm/dd/yyyy
- internal const string Github = "https://github.com/D1GQ/BetterAmongUs-Public";
+ internal const string Github = "https://github.com/D1GQ/BetterAmongUs";
internal const string Discord = "https://discord.gg/vjYrXpzNAn";
+ public static string CommitHash => GetAssemblyMetadata("CommitHash");
+ public static string BuildDate => GetAssemblyMetadata("BuildDate");
+
+ private static string GetAssemblyMetadata(string key)
+ {
+ var attribute = Assembly.GetExecutingAssembly()
+ .GetCustomAttributes()
+ .FirstOrDefault(a => a.Key == key);
+
+ return attribute?.Value ?? "unknown";
+ }
}
\ No newline at end of file
diff --git a/src/Modules/ClientOptionItem.cs b/src/Modules/ClientOptionItem.cs
index f8dea44..801e4ae 100644
--- a/src/Modules/ClientOptionItem.cs
+++ b/src/Modules/ClientOptionItem.cs
@@ -121,7 +121,7 @@ internal sealed class ClientOptionItem
finally { numOptions++; }
}
- internal static ClientOptionItem Create(string name, ConfigEntry config, OptionsMenuBehaviour optionsMenuBehaviour, Action? additionalOnClickAction = null, Func? toggleCheck = null, bool IsToggle = true)
+ internal static ClientOptionItem Create(string name, ConfigEntry? config, OptionsMenuBehaviour optionsMenuBehaviour, Action? additionalOnClickAction = null, Func? toggleCheck = null, bool IsToggle = true)
{
toggleCheck ??= () => true;
diff --git a/src/Modules/OptionItems/NoneOption/OptionDividerItem.cs b/src/Modules/OptionItems/NoneOption/OptionDividerItem.cs
index cdb4f89..d64cf3d 100644
--- a/src/Modules/OptionItems/NoneOption/OptionDividerItem.cs
+++ b/src/Modules/OptionItems/NoneOption/OptionDividerItem.cs
@@ -21,7 +21,7 @@ internal sealed class OptionDividerItem : OptionItem
return Item;
}
- protected void CreateBehavior()
+ private void CreateBehavior()
{
if (!GameSettingMenu.Instance) return;
AllTBROptionsTemp.Add(this);
diff --git a/src/Modules/OptionItems/NoneOption/OptionHeaderItem.cs b/src/Modules/OptionItems/NoneOption/OptionHeaderItem.cs
index 155a512..eecf561 100644
--- a/src/Modules/OptionItems/NoneOption/OptionHeaderItem.cs
+++ b/src/Modules/OptionItems/NoneOption/OptionHeaderItem.cs
@@ -22,7 +22,7 @@ internal sealed class OptionHeaderItem : OptionItem
return Item;
}
- protected void CreateBehavior()
+ private void CreateBehavior()
{
if (!GameSettingMenu.Instance) return;
AllTBROptionsTemp.Add(this);
diff --git a/src/Modules/OptionItems/NoneOption/OptionTitleItem.cs b/src/Modules/OptionItems/NoneOption/OptionTitleItem.cs
index c3c7ef6..5e6c9e1 100644
--- a/src/Modules/OptionItems/NoneOption/OptionTitleItem.cs
+++ b/src/Modules/OptionItems/NoneOption/OptionTitleItem.cs
@@ -22,7 +22,7 @@ internal sealed class OptionTitleItem : OptionItem
return Item;
}
- protected void CreateBehavior()
+ private void CreateBehavior()
{
if (!GameSettingMenu.Instance) return;
AllTBROptionsTemp.Add(this);
diff --git a/src/Modules/OptionItems/OptionCheckboxItem.cs b/src/Modules/OptionItems/OptionCheckboxItem.cs
index 7533d6a..e72fde7 100644
--- a/src/Modules/OptionItems/OptionCheckboxItem.cs
+++ b/src/Modules/OptionItems/OptionCheckboxItem.cs
@@ -7,7 +7,7 @@ internal sealed class OptionCheckboxItem : OptionItem
{
internal sealed override bool ShowChildren => base.ShowChildren && Value;
- internal static OptionCheckboxItem Create(int id, OptionTab tab, string tranStr, bool defaultValue, OptionItem parent = null)
+ internal static OptionCheckboxItem Create(int id, OptionTab tab, string tranStr, bool defaultValue, OptionItem? parent = null)
{
if (GetOptionById(id) is OptionCheckboxItem checkboxItem)
{
diff --git a/src/Modules/OptionItems/OptionFloatItem.cs b/src/Modules/OptionItems/OptionFloatItem.cs
index ed1d9a2..2fb3a9a 100644
--- a/src/Modules/OptionItems/OptionFloatItem.cs
+++ b/src/Modules/OptionItems/OptionFloatItem.cs
@@ -6,12 +6,12 @@ namespace BetterAmongUs.Modules.OptionItems;
internal class OptionFloatItem : OptionItem
{
internal override bool ShowChildren => base.ShowChildren && Value > 0f;
- protected FloatRange Range { get; set; }
+ protected FloatRange? Range { get; set; }
protected float Increment { get; set; }
protected bool CanBeInfinite { get; set; }
protected (string prefix, string postfix) Fixs { get; set; }
- internal static OptionFloatItem Create(int id, OptionTab tab, string tranStr, (float minValue, float maxValue, float incrementValue) Min_Max_Increment, float defaultValue, (string prefix, string postfix) Prefix_Postfix = new(), OptionItem parent = null, bool canBeInfinite = false)
+ internal static OptionFloatItem Create(int id, OptionTab tab, string tranStr, (float minValue, float maxValue, float incrementValue) Min_Max_Increment, float defaultValue, (string prefix, string postfix) Prefix_Postfix = new(), OptionItem? parent = null, bool canBeInfinite = false)
{
if (GetOptionById(id) is OptionFloatItem floatItem)
{
diff --git a/src/Modules/OptionItems/OptionIntItem.cs b/src/Modules/OptionItems/OptionIntItem.cs
index 2546930..e439ac7 100644
--- a/src/Modules/OptionItems/OptionIntItem.cs
+++ b/src/Modules/OptionItems/OptionIntItem.cs
@@ -6,12 +6,12 @@ namespace BetterAmongUs.Modules.OptionItems;
internal sealed class OptionIntItem : OptionItem
{
internal sealed override bool ShowChildren => base.ShowChildren && Value > 0;
- protected IntRange Range { get; set; }
- protected int Increment { get; set; }
- protected bool CanBeInfinite { get; set; }
- protected (string prefix, string postfix) Fixs { get; set; }
+ private IntRange? Range { get; set; }
+ private int Increment { get; set; }
+ private bool CanBeInfinite { get; set; }
+ private (string prefix, string postfix) Fixs { get; set; }
- internal static OptionIntItem Create(int id, OptionTab tab, string tranStr, (int minValue, int maxValue, int incrementValue) Min_Max_Increment, int defaultValue, (string prefix, string postfix) Prefix_Postfix = new(), OptionItem parent = null, bool canBeInfinite = false)
+ internal static OptionIntItem Create(int id, OptionTab tab, string tranStr, (int minValue, int maxValue, int incrementValue) Min_Max_Increment, int defaultValue, (string prefix, string postfix) Prefix_Postfix = new(), OptionItem? parent = null, bool canBeInfinite = false)
{
if (GetOptionById(id) is OptionIntItem intItem)
{
diff --git a/src/Modules/OptionItems/OptionItem.cs b/src/Modules/OptionItems/OptionItem.cs
index 3a1b705..b96fdf4 100644
--- a/src/Modules/OptionItems/OptionItem.cs
+++ b/src/Modules/OptionItems/OptionItem.cs
@@ -123,7 +123,7 @@ internal abstract class OptionItem
List treeNodes = [];
- void CollectTreeData(OptionItem option, int depth, bool isLastChild, TreeNode parent)
+ void CollectTreeData(OptionItem option, int depth, bool isLastChild, TreeNode? parent)
{
var node = new TreeNode
{
@@ -190,7 +190,7 @@ internal abstract class OptionItem
List treeNodes = [];
- void CollectTreeData(OptionItem option, int depth, bool isLastChild, TreeNode parent)
+ void CollectTreeData(OptionItem option, int depth, bool isLastChild, TreeNode? parent)
{
var node = new TreeNode
{
@@ -363,7 +363,7 @@ internal abstract class OptionItem
class TreeNode
{
internal TreeNode? ParentNode { get; set; }
- internal string Text { get; set; }
+ internal string? Text { get; set; }
internal int Depth { get; set; }
internal bool IsLastChild { get; set; }
}
@@ -433,7 +433,7 @@ internal abstract class OptionItem : OptionItem
internal virtual void SetValue(T newValue)
{
- T oldValue = Value;
+ T? oldValue = Value;
Value = newValue;
UpdateVisuals();
PopNotification();
diff --git a/src/Modules/OptionItems/OptionPercentItem.cs b/src/Modules/OptionItems/OptionPercentItem.cs
index 0cb3db1..3c766d3 100644
--- a/src/Modules/OptionItems/OptionPercentItem.cs
+++ b/src/Modules/OptionItems/OptionPercentItem.cs
@@ -2,7 +2,7 @@
internal sealed class OptionPercentItem : OptionFloatItem
{
- internal static OptionPercentItem Create(int id, OptionTab tab, string tranStr, float defaultValue, OptionItem parent = null)
+ internal static OptionPercentItem Create(int id, OptionTab tab, string tranStr, float defaultValue, OptionItem? parent = null)
{
if (GetOptionById(id) is OptionPercentItem floatItem)
{
diff --git a/src/Modules/OptionItems/OptionPlayerItem.cs b/src/Modules/OptionItems/OptionPlayerItem.cs
index 6f85edd..0d3b724 100644
--- a/src/Modules/OptionItems/OptionPlayerItem.cs
+++ b/src/Modules/OptionItems/OptionPlayerItem.cs
@@ -8,12 +8,12 @@ internal sealed class OptionPlayerItem : OptionItem
internal sealed override bool ShowChildren => base.ShowChildren && Value > Min;
private int Max => BAUPlugin.AllPlayerControls.Count - 1;
private int Min => CanBeRandom ? -1 : 0;
- protected bool CanBeRandom { get; set; }
+ private bool CanBeRandom { get; set; }
internal override bool CanLoad => false;
private static List optionPlayerItems = [];
- internal static OptionPlayerItem Create(int id, OptionTab tab, string tranStr, OptionItem parent = null, bool canBeRandom = true)
+ internal static OptionPlayerItem Create(int id, OptionTab tab, string tranStr, OptionItem? parent = null, bool canBeRandom = true)
{
if (optionPlayerItems.FirstOrDefault(opt => opt.Id == id) is OptionPlayerItem playerItem)
{
diff --git a/src/Modules/OptionItems/OptionStringItem.cs b/src/Modules/OptionItems/OptionStringItem.cs
index 08af31a..3e094d3 100644
--- a/src/Modules/OptionItems/OptionStringItem.cs
+++ b/src/Modules/OptionItems/OptionStringItem.cs
@@ -4,11 +4,11 @@ namespace BetterAmongUs.Modules.OptionItems;
internal sealed class OptionStringItem : OptionItem
{
- protected IntRange Range { get; set; } = new();
- protected string[] TranslatorStrings { get; set; } = [];
- protected bool CanBeRandom { get; set; }
+ private IntRange Range { get; set; } = new();
+ private string[] TranslatorStrings { get; set; } = [];
+ private bool CanBeRandom { get; set; }
- internal static OptionStringItem Create(int id, OptionTab tab, string tranStr, string[] tranStrings, int defaultValue, OptionItem parent = null, bool canBeRandom = false)
+ internal static OptionStringItem Create(int id, OptionTab tab, string tranStr, string[] tranStrings, int defaultValue, OptionItem? parent = null, bool canBeRandom = false)
{
if (tranStrings.Length < 2)
{
diff --git a/src/Mono/PlayerInfoDisplay.cs b/src/Mono/PlayerInfoDisplay.cs
index 823f079..fbc5c24 100644
--- a/src/Mono/PlayerInfoDisplay.cs
+++ b/src/Mono/PlayerInfoDisplay.cs
@@ -27,7 +27,6 @@ internal class PlayerInfoDisplay : MonoBehaviour
private readonly StringBuilder _sbTagBottom = new(256);
private string _lastTopText = "", _lastBottomText = "", _lastInfoText = "";
private int _lastUpdateFrame;
- private bool _lastPlayerState;
private const int UPDATE_COOLDOWN = 10;
// Cached regex patterns
diff --git a/src/Patches/Client/ClientOptionsPatch.cs b/src/Patches/Client/ClientOptionsPatch.cs
index ce64c4a..be19d49 100644
--- a/src/Patches/Client/ClientOptionsPatch.cs
+++ b/src/Patches/Client/ClientOptionsPatch.cs
@@ -30,6 +30,7 @@ internal static class OptionsMenuBehaviourPatch
[HarmonyPrefix]
private static void Start_Postfix(OptionsMenuBehaviour __instance)
{
+ /*
static bool toggleCheckInGamePlay(string buttonName)
{
bool flag = GameState.IsInGame && !GameState.IsLobby || GameState.IsFreePlay;
@@ -38,6 +39,8 @@ internal static class OptionsMenuBehaviourPatch
return flag;
}
+ */
+
static bool toggleCheckInGame(string buttonName)
{
bool flag = GameState.IsInGame;
diff --git a/src/Patches/Client/MainMenuPatch.cs b/src/Patches/Client/MainMenuPatch.cs
index 66ad91a..6cc910c 100644
--- a/src/Patches/Client/MainMenuPatch.cs
+++ b/src/Patches/Client/MainMenuPatch.cs
@@ -8,7 +8,6 @@ namespace BetterAmongUs.Patches.Client;
[HarmonyPatch(typeof(MainMenuManager))]
internal static class MainMenuPatch
{
- private static SpriteRenderer? sprite;
internal static PassiveButton? ButtonPrefab;
[HarmonyPatch(nameof(MainMenuManager.LateUpdate))]
diff --git a/src/Patches/Gameplay/UI/Settings/GameSettingMenuPatch.cs b/src/Patches/Gameplay/UI/Settings/GameSettingMenuPatch.cs
index 7b7eeb8..bdeb5c3 100644
--- a/src/Patches/Gameplay/UI/Settings/GameSettingMenuPatch.cs
+++ b/src/Patches/Gameplay/UI/Settings/GameSettingMenuPatch.cs
@@ -26,7 +26,6 @@ class BetterGameSettings
internal static OptionCheckboxItem? CensorDetectionReason;
internal static OptionCheckboxItem? RemovePetOnDeath;
internal static OptionCheckboxItem? DisableSabotages;
- internal static OptionCheckboxItem? ShowRoleForClients;
}
class BetterGameSettingsTemp
@@ -44,7 +43,7 @@ internal static class GameSettingMenuPatch
internal static void SetupSettings(bool IsPreload = false)
{
- // Use 1800 next ID
+ // Use 1700 next ID
BetterSettingsTab = OptionTab.Create(3, "BetterSetting", "BetterSetting.Description", Color.green);
@@ -63,12 +62,6 @@ internal static class GameSettingMenuPatch
BetterGameSettings.UseBanNameList = OptionCheckboxItem.Create(400, BetterSettingsTab, "BetterSetting.Setting.UseBanNameList", true);
BetterGameSettings.UseBanWordList = OptionCheckboxItem.Create(500, BetterSettingsTab, "BetterSetting.Setting.UseBanWordList", true);
BetterGameSettings.UseBanWordListOnlyLobby = OptionCheckboxItem.Create(1400, BetterSettingsTab, "BetterSetting.Setting.UseBanWordListOnlyLobby", true, BetterGameSettings.UseBanWordList);
-
- /*
- OptionDividerItem.Create(BetterSettingsTab);
- BetterGameSettings.ShowRoleForClients = OptionCheckboxItem.Create(1700, BetterSettingsTab, "BetterSetting.Setting.ShowRoleForClients", false);
- OptionDividerItem.Create(BetterSettingsTab);
- */
}
OptionTitleItem.Create(BetterSettingsTab, "BetterSetting.TextHeader.Detections");
diff --git a/src/Patches/Managers/RoleManagerPatch.cs b/src/Patches/Managers/RoleManagerPatch.cs
index 47f7210..6259762 100644
--- a/src/Patches/Managers/RoleManagerPatch.cs
+++ b/src/Patches/Managers/RoleManagerPatch.cs
@@ -126,7 +126,7 @@ internal static class RoleManagerPatch
if (Impostors.Count < NumImpostors && RNG() > ImpostorMultiplier[Utils.GetHashPuid(pc)])
{
- var impRoles = Shuffle(ImpostorRoles);
+ var impRoles = ImpostorRoles.Shuffle();
foreach (var kvp in impRoles)
{
if (RNG() <= GameOptionsManager.Instance.CurrentGameOptions.RoleOptions.GetChancePerGame(kvp.Key) && kvp.Value > 0)
@@ -163,7 +163,7 @@ internal static class RoleManagerPatch
}
else
{
- var crewRoles = Shuffle(CrewmateRoles);
+ var crewRoles = CrewmateRoles.Shuffle();
foreach (var kvp in crewRoles)
{
if (RNG() <= GameOptionsManager.Instance.CurrentGameOptions.RoleOptions.GetChancePerGame(kvp.Key) && kvp.Value > 0)
@@ -316,7 +316,7 @@ internal static class RoleManagerPatch
}
}
- var ghostRoles = Shuffle(GhostRoles);
+ var ghostRoles = GhostRoles.Shuffle();
foreach (var kvp in ghostRoles)
{
@@ -346,29 +346,6 @@ internal static class RoleManagerPatch
private static bool IsImpostorRole(RoleTypes role) => role is RoleTypes.Impostor or RoleTypes.Shapeshifter or RoleTypes.Phantom or RoleTypes.Viper;
- private static Dictionary Shuffle(Dictionary dictionary)
- {
- List keys = dictionary.Keys.ToList();
-
- // Fisher-Yates shuffle algorithm
- for (int i = keys.Count - 1; i > 0; i--)
- {
- int j = random.Next(0, i + 1);
- TKey temp = keys[i];
- keys[i] = keys[j];
- keys[j] = temp;
- }
-
- // Rebuild dictionary with shuffled keys
- var shuffledDictionary = new Dictionary();
- foreach (var key in keys)
- {
- shuffledDictionary[key] = dictionary[key];
- }
-
- return shuffledDictionary;
- }
-
internal static int RNG()
{
switch (BetterGameSettings.RoleRandomizer.GetStringValue())