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 velocityIndicator v1.1.1
Mods/velocityIndicator.dll
Decompiled 5 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using Il2CppRUMBLE.Managers; using Il2CppRUMBLE.Players.Subsystems; using Il2CppRUMBLE.Utilities; using Il2CppTMPro; using MelonLoader; using RumbleModUI; using RumbleModdingAPI; using UnityEngine; using UnityEngine.UI; using velocityIndicator; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(main), "velocityIndicator", "1.1.1", "klibe", null)] [assembly: VerifyLoaderVersion(0, 6, 2, true)] [assembly: MelonGame("Buckethead Entertainment", "RUMBLE")] [assembly: MelonColor(255, 240, 205, 53)] [assembly: MelonAuthorColor(255, 240, 205, 53)] [assembly: AssemblyTitle("velocityIndicator")] [assembly: AssemblyDescription("Displays velocities, altitude, and other things.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5c49b9de-7b5c-4cdf-b63e-6dd388ff41ba")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.1.1.0")] namespace velocityIndicator; public static class BuildInfo { public const string ModName = "velocityIndicator"; public const string ModVersion = "1.1.1"; public const string Description = "Displays velocities, altitude, and other things."; public const string Author = "klibe"; public const string Company = ""; } public class Validation : ValidationParameters { private int Length; public Validation(int i) { Length = i; } public override bool DoValidation(string Input) { if (Input.Length == Length) { return true; } return false; } } public class main : MelonMod { private static GameObject velocityText; private static TextMeshPro velocityTextRef; private static GameObject structureVelocityText; private static TextMeshPro structureVelocityTextRef; private static GameObject flightText; private static TextMeshPro flightTextRef; private static float startY; private static float structureStartY; private static bool prevGrounded; private static bool grounded; private static float flightTimer; private static float postFlightTime = 2f; private static float postFlightTimer = 0f; private static bool displayAltimeter; private static bool displayFlight; private static bool displayStructureAltimeter; private static Color structureColor = new Color(1f, 0.8f, 0.2f); private static Color flightColor = new Color(0.65f, 0.85f, 1f); private static bool isInputReady = false; private static Rigidbody playerRef; private static PlayerMovement playerGroundedRef; private static float[] playerStats = new float[6]; private static float prevPlayerSpeed = 0f; private static float playerMaxTimer = 0f; private static float playerMaxTime = 3f; private static float playerTotalSpeed = 0f; private static float playerTotalTime = 0f; private static Rigidbody followedStructure = null; private static float[] structureStats = new float[6]; private static float prevStructureSpeed = 0f; private static float structureMaxTimer = 0f; private static float structureMaxTime = 3f; private static float structurePostDestroyTimer = 0f; private static float structurePostDestroyTime = 2f; private static float structureTotalTime = 0f; private static float structureTotalSpeed = 0f; private static bool isTrackingStructure = false; private static float[] emptyStats = new float[6]; public static string currentScene = "Loader"; public static bool prevInput = false; public static bool currentInput = false; public static Transform head; public static Transform health; public static int playerMode; public static int structureMode; public static int dataMode; public static bool useColors; public static int amountOfDecimals; public static string decstr; private static bool isMeasuringAcceleration; private Mod velocityIndicator = new Mod(); public override void OnGUI() { ((MelonBase)this).OnGUI(); } public override void OnLateInitializeMelon() { Calls.onMapInitialized += initializeText; velocityIndicator.ModSaved += settingsSaved; UI.instance.UI_Initialized += OnUIInit; } private static void log(string logstr) { MelonLogger.Msg(logstr); } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { isInputReady = false; currentScene = sceneName; } public void settingsSaved() { //IL_01b2: Unknown result type (might be due to invalid IL or missing references) if ((bool)velocityIndicator.Settings[9].SavedValue) { structureMode = 0; } else if ((bool)velocityIndicator.Settings[10].SavedValue) { structureMode = 1; } else if ((bool)velocityIndicator.Settings[11].SavedValue) { structureMode = 2; } else { structureMode = 3; } if ((bool)velocityIndicator.Settings[5].SavedValue) { playerMode = 0; } else if ((bool)velocityIndicator.Settings[6].SavedValue) { playerMode = 1; } else if ((bool)velocityIndicator.Settings[7].SavedValue) { playerMode = 2; } else { playerMode = 3; } displayAltimeter = (bool)velocityIndicator.Settings[14].SavedValue; displayFlight = (bool)velocityIndicator.Settings[15].SavedValue; displayStructureAltimeter = (bool)velocityIndicator.Settings[13].SavedValue; useColors = (bool)velocityIndicator.Settings[1].SavedValue; if (!useColors && (Object)(object)velocityTextRef != (Object)null) { ((Graphic)velocityTextRef).color = Color.white; } isMeasuringAcceleration = (bool)velocityIndicator.Settings[3].SavedValue; dataMode = (int)velocityIndicator.Settings[4].SavedValue; amountOfDecimals = Mathf.Max((int)velocityIndicator.Settings[2].SavedValue, 0); decstr = "0"; if (amountOfDecimals != 0) { decstr += "."; for (int i = 0; i < amountOfDecimals; i++) { decstr += "#"; } } } public void OnUIInit() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected O, but got Unknown //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Expected O, but got Unknown velocityIndicator.ModName = "velocityIndicator"; velocityIndicator.ModVersion = "1.1.1"; velocityIndicator.SetFolder("velocityIndicator"); velocityIndicator.AddDescription("Description", "", "Displays velocities, altitude, and other things.", new Tags { IsSummary = true }); velocityIndicator.AddToList("Enable colors", true, 0, "If the colors are too distracting, you can turn them off here.", new Tags()); velocityIndicator.AddToList("Amount of decimals", 1, "Amount of decimal precision.", new Tags()); velocityIndicator.AddToList("Change Speed for Acceleration", false, 0, "If true will display player and structure acceleration instead of speed.", new Tags()); velocityIndicator.AddToList("Velocity Part", 0, "If 0, will display total velocity; if 1, will display upwards velocity, if 2; will display horizontal velocity.", new Tags()); velocityIndicator.AddToList("Display Player Current Speed", true, 1, "If true will display your current speed.", new Tags()); velocityIndicator.AddToList("Display Player Average Speed", false, 1, "If true will display your average speed.", new Tags()); velocityIndicator.AddToList("Display Player Top Speed", false, 1, "If true will display the your top speed.", new Tags()); velocityIndicator.AddToList("Hide Player Speed", false, 1, "If true will hide text showing player speed.", new Tags()); velocityIndicator.AddToList("Display Structure Current Speed", false, 2, "If true will display the current speed of your tracked structure.", new Tags()); velocityIndicator.AddToList("Display Structure Average Speed", false, 2, "If true will display the average speed of your tracked structure.", new Tags()); velocityIndicator.AddToList("Display Structure Top Speed", true, 2, "If true will display the top speed of your tracked structure.", new Tags()); velocityIndicator.AddToList("Hide Structure Statistics", false, 2, "If true will hide text showing structure speed.", new Tags()); velocityIndicator.AddToList("Display Structure Altitude", false, 0, "If true will display the current altitude of your tracked structure.", new Tags()); velocityIndicator.AddToList("Display Player Altitude", true, 0, "If true will display your current altitude.", new Tags()); velocityIndicator.AddToList("Display Flight Timer", true, 0, "If true will display a flight timer (based on grounded player state).", new Tags()); velocityIndicator.GetFromFile(); settingsSaved(); UI.instance.AddMod(velocityIndicator); MelonLogger.Msg("Added Mod"); } public void initializeText() { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_024a: 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_02c9: Unknown result type (might be due to invalid IL or missing references) if (currentScene == "Gym" || currentScene == "Park") { head = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).gameObject.transform.GetChild(1).GetChild(0).GetChild(0); health = Players.GetLocalHealthbarGameObject().transform.GetChild(1).GetChild(0); velocityText = Create.NewText(); ((Object)velocityText).name = "Velocity Display"; velocityText.transform.parent = health; velocityText.transform.localPosition = new Vector3(-1.0564f, 0.0561f, 0.0907f); velocityText.transform.localRotation = Quaternion.Euler(62.9944f, 260f, 0f); velocityTextRef = velocityText.GetComponent<TextMeshPro>(); ((TMP_Text)velocityTextRef).text = "..."; ((TMP_Text)velocityTextRef).fontSize = 0.8f; ((TMP_Text)velocityTextRef).enableWordWrapping = false; ((Graphic)velocityTextRef).color = Color.white; structureVelocityText = Create.NewText(); ((Object)structureVelocityText).name = "Structure Velocity Display"; structureVelocityText.transform.parent = health; structureVelocityText.transform.localPosition = new Vector3(-1.0564f, 0.0761f, 0.0907f); structureVelocityText.transform.localRotation = Quaternion.Euler(62.9944f, 260f, 0f); structureVelocityTextRef = structureVelocityText.GetComponent<TextMeshPro>(); ((TMP_Text)structureVelocityTextRef).text = "DEBUG STRUCTURE TEXT"; ((TMP_Text)structureVelocityTextRef).fontSize = 0.6f; ((TMP_Text)structureVelocityTextRef).enableWordWrapping = false; ((Graphic)structureVelocityTextRef).color = structureColor; flightText = Create.NewText(); ((Object)flightText).name = "Altitude Display"; flightText.transform.parent = health; flightText.transform.localPosition = new Vector3(-1.0564f, 0.0961f, 0.0907f); flightText.transform.localRotation = Quaternion.Euler(62.9944f, 260f, 0f); flightTextRef = flightText.GetComponent<TextMeshPro>(); ((TMP_Text)flightTextRef).text = "DEBUG FLIGHT TEXT"; ((TMP_Text)flightTextRef).fontSize = 0.6f; ((TMP_Text)flightTextRef).m_textAlignment = (TextAlignmentOptions)514; ((TMP_Text)flightTextRef).enableWordWrapping = false; ((Graphic)flightTextRef).color = flightColor; playerRef = ((Component)((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).transform.GetChild(4)).GetComponent<Rigidbody>(); playerGroundedRef = ((Component)((Component)playerRef).transform.parent).GetComponent<PlayerMovement>(); isInputReady = true; } } public override void OnFixedUpdate() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_0391: 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_0405: Unknown result type (might be due to invalid IL or missing references) //IL_045e: 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_043f: Unknown result type (might be due to invalid IL or missing references) bool flag = currentScene == "Gym" || currentScene == "Park"; if (!isInputReady || !flag) { return; } prevGrounded = grounded; grounded = playerGroundedRef.IsGrounded(); if (grounded != prevGrounded) { if (!grounded) { flightTimer = 0f; startY = ((Component)playerRef).transform.position.y; ((TMP_Text)flightTextRef).text = ""; } else { string text = ""; int num = Mathf.FloorToInt(flightTimer / 60f); int num2 = Mathf.FloorToInt(flightTimer / 360f); text = ((num2 > 0) ? (num2 + ":" + num + ":" + flightTimer.ToString("0")) : ((num <= 0) ? flightTimer.ToString("0.##") : (num + ":" + flightTimer.ToString("0.##")))); postFlightTimer = 0f; ((TMP_Text)flightTextRef).text = text; } } else if (!grounded) { string text2 = ""; string text3 = ""; string text4 = " : "; if (displayFlight) { text2 = flightTimer.ToString("0.##"); } if (displayAltimeter) { text3 = (((Component)playerRef).transform.position.y - startY).ToString(decstr); } else if (!displayFlight) { text4 = ""; } ((TMP_Text)flightTextRef).text = text3 + text4 + text2; flightTimer += Time.fixedDeltaTime; } else if (grounded) { postFlightTimer += Time.fixedDeltaTime; if (postFlightTimer >= postFlightTime) { flightTimer = 0f; ((TMP_Text)flightTextRef).text = ""; } } prevInput = currentInput; currentInput = RightController.GetGrip() > 0.8f && RightController.GetSecondary() == 1f; if (currentInput != prevInput && prevInput) { getPointedObject(); } if ((Object)(object)followedStructure != (Object)null && !((Component)followedStructure).gameObject.active) { isTrackingStructure = false; } prevPlayerSpeed = playerStats[0]; Vector3 velocity; if (dataMode == 2) { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(playerRef.velocity.x, 0f, playerRef.velocity.z); playerStats[0] = ((Vector3)(ref val)).magnitude; } else if (dataMode == 1) { playerStats[0] = Mathf.Abs(playerRef.velocity.y); } else { float[] array = playerStats; velocity = playerRef.velocity; array[0] = ((Vector3)(ref velocity)).magnitude; } if (isTrackingStructure) { prevStructureSpeed = structureStats[0]; if (dataMode == 2) { Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(followedStructure.velocity.x, 0f, followedStructure.velocity.z); structureStats[0] = ((Vector3)(ref val2)).magnitude; } else if (dataMode == 1) { structureStats[0] = Mathf.Abs(followedStructure.velocity.y); } else { float[] array2 = structureStats; velocity = followedStructure.velocity; array2[0] = ((Vector3)(ref velocity)).magnitude; } } else { structureStats = emptyStats; } if (!isMeasuringAcceleration) { if (playerStats[0] > playerStats[2]) { playerStats[2] = playerStats[0]; playerMaxTimer = 0f; } else { playerMaxTimer += Time.fixedDeltaTime; if (playerMaxTimer > playerMaxTime) { playerStats[2] = playerStats[0]; } } if (playerStats[0] > 0.4f && grounded) { playerTotalTime += Time.fixedDeltaTime; playerTotalSpeed += Time.fixedDeltaTime * playerStats[0]; playerStats[1] = playerTotalSpeed / playerTotalTime; } else { playerTotalTime = 0f; playerTotalSpeed = 0f; playerStats[1] = 0f; } if (isTrackingStructure) { if (structureStats[0] > structureStats[2]) { structureStats[2] = structureStats[0]; structureMaxTimer = 0f; } else { structureMaxTimer += Time.fixedDeltaTime; if (structureMaxTimer > structureMaxTime) { structureStats[2] = structureStats[0]; } } if (structureStats[0] > 0.2f) { structureTotalTime += Time.fixedDeltaTime; structureTotalSpeed += Time.fixedDeltaTime * structureStats[0]; structureStats[1] = structureTotalSpeed / structureTotalTime; } else { structureTotalTime = 0f; structureTotalSpeed = 0f; structureStats[1] = 0f; } } } else { playerStats[3] = (playerStats[0] - prevPlayerSpeed) / Time.fixedDeltaTime; if (playerStats[3] > playerStats[5]) { playerStats[5] = playerStats[3]; playerMaxTimer = 0f; } else { playerMaxTimer += Time.fixedDeltaTime; if (playerMaxTimer > playerMaxTime) { playerStats[4] = playerStats[3]; } } if (playerStats[3] == 0f) { playerTotalTime += Time.fixedDeltaTime; playerTotalSpeed += Time.fixedDeltaTime * playerStats[3]; playerStats[4] = playerTotalSpeed / playerTotalTime; } else { playerTotalTime = 0f; playerTotalSpeed = 0f; playerStats[4] = 0f; } if (isTrackingStructure) { structureStats[3] = (structureStats[0] - prevStructureSpeed) / Time.fixedDeltaTime; if (structureStats[3] > structureStats[5]) { structureStats[5] = structureStats[3]; structureMaxTimer = 0f; } else { structureMaxTimer += Time.fixedDeltaTime; if (structureMaxTimer > structureMaxTime) { structureStats[5] = structureStats[3]; } } if (structureStats[3] == 0.2f) { structureTotalTime += Time.fixedDeltaTime; structureTotalSpeed += Time.fixedDeltaTime * structureStats[0]; structureStats[4] = structureTotalSpeed / structureTotalTime; } else { structureTotalTime = 0f; structureTotalSpeed = 0f; structureStats[4] = 0f; } } } displayPlayerInfo(); displayStructureInfo(); } public void getPointedObject() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_009e: Unknown result type (might be due to invalid IL or missing references) log("Attempting to find pointed Object"); LayerMask val = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Move" })); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(head.position, head.forward, ref val2, float.PositiveInfinity, LayerMask.op_Implicit(val))) { followedStructure = ((Component)((RaycastHit)(ref val2)).transform).gameObject.GetComponent<Rigidbody>(); ((TMP_Text)structureVelocityTextRef).text = "0"; structureStats = emptyStats; structureTotalTime = 0f; structurePostDestroyTimer = 0f; structureStartY = ((Component)followedStructure).transform.position.y; isTrackingStructure = true; } } public void displayPlayerInfo() { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (playerMode != 3) { if (useColors) { if (playerStats[playerMode] < 4f) { ((Graphic)velocityTextRef).color = Color.green; } else if (playerStats[playerMode] < 10f) { ((Graphic)velocityTextRef).color = Color.yellow; } else { ((Graphic)velocityTextRef).color = Color.red; } } else { ((Graphic)velocityTextRef).color = Color.white; } if (isMeasuringAcceleration) { ((TMP_Text)velocityTextRef).text = playerStats[playerMode + 3].ToString(decstr); } else { ((TMP_Text)velocityTextRef).text = playerStats[playerMode].ToString(decstr); } } else { ((TMP_Text)velocityTextRef).text = ""; } } public void displayStructureInfo() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (structureMode != 3) { if (isTrackingStructure) { string text = ""; if (displayStructureAltimeter) { text = " : " + (followedStructure.position.y - structureStartY); } if (isMeasuringAcceleration) { ((TMP_Text)structureVelocityTextRef).text = structureStats[structureMode + 3].ToString(decstr) + text; } else { ((TMP_Text)structureVelocityTextRef).text = structureStats[structureMode].ToString(decstr) + text; } structurePostDestroyTimer = 0f; } else { structurePostDestroyTimer += Time.deltaTime; if (structurePostDestroyTimer >= structurePostDestroyTime) { structurePostDestroyTimer = 0f; ((TMP_Text)structureVelocityTextRef).text = ""; } } } else { ((TMP_Text)structureVelocityTextRef).text = ""; } } }