Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Prop Hunt HUD Plagin v1.0.1
PropHuntHUD.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using Empress.REPO.PropHunt; using ExitGames.Client.Photon; using HarmonyLib; using Photon.Pun; using Photon.Realtime; using TMPro; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("PropHuntHUD")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PropHuntHUD")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("edb4e688-84f8-47ad-8640-e6571290f8d7")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace PropHuntCustomHUD; [BepInPlugin("com.alpakatitikaka.prophunt.hud", "PropHunt Better HUD", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class PropHuntGUIPlagin : BaseUnityPlugin { [HarmonyPatch(typeof(PropHuntManager), "ApplyRoomState")] public static class PropHuntApplyRoomStatePatch { [HarmonyPostfix] public static void Postfix() { if ((Object)(object)Instance == (Object)null || Instance.roleShownThisRound || PhotonNetwork.CurrentRoom == null || !((Dictionary<object, object>)(object)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties).ContainsKey((object)"PH_Hunter")) { return; } int num = (int)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties[(object)"PH_Hunter"]; if (num <= 0) { return; } bool flag = false; Player[] playerList = PhotonNetwork.PlayerList; for (int i = 0; i < playerList.Length; i++) { if (playerList[i].ActorNumber == num) { flag = true; break; } } if (flag) { Instance.roleShownThisRound = true; ((MonoBehaviour)Instance).StartCoroutine(Instance.ShowRoleAnnouncement()); } } } [HarmonyPatch(typeof(PropHuntManager), "DeactivateManager")] public static class PropHuntStartPatch { [HarmonyPostfix] public static void Postfix() { if (!((Object)(object)Instance == (Object)null)) { Instance.roleShownThisRound = false; } } } [HarmonyPatch(typeof(ValuableObject), "Start")] public static class RepoValuableDiscoverPatch { [HarmonyPostfix] public static void Postfix(ValuableObject __instance) { if (!((Object)(object)Instance == (Object)null) && ValuableDiscover.Value) { FieldInfo fieldInfo = AccessTools.Field(((object)__instance).GetType(), "discovered"); if (fieldInfo != null) { fieldInfo.SetValue(__instance, true); } } } } [HarmonyPatch(typeof(ValuableObject), "DiscoverReminderLogic")] public static class RepoValuableDiscoverReminderPatch { [HarmonyPostfix] public static void Postfix(ValuableObject __instance) { if (!((Object)(object)Instance == (Object)null) && ValuableDiscover.Value) { FieldInfo fieldInfo = AccessTools.Field(((object)__instance).GetType(), "discoveredReminder"); if (fieldInfo != null) { fieldInfo.SetValue(__instance, false); } } } } [HarmonyPatch(typeof(ValuableDiscoverCustom), "Awake")] public static class RepoValuableDiscoverCustomPatch { [HarmonyPostfix] public static void Postfix(ValuableDiscoverCustom __instance) { if (!((Object)(object)Instance == (Object)null) && ValuableDiscover.Value) { FieldInfo fieldInfo = AccessTools.Field(((object)__instance).GetType(), "discovered"); if (fieldInfo != null) { fieldInfo.SetValue(__instance, true); } } } } [HarmonyPatch(typeof(MapModule), "Update")] public static class RepoRoomExploredPatch { [HarmonyPostfix] public static void Postfix(MapModule __instance) { if (!((Object)(object)Instance == (Object)null) && ExploredMap.Value) { __instance.Hide(); } } } [HarmonyPatch(typeof(PhysGrabObject), "Awake")] public static class RepoCartDestroyPatch { [HarmonyPostfix] public static void Postfix(PhysGrabObject __instance) { if ((Object)(object)Instance == (Object)null || !CartDestroy.Value) { return; } FieldInfo fieldInfo = AccessTools.Field(((object)__instance).GetType(), "isCart"); if (fieldInfo != null && (bool)fieldInfo.GetValue(__instance)) { FieldInfo fieldInfo2 = AccessTools.Field(((object)__instance).GetType(), "dead"); if (fieldInfo2 != null) { fieldInfo2.SetValue(__instance, true); } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Start")] public static class RepoValuableDestroyPatch { [HarmonyPostfix] public static void Postfix(PhysGrabObjectImpactDetector __instance) { if ((Object)(object)Instance == (Object)null || !ValuablesGodMod.Value) { return; } FieldInfo fieldInfo = AccessTools.Field(((object)__instance).GetType(), "isValuable"); if (fieldInfo != null && (bool)fieldInfo.GetValue(__instance)) { FieldInfo fieldInfo2 = AccessTools.Field(((object)__instance).GetType(), "destroyDisable"); if (fieldInfo2 != null) { fieldInfo2.SetValue(__instance, true); } } } } [CompilerGenerated] private sealed class <>c__DisplayClass68_0 { public int hunterActor; internal bool <ShowRoleAnnouncement>b__0(Player p) { return p.ActorNumber == hunterActor; } } [CompilerGenerated] private sealed class <ShowCenterText>d__69 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public string message; private GameObject <canvasObj>5__2; private TextMeshProUGUI <tmp>5__3; private float <duration>5__4; private float <startTime>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ShowCenterText>d__69(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <canvasObj>5__2 = null; <tmp>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <canvasObj>5__2 = new GameObject("PropHuntRoleHUD"); Object.DontDestroyOnLoad((Object)(object)<canvasObj>5__2); Canvas obj = <canvasObj>5__2.AddComponent<Canvas>(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 1000; GameObject val = new GameObject("RoleText"); val.transform.SetParent(<canvasObj>5__2.transform); <tmp>5__3 = val.AddComponent<TextMeshProUGUI>(); ((TMP_Text)<tmp>5__3).text = message; ((TMP_Text)<tmp>5__3).alignment = (TextAlignmentOptions)514; ((TMP_Text)<tmp>5__3).fontSizeMax = 999f; RectTransform component = ((Component)<tmp>5__3).GetComponent<RectTransform>(); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); component.anchorMax = val2; component.anchorMin = val2; component.anchoredPosition = Vector2.zero; component.sizeDelta = new Vector2(1200f, 400f); <duration>5__4 = DisplayDuration.Value; <startTime>5__5 = Time.time; break; } case 1: <>1__state = -1; break; } if (Time.time - <startTime>5__5 < <duration>5__4) { float alpha = Mathf.Sin((Time.time - <startTime>5__5) / <duration>5__4 * (float)Math.PI) * 0.7f + 0.3f; ((TMP_Text)<tmp>5__3).alpha = alpha; <>2__current = null; <>1__state = 1; return true; } Object.Destroy((Object)(object)<canvasObj>5__2); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <ShowRoleAnnouncement>d__68 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PropHuntGUIPlagin <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ShowRoleAnnouncement>d__68(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; PropHuntGUIPlagin propHuntGUIPlagin = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; if (Time.time - propHuntGUIPlagin.lastAnnouncementTime < 2f) { return false; } propHuntGUIPlagin.lastAnnouncementTime = Time.time; if (PhotonNetwork.CurrentRoom == null) { return false; } string text = null; try { <>c__DisplayClass68_0 CS$<>8__locals0 = new <>c__DisplayClass68_0(); Player localPlayer = PhotonNetwork.LocalPlayer; if (localPlayer == null) { return false; } Room currentRoom = PhotonNetwork.CurrentRoom; Hashtable val = ((currentRoom != null) ? ((RoomInfo)currentRoom).CustomProperties : null); CS$<>8__locals0.hunterActor = ((val != null && ((Dictionary<object, object>)(object)val).ContainsKey((object)"PH_Hunter")) ? ((int)val[(object)"PH_Hunter"]) : (-1)); bool num2 = localPlayer.ActorNumber == CS$<>8__locals0.hunterActor; string arg = "???"; if (!num2 && CS$<>8__locals0.hunterActor > 0) { Player val2 = ((IEnumerable<Player>)PhotonNetwork.PlayerList).FirstOrDefault((Func<Player, bool>)((Player p) => p.ActorNumber == CS$<>8__locals0.hunterActor)); if (val2 != null) { arg = val2.NickName; } } if (num2) { text = $"<color=#{ColorUtility.ToHtmlStringRGB(HunterColor.Value)}><size={MainFontSize.Value}>{HunterText.Value}</size></color>"; } else { string text2 = $"<color=#{ColorUtility.ToHtmlStringRGB(PropColor.Value)}><size={MainFontSize.Value}>{PropText.Value}</size></color>"; string text3 = $"<color=#{ColorUtility.ToHtmlStringRGB(HunterNameColor.Value)}><size={HunterNameFontSize.Value}>Hunter: {arg}</size></color>"; text = text2 + "\n" + text3; } } catch (Exception ex) { ((BaseUnityPlugin)propHuntGUIPlagin).Logger.LogError((object)("Error in ShowRoleAnnouncement: " + ex.Message)); return false; } if (text != null) { <>2__current = ((MonoBehaviour)propHuntGUIPlagin).StartCoroutine(propHuntGUIPlagin.ShowCenterText(text)); <>1__state = 1; return true; } break; } case 1: <>1__state = -1; break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private float lastAnnouncementTime; internal bool roleShownThisRound; private Harmony harmony; private AudioSource menuMusicSource; public static PropHuntGUIPlagin Instance { get; private set; } public static ConfigEntry<bool> EnableMod { get; private set; } public static ConfigEntry<float> DisplayDuration { get; private set; } public static ConfigEntry<string> HunterText { get; private set; } public static ConfigEntry<string> PropText { get; private set; } public static ConfigEntry<Color> HunterColor { get; private set; } public static ConfigEntry<Color> PropColor { get; private set; } public static ConfigEntry<Color> HunterNameColor { get; private set; } public static ConfigEntry<int> MainFontSize { get; private set; } public static ConfigEntry<int> HunterNameFontSize { get; private set; } public static ConfigEntry<float> MenuMusicVolume { get; private set; } public static ConfigEntry<bool> ValuableDiscover { get; private set; } public static ConfigEntry<bool> ExploredMap { get; private set; } public static ConfigEntry<bool> CartDestroy { get; private set; } public static ConfigEntry<bool> ValuablesGodMod { get; private set; } private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown Instance = this; harmony = new Harmony("com.alpakatitikaka.prophunt.hud"); harmony.PatchAll(); SetupConfig(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"PropHuntBetterHUD loaded"); } private void Update() { if (Time.frameCount % 60 == 0) { ApplyMenuMusicVolume(); } } private void SetupConfig() { //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Expected O, but got Unknown EnableMod = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Включить мод"); DisplayDuration = ((BaseUnityPlugin)this).Config.Bind<float>("General", "DisplayDuration", 6f, "Сколько секунд показывать надпись"); ValuableDiscover = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay", "ValuableDiscover", true, "Убрать подстветку предметов"); ValuablesGodMod = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay", "ValuablesGodMod", true, "Убрать у предметов возможность ломаться"); ExploredMap = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay", "ExploredMap", true, "Раскрыть карту"); CartDestroy = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay", "CartDestroy", true, "Удалить тележку"); HunterText = ((BaseUnityPlugin)this).Config.Bind<string>("Text", "HunterText", "YOU'RE HUNTER", "Текст для охотника"); PropText = ((BaseUnityPlugin)this).Config.Bind<string>("Text", "PropText", "YOU'RE PROP", "Текст для пропа"); HunterColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "HunterColor", Color.red, "Цвет текста охотника"); PropColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "PropColor", Color.blue, "Цвет текста пропа"); HunterNameColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "HunterNameColor", new Color(1f, 0.5f, 0f), "Цвет имени охотника (оранжевый)"); MainFontSize = ((BaseUnityPlugin)this).Config.Bind<int>("Text", "MainFontSize", 70, "Размер основного текста"); HunterNameFontSize = ((BaseUnityPlugin)this).Config.Bind<int>("Text", "HunterNameFontSize", 50, "Размер текста 'Hunter: Имя'"); MenuMusicVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Music", "MenuMusicVolume", 0.2f, new ConfigDescription("Громкость музыки в главном меню (0.0 - 1.0)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); } private void ApplyMenuMusicVolume() { try { float num = Mathf.Clamp01(MenuMusicVolume.Value); if ((Object)(object)menuMusicSource != (Object)null) { if (Mathf.Abs(menuMusicSource.volume - num) > 0.01f) { menuMusicSource.volume = num; ((BaseUnityPlugin)this).Logger.LogInfo((object)$"[Cached] Menu music volume set to {num:F2}"); } return; } AudioSource[] array = Object.FindObjectsOfType<AudioSource>(true); foreach (AudioSource val in array) { if (!((Object)(object)val == (Object)null) && !((Object)(object)val.clip == (Object)null) && (((Object)val.clip).name == "OmniLala" || ((Object)((Component)val).gameObject).name == "MainMenuMusic_Swap")) { menuMusicSource = val; val.volume = num; ((BaseUnityPlugin)this).Logger.LogInfo((object)$"Main Menu Music found! Volume set to {num:F2}"); break; } } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Music sync error: " + ex.Message)); } } [IteratorStateMachine(typeof(<ShowRoleAnnouncement>d__68))] internal IEnumerator ShowRoleAnnouncement() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ShowRoleAnnouncement>d__68(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<ShowCenterText>d__69))] private IEnumerator ShowCenterText(string message) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ShowCenterText>d__69(0) { message = message }; } }