RUMBLE does not support other mod managers. If you want to use a manager, you must use the RUMBLE Mod Manager, a manager specifically designed for this game.
Decompiled source of RumbleHud v1.4.0
Mods/RumbleHud.dll
Decompiled a month agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Xml.Serialization; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppPhoton.Pun; using Il2CppRUMBLE.Managers; using Il2CppRUMBLE.Players; using Il2CppSystem.Collections.Generic; using Il2CppSystem.IO; using Il2CppTMPro; using MelonLoader; using Microsoft.CodeAnalysis; using RumbleHud; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(Core), "RumbleHud", "1.4.0", "Kpaiy", null)] [assembly: MelonGame("Buckethead Entertainment", "RUMBLE")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("RumbleHud")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ebacf0e3add48a9c76e6387a73afb62684330109")] [assembly: AssemblyProduct("RumbleHud")] [assembly: AssemblyTitle("RumbleHud")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace RumbleHud { public class Core : MelonMod { private PlayerManager playerManager = null; private List<PlayerInfo> playerInfos = null; private string settingsFilePath = "UserData\\RumbleHud.xml"; private string currentScene = "Loader"; public override void OnInitializeMelon() { ((MelonBase)this).LoggerInstance.Msg("RumbleHud: Initialized."); try { Settings.FromXmlFile(settingsFilePath); ((MelonBase)this).LoggerInstance.Msg("RumbleHud: Loaded settings from file."); } catch { Settings.Initialize(); ((MelonBase)this).LoggerInstance.Msg("RumbleHud: Unable to load settings. Using defaults."); } } public override void OnApplicationQuit() { Settings.Instance.ToXmlFile(settingsFilePath); ((MelonBase)this).OnApplicationQuit(); } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { currentScene = sceneName; if (!(sceneName != "Gym")) { Hud.ClearPlayerUi(includeSelfPlayer: true); Hud.LoadPreviewCharacter(); } } private bool IsHost(int playerCount, string playFabId, PlayerController playerController) { switch (playerCount) { case 1: return false; case 2: { bool isMasterClient = PhotonNetwork.IsMasterClient; bool flag = playFabId == Hud.SelfPlayFabId; return (isMasterClient && flag) || (!isMasterClient && !flag); } default: { object obj; if (playerController == null) { obj = null; } else { GameObject gameObject = ((Component)playerController).gameObject; obj = ((gameObject != null) ? gameObject.GetComponent<PhotonView>() : null); } PhotonView val = (PhotonView)obj; if ((Object)(object)val == (Object)null) { return false; } return val.OwnerActorNr == 1; } } } public override void OnUpdate() { if ((Object)(object)playerManager == (Object)null) { GameObject obj = GameObject.Find("Game Instance/Initializable/PlayerManager"); playerManager = ((obj != null) ? obj.GetComponent<PlayerManager>() : null); if ((Object)(object)playerManager == (Object)null) { return; } } if (!Resources.Initialized) { Resources.LoadResources(); } if (!Hud.Initialized) { Hud.Initialize(); } if (Input.GetKeyDown((KeyCode)105)) { Hud.ToggleVisible(); } if (Input.GetKeyDown((KeyCode)111)) { switch (Settings.Instance.HostIndicator) { case HostIndicatorOptions.None: Settings.Instance.HostIndicator = HostIndicatorOptions.Text; break; case HostIndicatorOptions.Text: Settings.Instance.HostIndicator = HostIndicatorOptions.Icon; break; case HostIndicatorOptions.Icon: Settings.Instance.HostIndicator = HostIndicatorOptions.Both; break; case HostIndicatorOptions.Both: Settings.Instance.HostIndicator = HostIndicatorOptions.None; break; } } if (Input.GetKeyDown((KeyCode)112)) { Hud.RegeneratePortraits(currentScene == "Gym"); } if (Input.GetKeyDown((KeyCode)61)) { Hud.SetScale(Settings.Instance.HudScale + 0.1f); } if (Input.GetKeyDown((KeyCode)45)) { Hud.SetScale(Settings.Instance.HudScale - 0.1f); } try { List<PlayerInfo> list = new List<PlayerInfo>(); PlayerManager obj2 = playerManager; Enumerator<Player> val = ((obj2 == null) ? null : obj2.AllPlayers?.GetEnumerator()); if (val == null) { return; } while (val.MoveNext()) { Player current = val.Current; string playFabMasterId = current.Data.GeneralData.PlayFabMasterId; if (playerManager.AllPlayers.Count == 1) { Hud.SelfPlayFabId = playFabMasterId; } bool isHost = IsHost(playerManager.AllPlayers.Count, playFabMasterId, current.Controller); PlayerInfo item = new PlayerInfo { PlayFabId = playFabMasterId, Name = current.Data.GeneralData.PublicUsername, BP = current.Data.GeneralData.BattlePoints, HP = current.Data.HealthPoints, ShiftStoneLeft = (ShiftStones)((Il2CppArrayBase<short>)(object)current.Data.EquipedShiftStones)[0], ShiftStoneRight = (ShiftStones)((Il2CppArrayBase<short>)(object)current.Data.EquipedShiftStones)[1], PlayerController = current.Controller, IsHost = isHost }; list.Add(item); } playerInfos = list; } catch (Exception) { } try { if (playerInfos.Count != Hud.PlayerUiElementsCount) { Hud.ClearPlayerUi(); if (Settings.Instance.HideSolo) { Hud.SetVisible(playerInfos.Count != 1); } } foreach (PlayerInfo playerInfo in playerInfos) { if (!Hud.PlayerHudExists(playerInfo.PlayFabId)) { Hud.CreatePlayerUi(playerInfo, Hud.PlayerUiElementsCount); ((MelonBase)this).LoggerInstance.Msg("RumbleHud: Created Element for player " + playerInfo.Name + "."); continue; } try { Hud.UpdatePlayerUi(playerInfo); } catch (Exception) { } } } catch (Exception) { } } } internal class Hud { private static GameObject uiContainer = null; private static Canvas canvas = null; private static bool initialized = false; private static readonly int playerControllerLayerMask = LayerMask.NameToLayer("PlayerController"); private const int playerControllerLayer = 8388608; private static Dictionary<string, PlayerUiElements> uiElementsByPlayer = new Dictionary<string, PlayerUiElements>(); private static GameObject previewRenderer = null; private static GameObject previewHead = null; private const int portraitGenerationTime = -30; public static bool Initialized => initialized; public static int PlayerUiElementsCount => uiElementsByPlayer.Count; public static string SelfPlayFabId { get; set; } public static void Initialize() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { uiContainer = new GameObject(); ((Object)uiContainer).name = "RumbleHud_Canvas"; uiContainer.AddComponent<Canvas>(); canvas = uiContainer.GetComponent<Canvas>(); canvas.renderMode = (RenderMode)0; CanvasScaler val = uiContainer.AddComponent<CanvasScaler>(); val.uiScaleMode = (ScaleMode)1; val.referenceResolution = new Vector2(1920f, 1008f); uiContainer.AddComponent<GraphicRaycaster>(); Object.DontDestroyOnLoad((Object)(object)uiContainer); Object.DontDestroyOnLoad((Object)(object)canvas); initialized = true; } } public static void ToggleVisible() { if (!((Object)(object)uiContainer == (Object)null)) { uiContainer.SetActive(!uiContainer.activeSelf); } } public static void SetVisible(bool visible) { if (!((Object)(object)uiContainer == (Object)null)) { uiContainer.SetActive(visible); } } public static void SetScale(float newScale) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Settings.Instance.HudScale = newScale; foreach (PlayerUiElements value in uiElementsByPlayer.Values) { value.Container.transform.localScale = new Vector3(newScale, newScale, newScale); int num = (int)((float)(value.Position / 2 * 150 * -1) * newScale); RectTransform component = ((Component)value.Background).GetComponent<RectTransform>(); if (value.IsRightAligned) { component.anchoredPosition = Vector2.op_Implicit(new Vector3(0f, (float)(-50 + num), 0f)); } else { component.anchoredPosition = Vector2.op_Implicit(new Vector3(0f, (float)(-50 + num), 0f)); } } } public static void LoadPreviewCharacter() { previewHead = GameObject.Find("--------------LOGIC--------------/Dressing Room/Preview Player Controller/Visuals/Skelington/Bone_Pelvis/Bone_Spine_A/Bone_Chest/Bone_Neck/Bone_Head"); previewRenderer = GameObject.Find("--------------LOGIC--------------/Dressing Room/Preview Player Controller/Visuals/Renderer"); if ((Object)(object)previewRenderer != (Object)null && previewRenderer.layer != playerControllerLayerMask) { previewRenderer.layer = playerControllerLayerMask; } } public static bool PlayerHudExists(string playFabId) { return uiElementsByPlayer.ContainsKey(playFabId); } public static void CreatePlayerUi(PlayerInfo playerInfo, int position) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Expected O, but got Unknown //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Expected O, but got Unknown //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Expected O, but got Unknown //IL_065c: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_06aa: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06d8: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_0762: Expected O, but got Unknown //IL_07c3: Unknown result type (might be due to invalid IL or missing references) //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_0870: Unknown result type (might be due to invalid IL or missing references) //IL_0887: Unknown result type (might be due to invalid IL or missing references) //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Unknown result type (might be due to invalid IL or missing references) //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_089a: Expected O, but got Unknown //IL_08fb: Unknown result type (might be due to invalid IL or missing references) //IL_097a: Unknown result type (might be due to invalid IL or missing references) //IL_0991: Unknown result type (might be due to invalid IL or missing references) //IL_09a8: Unknown result type (might be due to invalid IL or missing references) //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_091a: Unknown result type (might be due to invalid IL or missing references) //IL_0931: Unknown result type (might be due to invalid IL or missing references) //IL_0948: Unknown result type (might be due to invalid IL or missing references) //IL_095f: Unknown result type (might be due to invalid IL or missing references) //IL_09cb: Unknown result type (might be due to invalid IL or missing references) //IL_09d2: Expected O, but got Unknown //IL_0a1c: Unknown result type (might be due to invalid IL or missing references) //IL_0a43: Unknown result type (might be due to invalid IL or missing references) //IL_0a48: Unknown result type (might be due to invalid IL or missing references) //IL_0a82: Unknown result type (might be due to invalid IL or missing references) //IL_0b13: Unknown result type (might be due to invalid IL or missing references) //IL_0b2a: Unknown result type (might be due to invalid IL or missing references) //IL_0b41: Unknown result type (might be due to invalid IL or missing references) //IL_0b58: Unknown result type (might be due to invalid IL or missing references) //IL_0b5d: Unknown result type (might be due to invalid IL or missing references) //IL_0aa1: Unknown result type (might be due to invalid IL or missing references) //IL_0ab8: Unknown result type (might be due to invalid IL or missing references) //IL_0acf: Unknown result type (might be due to invalid IL or missing references) //IL_0ae6: Unknown result type (might be due to invalid IL or missing references) //IL_0aeb: Unknown result type (might be due to invalid IL or missing references) //IL_0b7f: Unknown result type (might be due to invalid IL or missing references) //IL_0b86: Expected O, but got Unknown //IL_0be1: Unknown result type (might be due to invalid IL or missing references) //IL_0c60: Unknown result type (might be due to invalid IL or missing references) //IL_0c77: Unknown result type (might be due to invalid IL or missing references) //IL_0c8e: Unknown result type (might be due to invalid IL or missing references) //IL_0ca5: Unknown result type (might be due to invalid IL or missing references) //IL_0c00: Unknown result type (might be due to invalid IL or missing references) //IL_0c17: Unknown result type (might be due to invalid IL or missing references) //IL_0c2e: Unknown result type (might be due to invalid IL or missing references) //IL_0c45: Unknown result type (might be due to invalid IL or missing references) //IL_0cc0: Unknown result type (might be due to invalid IL or missing references) //IL_0cc7: Expected O, but got Unknown //IL_0ccf: Unknown result type (might be due to invalid IL or missing references) //IL_0cd6: Expected O, but got Unknown //IL_0d31: Unknown result type (might be due to invalid IL or missing references) //IL_0d38: Expected O, but got Unknown //IL_0d90: Unknown result type (might be due to invalid IL or missing references) //IL_0e0f: Unknown result type (might be due to invalid IL or missing references) //IL_0e26: Unknown result type (might be due to invalid IL or missing references) //IL_0e3d: Unknown result type (might be due to invalid IL or missing references) //IL_0e54: Unknown result type (might be due to invalid IL or missing references) //IL_0daf: Unknown result type (might be due to invalid IL or missing references) //IL_0dc6: Unknown result type (might be due to invalid IL or missing references) //IL_0ddd: Unknown result type (might be due to invalid IL or missing references) //IL_0df4: Unknown result type (might be due to invalid IL or missing references) //IL_0e78: Unknown result type (might be due to invalid IL or missing references) bool flag = position % 2 == 1; int num = (int)((float)(position / 2 * 150 * -1) * Settings.Instance.HudScale); GameObject val = new GameObject(); val.transform.parent = uiContainer.transform; ((Object)val).name = "RumbleHud_" + playerInfo.PlayFabId + "_background"; RawImage val2 = val.AddComponent<RawImage>(); val2.texture = (Texture)(object)Resources.BackgroundTexture; ((Graphic)val2).SetNativeSize(); RectTransform component = ((Component)val2).GetComponent<RectTransform>(); if (flag) { component.anchorMin = new Vector2(1f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(1f, 1f); component.anchoredPosition = Vector2.op_Implicit(new Vector3(0f, (float)(-50 + num), 0f)); val2.uvRect = new Rect(0f, 0f, -1f, 1f); } else { component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(0f, 1f); component.pivot = new Vector2(0f, 1f); component.anchoredPosition = Vector2.op_Implicit(new Vector3(0f, (float)(-50 + num), 0f)); } GameObject val3 = new GameObject(); val3.transform.parent = val.transform; ((Object)val3).name = "RumbleHud_" + playerInfo.PlayFabId + "_name"; TextMeshProUGUI val4 = val3.AddComponent<TextMeshProUGUI>(); ((TMP_Text)val4).font = Resources.TmpFont; ((TMP_Text)val4).text = playerInfo.Name; RectTransform component2 = ((Component)val4).GetComponent<RectTransform>(); component2.sizeDelta = new Vector2(300f, 50f); ((TMP_Text)val4).enableAutoSizing = true; ((TMP_Text)val4).fontSizeMax = 42f; ((TMP_Text)val4).fontSizeMin = 16f; if (flag) { component2.anchorMin = new Vector2(1f, 1f); component2.anchorMax = new Vector2(1f, 1f); component2.pivot = new Vector2(1f, 1f); component2.anchoredPosition = Vector2.op_Implicit(new Vector3(-100f, -10f)); ((TMP_Text)val4).alignment = (TextAlignmentOptions)260; } else { component2.anchorMin = new Vector2(0f, 1f); component2.anchorMax = new Vector2(0f, 1f); component2.pivot = new Vector2(0f, 1f); component2.anchoredPosition = Vector2.op_Implicit(new Vector3(100f, -10f)); ((TMP_Text)val4).alignment = (TextAlignmentOptions)257; } GameObject val5 = new GameObject(); val5.transform.parent = val.transform; ((Object)val5).name = "RumbleHud_" + playerInfo.PlayFabId + "_bp"; TextMeshProUGUI val6 = val5.AddComponent<TextMeshProUGUI>(); ((Graphic)val6).color = new Color(0.9843137f, 1f, 0.56078434f); ((TMP_Text)val6).font = Resources.TmpFont; ((TMP_Text)val6).text = $"{playerInfo.BP} BP"; ((TMP_Text)val6).enableAutoSizing = true; ((TMP_Text)val6).fontSizeMax = 36f; ((TMP_Text)val6).fontSizeMin = 16f; RectTransform component3 = ((Component)val6).GetComponent<RectTransform>(); component3.sizeDelta = new Vector2(125f, 50f); if (flag) { component3.anchorMin = new Vector2(0f, 1f); component3.anchorMax = new Vector2(0f, 1f); component3.pivot = new Vector2(0f, 1f); component3.anchoredPosition = Vector2.op_Implicit(new Vector3(25f, -10f)); ((TMP_Text)val6).alignment = (TextAlignmentOptions)257; } else { component3.anchorMin = new Vector2(1f, 1f); component3.anchorMax = new Vector2(1f, 1f); component3.pivot = new Vector2(1f, 1f); component3.anchoredPosition = Vector2.op_Implicit(new Vector3(-25f, -10f)); ((TMP_Text)val6).alignment = (TextAlignmentOptions)260; } GameObject val7 = new GameObject(); val7.transform.parent = val.transform; ((Object)val7).name = "RumbleHud_" + playerInfo.PlayFabId + "_healthBackground"; Image val8 = val7.AddComponent<Image>(); ((Graphic)val8).color = Resources.HealthFull; RectTransform component4 = ((Component)val8).GetComponent<RectTransform>(); component4.sizeDelta = new Vector2(340f, 10f); if (flag) { component4.anchorMin = new Vector2(0f, 0f); component4.anchorMax = new Vector2(0f, 0f); component4.pivot = new Vector2(0f, 0f); component4.anchoredPosition = new Vector2(25f, 20f); } else { component4.anchorMin = new Vector2(1f, 0f); component4.anchorMax = new Vector2(1f, 0f); component4.pivot = new Vector2(1f, 0f); component4.anchoredPosition = new Vector2(-25f, 20f); } GameObject val9 = new GameObject(); val9.transform.parent = val7.transform; ((Object)val9).name = "RumbleHud_" + playerInfo.PlayFabId + "_healthPips"; RawImage val10 = val9.AddComponent<RawImage>(); val10.texture = (Texture)(object)Resources.HealthPipsTexture; val10.uvRect = new Rect(0f, 0f, 20f, 1f); RectTransform component5 = ((Component)val10).GetComponent<RectTransform>(); component5.sizeDelta = new Vector2((float)(((Texture)Resources.HealthPipsTexture).width * 20), (float)((Texture)Resources.HealthPipsTexture).height); if (flag) { component5.anchorMin = new Vector2(1f, 0.5f); component5.anchorMax = new Vector2(1f, 0.5f); component5.pivot = new Vector2(1f, 0.5f); component5.anchoredPosition = new Vector2(0f, 0f); } else { component5.anchorMin = new Vector2(0f, 0.5f); component5.anchorMax = new Vector2(0f, 0.5f); component5.pivot = new Vector2(0f, 0.5f); component5.anchoredPosition = new Vector2(0f, 0f); } GameObject val11 = new GameObject(); val11.transform.parent = val.transform; ((Object)val11).name = "RumbleHud_" + playerInfo.PlayFabId + "_leftShiftStone"; RawImage val12 = val11.AddComponent<RawImage>(); val12.texture = (Texture)(object)Resources.GetShiftStoneTexture(playerInfo.ShiftStoneLeft); RectTransform component6 = val11.GetComponent<RectTransform>(); component6.sizeDelta = new Vector2(35f, 35f); if (flag) { component6.anchorMin = new Vector2(1f, 0f); component6.anchorMax = new Vector2(1f, 0f); component6.pivot = new Vector2(1f, 0f); component6.anchoredPosition = new Vector2(-140f, 10f); } else { component6.anchorMin = new Vector2(0f, 0f); component6.anchorMax = new Vector2(0f, 0f); component6.pivot = new Vector2(0f, 0f); component6.anchoredPosition = new Vector2(95f, 10f); } GameObject val13 = new GameObject(); val13.transform.parent = val.transform; ((Object)val13).name = "RumbleHud_" + playerInfo.PlayFabId + "_rightShiftStone"; RawImage val14 = val13.AddComponent<RawImage>(); val14.texture = (Texture)(object)Resources.GetShiftStoneTexture(playerInfo.ShiftStoneRight); RectTransform component7 = val13.GetComponent<RectTransform>(); component7.sizeDelta = new Vector2(35f, 35f); if (flag) { component7.anchorMin = new Vector2(1f, 0f); component7.anchorMax = new Vector2(1f, 0f); component7.pivot = new Vector2(1f, 0f); component7.anchoredPosition = new Vector2(-95f, 10f); } else { component7.anchorMin = new Vector2(0f, 0f); component7.anchorMax = new Vector2(0f, 0f); component7.pivot = new Vector2(0f, 0f); component7.anchoredPosition = new Vector2(140f, 10f); } GameObject val15 = new GameObject(); val15.transform.parent = val.transform; ((Object)val15).name = "RumbleHud_" + playerInfo.PlayFabId + "_hostText"; TextMeshProUGUI val16 = val15.AddComponent<TextMeshProUGUI>(); ((Graphic)val16).color = new Color(0.9843137f, 1f, 0.56078434f); ((TMP_Text)val16).font = Resources.TmpFont; ((TMP_Text)val16).text = "Host"; ((TMP_Text)val16).SetOutlineColor(Color32.op_Implicit(Color.black)); ((TMP_Text)val16).SetOutlineThickness(0.2f); ((TMP_Text)val16).fontSize = 50f; RectTransform component8 = ((Component)val16).GetComponent<RectTransform>(); component8.sizeDelta = new Vector2(125f, 50f); if (flag) { component8.anchorMin = new Vector2(1f, 1f); component8.anchorMax = new Vector2(1f, 1f); component8.pivot = new Vector2(1f, 0f); component8.anchoredPosition = Vector2.op_Implicit(new Vector3(-10f, -10f)); ((TMP_Text)val16).alignment = (TextAlignmentOptions)1028; } else { component8.anchorMin = new Vector2(0f, 1f); component8.anchorMax = new Vector2(0f, 1f); component8.pivot = new Vector2(0f, 0f); component8.anchoredPosition = Vector2.op_Implicit(new Vector3(10f, -10f)); ((TMP_Text)val16).alignment = (TextAlignmentOptions)1025; } val15.SetActive(false); GameObject val17 = new GameObject(); val17.transform.parent = val.transform; ((Object)val17).name = "RumbleHud_" + playerInfo.PlayFabId + "_hostIcon"; RawImage val18 = val17.AddComponent<RawImage>(); val18.texture = (Texture)(object)Resources.HostIconTexture; RectTransform component9 = val17.GetComponent<RectTransform>(); component9.sizeDelta = new Vector2(50f, 50f); if (flag) { component9.anchorMin = new Vector2(0f, 1f); component9.anchorMax = new Vector2(0f, 1f); component9.pivot = new Vector2(1f, 1f); component9.anchoredPosition = new Vector2(0f, -15f); } else { component9.anchorMin = new Vector2(1f, 1f); component9.anchorMax = new Vector2(1f, 1f); component9.pivot = new Vector2(0f, 1f); component9.anchoredPosition = new Vector2(0f, -15f); } val17.active = false; RenderTexture val19 = new RenderTexture(100, 100, 16); val19.Create(); GameObject val20 = new GameObject(); ((Object)val20).name = "RumbleHud_" + playerInfo.PlayFabId + "_portraitCamera"; Camera val21 = val20.AddComponent<Camera>(); val21.targetTexture = val19; val21.fieldOfView = 50f; val21.cullingMask = 8388608; val21.clearFlags = (CameraClearFlags)3; Object.DontDestroyOnLoad((Object)(object)val20); GameObject val22 = new GameObject(); ((Object)val22).name = "RumbleHud_" + playerInfo.PlayFabId + "_portrait"; RawImage val23 = val22.AddComponent<RawImage>(); ((Component)val23).transform.parent = val.transform; val23.texture = (Texture)(object)val19; RectTransform component10 = ((Component)val23).GetComponent<RectTransform>(); component10.sizeDelta = new Vector2(100f, 100f); if (flag) { component10.anchorMin = new Vector2(1f, 1f); component10.anchorMax = new Vector2(1f, 1f); component10.pivot = new Vector2(1f, 1f); component10.anchoredPosition = new Vector2(0f, 0f); } else { component10.anchorMin = new Vector2(0f, 1f); component10.anchorMax = new Vector2(0f, 1f); component10.pivot = new Vector2(0f, 1f); component10.anchoredPosition = new Vector2(0f, 0f); } float hudScale = Settings.Instance.HudScale; val.transform.localScale = new Vector3(hudScale, hudScale, hudScale); uiElementsByPlayer[playerInfo.PlayFabId] = new PlayerUiElements { Container = val, Background = val2, Name = val4, BP = val6, HealthBar = val8, HealthPips = val10, ShiftStoneLeft = val12, ShiftStoneRight = val14, HostText = val16, HostIcon = val18, HeadshotCamera = val21, RenderTexture = val19, Portrait = val23, PortraitGenerated = -30, IsRightAligned = flag, PlayFabId = playerInfo.PlayFabId, Position = position }; } public static void UpdatePlayerUi(PlayerInfo playerInfo) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) PlayerUiElements playerUiElements = uiElementsByPlayer[playerInfo.PlayFabId]; if (playerUiElements == null) { return; } ((TMP_Text)playerUiElements.BP).text = $"{playerInfo.BP} BP"; Color color = Resources.HealthFull; if (playerInfo.HP < 20) { color = Resources.HealthHigh; } if (playerInfo.HP <= 10) { color = Resources.HealthMedium; } if (playerInfo.HP <= 5) { color = Resources.HealthLow; } ((Graphic)playerUiElements.HealthBar).color = color; RectTransform component = ((Component)playerUiElements.HealthPips).GetComponent<RectTransform>(); playerUiElements.HealthPips.uvRect = new Rect(0f, 0f, (float)playerInfo.HP, 1f); component.sizeDelta = new Vector2((float)(((Texture)Resources.HealthPipsTexture).width * playerInfo.HP), (float)((Texture)Resources.HealthPipsTexture).height); Texture2D shiftStoneTexture = Resources.GetShiftStoneTexture(playerInfo.ShiftStoneLeft); Texture2D shiftStoneTexture2 = Resources.GetShiftStoneTexture(playerInfo.ShiftStoneRight); playerUiElements.ShiftStoneLeft.texture = (Texture)(object)shiftStoneTexture; playerUiElements.ShiftStoneRight.texture = (Texture)(object)shiftStoneTexture2; ((Component)playerUiElements.HostText).gameObject.active = playerInfo.IsHost && (Settings.Instance.HostIndicator == HostIndicatorOptions.Text || Settings.Instance.HostIndicator == HostIndicatorOptions.Both); ((Component)playerUiElements.HostIcon).gameObject.active = playerInfo.IsHost && (Settings.Instance.HostIndicator == HostIndicatorOptions.Icon || Settings.Instance.HostIndicator == HostIndicatorOptions.Both); if (playerUiElements.PortraitGenerated > 0) { ((Component)playerUiElements.HeadshotCamera).gameObject.SetActive(false); } if (playerUiElements.PortraitGenerated <= 0) { GameObject playerHead = GetPlayerHead(playerInfo.PlayFabId, playerInfo.PlayerController); GameObject playerVisuals = GetPlayerVisuals(playerInfo.PlayFabId, playerInfo.PlayerController); if ((Object)(object)playerHead != (Object)null) { PointCamera(playerUiElements.HeadshotCamera, playerHead, playerVisuals, playerUiElements.IsRightAligned); playerUiElements.PortraitGenerated++; } } } private static GameObject GetPlayerHead(string playFabId, PlayerController playerController) { if (playFabId == SelfPlayFabId) { return previewHead; } if ((Object)(object)playerController == (Object)null) { return null; } GameObject gameObject = ((Component)playerController).gameObject; if (!gameObject.active) { return null; } object obj; if (gameObject == null) { obj = null; } else { Transform transform = gameObject.transform; if (transform == null) { obj = null; } else { Transform child = transform.GetChild(1); if (child == null) { obj = null; } else { Transform child2 = child.GetChild(0); obj = ((child2 != null) ? ((Component)child2).GetComponent<SkinnedMeshRenderer>() : null); } } } SkinnedMeshRenderer val = (SkinnedMeshRenderer)obj; if ((Object)(object)val == (Object)null) { return null; } if (!((Renderer)val).isVisible || !((Renderer)val).enabled) { return null; } object obj2; if (gameObject == null) { obj2 = null; } else { Transform transform2 = gameObject.transform; if (transform2 == null) { obj2 = null; } else { Transform child3 = transform2.GetChild(1); if (child3 == null) { obj2 = null; } else { Transform child4 = child3.GetChild(1); if (child4 == null) { obj2 = null; } else { Transform child5 = child4.GetChild(0); if (child5 == null) { obj2 = null; } else { Transform child6 = child5.GetChild(4); if (child6 == null) { obj2 = null; } else { Transform child7 = child6.GetChild(0); if (child7 == null) { obj2 = null; } else { Transform child8 = child7.GetChild(0); if (child8 == null) { obj2 = null; } else { Transform child9 = child8.GetChild(0); obj2 = ((child9 != null) ? child9.GetChild(9) : null); } } } } } } } } Transform val2 = (Transform)obj2; return (val2 != null) ? ((Component)val2).gameObject : null; } private static GameObject GetPlayerVisuals(string playFabId, PlayerController playerController) { if (playFabId == SelfPlayFabId) { return GetPlayerHead(playFabId, null); } if ((Object)(object)playerController == (Object)null) { return null; } GameObject gameObject = ((Component)playerController).gameObject; if (!gameObject.active) { return null; } object result; if (gameObject == null) { result = null; } else { Transform transform = gameObject.transform; result = ((transform != null) ? ((Component)transform.GetChild(1)).gameObject : null); } return (GameObject)result; } private static void PointCamera(Camera camera, GameObject head, GameObject visuals, bool facingLeft) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) ((Component)camera).transform.position = head.transform.position; Transform transform = ((Component)camera).transform; Quaternion rotation = visuals.transform.rotation; transform.rotation = Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f); Transform transform2 = ((Component)camera).transform; transform2.position += ((Component)camera).transform.forward * 0.5f; ((Component)camera).transform.Rotate(0f, 180f, 0f); ((Component)camera).transform.RotateAround(head.transform.position, ((Component)camera).transform.up, (float)(facingLeft ? (-30) : 30)); } public static void RegeneratePortraits(bool regenerateSelf) { if (regenerateSelf) { PlayerUiElements playerUiElements = uiElementsByPlayer[SelfPlayFabId]; if (playerUiElements != null) { playerUiElements.PortraitGenerated = -30; ((Component)playerUiElements.HeadshotCamera).gameObject.SetActive(true); } return; } foreach (PlayerUiElements value in uiElementsByPlayer.Values) { if (!(value.PlayFabId == SelfPlayFabId)) { value.PortraitGenerated = -30; ((Component)value.HeadshotCamera).gameObject.SetActive(true); } } } public static void ClearPlayerUi(bool includeSelfPlayer = false) { foreach (PlayerUiElements value in uiElementsByPlayer.Values) { if (!(value.PlayFabId == SelfPlayFabId) || includeSelfPlayer) { Object.Destroy((Object)(object)value.Container); value.HeadshotCamera.targetTexture = null; Object.Destroy((Object)(object)((Component)value.HeadshotCamera).gameObject); uiElementsByPlayer.Remove(value.PlayFabId); } } } } internal class PlayerInfo { public string PlayFabId { get; set; } public string Name { get; set; } public int BP { get; set; } public int HP { get; set; } public ShiftStones ShiftStoneLeft { get; set; } public ShiftStones ShiftStoneRight { get; set; } public PlayerController PlayerController { get; set; } public bool IsHost { get; set; } } internal class PlayerUiElements { public GameObject Container { get; set; } public RawImage Background { get; set; } public TextMeshProUGUI Name { get; set; } public TextMeshProUGUI BP { get; set; } public Image HealthBar { get; set; } public RawImage HealthPips { get; set; } public RawImage ShiftStoneLeft { get; set; } public RawImage ShiftStoneRight { get; set; } public TextMeshProUGUI HostText { get; set; } public RawImage HostIcon { get; set; } public Camera HeadshotCamera { get; set; } public RenderTexture RenderTexture { get; set; } public RawImage Portrait { get; set; } public int PortraitGenerated { get; set; } public bool IsRightAligned { get; set; } public string PlayFabId { get; set; } public int Position { get; set; } } internal class Resources { private static AssetBundle bundle; private static TMP_FontAsset tmpFont; private static Texture2D backgroundTexture = null; private static Texture2D healthPipsTexture = null; private static Texture2D hostIconTexture = null; private static Dictionary<ShiftStones, Texture2D> shiftStoneTextures = new Dictionary<ShiftStones, Texture2D>(); private static Dictionary<ShiftStones, string> shiftStoneResourceNames = new Dictionary<ShiftStones, string> { { ShiftStones.Empty, "ss_empty" }, { ShiftStones.Adamant, "ss_adamant" }, { ShiftStones.Charge, "ss_charge" }, { ShiftStones.Flow, "ss_flow" }, { ShiftStones.Guard, "ss_guard" }, { ShiftStones.Stubborn, "ss_stubborn" }, { ShiftStones.Surge, "ss_surge" }, { ShiftStones.Vigor, "ss_vigor" }, { ShiftStones.Volatile, "ss_volatile" } }; private static bool initialized = false; public static readonly Color HealthLow = new Color(0.5921569f, 0.2901961f, 23f / 85f); public static readonly Color HealthMedium = new Color(0.54509807f, 44f / 85f, 22f / 85f); public static readonly Color HealthHigh = new Color(32f / 85f, 0.5568628f, 0.3254902f); public static readonly Color HealthFull = new Color(0.4862745f, 0.5882353f, 57f / 85f); public static bool Initialized => initialized; public static TMP_FontAsset TmpFont => tmpFont; public static Texture2D BackgroundTexture => backgroundTexture; public static Texture2D HealthPipsTexture => healthPipsTexture; public static Texture2D HostIconTexture => hostIconTexture; private static void LoadShiftStoneTexture(ShiftStones shiftStone) { string text = shiftStoneResourceNames[shiftStone]; Texture2D val = Object.Instantiate<Texture2D>(bundle.LoadAsset<Texture2D>(text)); ((Object)val).name = $"RumbleHud_{shiftStone}"; shiftStoneTextures[shiftStone] = val; Object.DontDestroyOnLoad((Object)(object)val); } public static void LoadResources(bool reload = false) { if (!initialized || reload) { bundle = LoadBundleFromFile("UserData/rumblehud"); tmpFont = Object.Instantiate<TMP_FontAsset>(bundle.LoadAsset<TMP_FontAsset>("TMP_GoodDogPlain")); backgroundTexture = Object.Instantiate<Texture2D>(bundle.LoadAsset<Texture2D>("PlayerBackground")); ((Object)backgroundTexture).name = "RumbleHud_BackgroundTexture"; healthPipsTexture = Object.Instantiate<Texture2D>(bundle.LoadAsset<Texture2D>("HealthPip")); ((Object)healthPipsTexture).name = "RumbleHud_HealthPipTexture"; hostIconTexture = Object.Instantiate<Texture2D>(bundle.LoadAsset<Texture2D>("HostIcon")); ((Object)hostIconTexture).name = "RumbleHud_HostIconTexture"; LoadShiftStoneTexture(ShiftStones.Empty); LoadShiftStoneTexture(ShiftStones.Adamant); LoadShiftStoneTexture(ShiftStones.Charge); LoadShiftStoneTexture(ShiftStones.Flow); LoadShiftStoneTexture(ShiftStones.Guard); LoadShiftStoneTexture(ShiftStones.Stubborn); LoadShiftStoneTexture(ShiftStones.Surge); LoadShiftStoneTexture(ShiftStones.Vigor); LoadShiftStoneTexture(ShiftStones.Volatile); Object.DontDestroyOnLoad((Object)(object)backgroundTexture); Object.DontDestroyOnLoad((Object)(object)healthPipsTexture); Object.DontDestroyOnLoad((Object)(object)hostIconTexture); initialized = true; } } public static Texture2D GetShiftStoneTexture(ShiftStones shiftStone) { if ((Object)(object)shiftStoneTextures[shiftStone] == (Object)null) { LoadShiftStoneTexture(shiftStone); } return shiftStoneTextures[shiftStone]; } private static AssetBundle LoadBundleFromFile(string path) { Stream stream = StreamFromFile(path); Stream val = ConvertToIl2CppStream(stream); AssetBundle result = AssetBundle.LoadFromStream(val); stream.Close(); val.Close(); return result; } private static Stream ConvertToIl2CppStream(Stream stream) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown MemoryStream val = new MemoryStream(); byte[] array = new byte[4096]; Il2CppStructArray<byte> val2 = new Il2CppStructArray<byte>(array); int num; while ((num = stream.Read(array, 0, array.Length)) > 0) { val2 = Il2CppStructArray<byte>.op_Implicit(array); ((Stream)val).Write(val2, 0, num); } ((Stream)val).Flush(); return (Stream)(object)val; } private static MemoryStream StreamFromFile(string path) { byte[] buffer = File.ReadAllBytes(path); return new MemoryStream(buffer); } } public enum HostIndicatorOptions { None, Text, Icon, Both } public class Settings { public static Settings Instance { get; private set; } public float HudScale { get; set; } public HostIndicatorOptions HostIndicator { get; set; } public bool HideSolo { get; set; } public static Settings FromJson(string jsonString) { return JsonUtility.FromJson<Settings>(jsonString); } public static Settings Initialize() { return Instance = new Settings { HudScale = 1f, HostIndicator = HostIndicatorOptions.Text, HideSolo = false }; } public static Settings FromXmlFile(string filePath) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(Settings)); using FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read); return Instance = (Settings)xmlSerializer.Deserialize(stream); } public void ToXmlFile(string filePath) { using StreamWriter streamWriter = new StreamWriter(filePath); XmlSerializer xmlSerializer = new XmlSerializer(GetType()); xmlSerializer.Serialize(streamWriter, this); streamWriter.Flush(); } } internal enum ShiftStones { Empty = -1, Adamant, Charge, Flow, Guard, Stubborn, Surge, Vigor, Volatile } }