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 ShiftStoneMarkings v1.0.3
Mods/ShiftStoneMarkings.dll
Decompiled a day agousing System; using System.Collections; 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.Threading; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppRUMBLE.Combat.ShiftStones; using Il2CppRUMBLE.Input; using Il2CppRUMBLE.Managers; using Il2CppRUMBLE.Utilities; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using RumbleModdingAPI.RMAPI; using ShiftStoneMarkings; using UIFramework; using UnityEngine; [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), "ShiftStoneMarkings", "1.0.0", "SaveForth", null)] [assembly: MelonGame("Buckethead Entertainment", "RUMBLE")] [assembly: MelonAdditionalDependencies(new string[] { "UIFramework" })] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("ShiftStoneMarkings")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ShiftStoneMarkings")] [assembly: AssemblyTitle("ShiftStoneMarkings")] [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 ShiftStoneMarkings { public class Core : MelonMod { public struct BasicColor { public float r; public float g; public float b; public float a; public BasicColor() { r = 0f; g = 0f; b = 0f; a = 0f; } public bool equals(BasicColor other) { if (r == other.r && g == other.g && b == other.b) { return true; } return false; } public void setA(float a) { this.a = a; } public bool similar(BasicColor other, float tolerance) { return Math.Abs(r - other.r) <= tolerance && Math.Abs(g - other.g) <= tolerance && Math.Abs(b - other.b) <= tolerance; } } [HarmonyPatch(typeof(PlayerShiftstoneSystem), "ActivateUseShiftstoneEffects", new Type[] { typeof(Hand) })] public static class shiftStoneActivationPatch { private static void Postfix(PlayerShiftstoneSystem __instance, Hand hand) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Invalid comparison between Unknown and I4 //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 if ((Object)(object)localShiftstoneSystem == (Object)null) { localShiftstoneSystem = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).GetComponent<PlayerShiftstoneSystem>(); } if ((Object)(object)__instance == (Object)(object)localShiftstoneSystem) { if ((int)hand == 1) { isLeftPulsing = true; } else if ((int)hand == 2) { isRightPulsing = true; } } } } [HarmonyPatch(typeof(PlayerShiftstoneSystem), "AttachShiftStone", new Type[] { typeof(ShiftStone), typeof(int), typeof(bool), typeof(bool) })] public static class shiftStoneAttachPatch { private static void Postfix(ShiftStone stone, int slotIndex, bool saveInSettings, bool syncWithOtherPlayers) { setStoneColors(); } } [CompilerGenerated] private sealed class <waitForLoad>d__32 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Core <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <waitForLoad>d__32(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(4f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.maskSetup(); <>4__this.shaderSetup(); 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 MelonPreferences_Category options; private MelonPreferences_Category extraoptions; private const string USER_DATA = "UserData/ShiftStoneMarkings/"; private const string CONFIG_FILE = "config.cfg"; private MelonPreferences_Entry<bool> toggle; private MelonPreferences_Entry<float> glowStren; private MelonPreferences_Entry<bool> isFeminineCharacter; private MelonPreferences_Entry<bool> toggleBasicColors; public static PlayerShiftstoneSystem localShiftstoneSystem; private bool isSetup = false; private Material mat; private Texture2D editable; private bool callback = false; private Color[] pixels; private List<BasicColor> myColors; private Texture source; private int progress = 0; private int total = 100; private AssetBundle shaderBundle; private Shader glowShader; private List<BasicColor> outputColors; private float pulseAmountLeft = 0f; private float pulseAmountRight = 0f; private static SkinnedMeshRenderer overlayLeft; private static SkinnedMeshRenderer overlayRight; private static bool isLeftPulsing = false; private static bool isRightPulsing = false; private static byte alpha = byte.MaxValue; private static bool isFeminine = true; private static float glowStrength = 10f; private static Color[] shiftStoneColors = (Color[])(object)new Color[8] { Color32.op_Implicit(new Color32((byte)190, (byte)0, byte.MaxValue, alpha)), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)210, (byte)0, alpha)), Color32.op_Implicit(new Color32((byte)0, (byte)100, byte.MaxValue, alpha)), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)100, (byte)0, alpha)), Color32.op_Implicit(new Color32((byte)0, (byte)210, (byte)170, alpha)), Color32.op_Implicit(new Color32((byte)0, (byte)220, (byte)70, alpha)), Color32.op_Implicit(new Color32((byte)170, byte.MaxValue, (byte)0, alpha)), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)0, (byte)45, alpha)) }; public override void OnInitializeMelon() { options = MelonPreferences.CreateCategory("options", "Options"); extraoptions = MelonPreferences.CreateCategory("extra", "Extra"); if (!Directory.Exists("UserData/ShiftStoneMarkings/")) { Directory.CreateDirectory("UserData/ShiftStoneMarkings/"); } options.SetFilePath(Path.Combine("UserData/ShiftStoneMarkings/", "config.cfg")); toggle = options.CreateEntry<bool>("Entry 1-1", true, "ToggleMod", "Turn the mod on or off", false, false, (ValueValidator)null, (string)null); glowStren = options.CreateEntry<float>("Entry 1-2", 5f, "Glow Strength", "Changes the strength of the glow (too high might become white)", false, false, (ValueValidator)null, (string)null); isFeminineCharacter = options.CreateEntry<bool>("Entry 1-3", true, "IsCharacterFeminine", "If using feminine character model, this needs to be on", false, false, (ValueValidator)null, (string)null); toggleBasicColors = extraoptions.CreateEntry<bool>("Entry 2-1", false, "Basic Colors", "Toggle basic colors (allows brighter glow typically)", false, false, (ValueValidator)null, (string)null); ((MelonEventBase<LemonAction<bool, bool>>)(object)toggle.OnEntryValueChanged).Subscribe((LemonAction<bool, bool>)delegate(bool oldVal, bool newVal) { toggleMod(newVal); }, 0, false); ((MelonEventBase<LemonAction<float, float>>)(object)glowStren.OnEntryValueChanged).Subscribe((LemonAction<float, float>)delegate(float oldVal, float newVal) { ((Renderer)overlayLeft).material.SetFloat("_GlowStrength", newVal); ((Renderer)overlayRight).material.SetFloat("_GlowStrength", newVal); glowStrength = newVal; }, 0, false); ((MelonEventBase<LemonAction<bool, bool>>)(object)isFeminineCharacter.OnEntryValueChanged).Subscribe((LemonAction<bool, bool>)delegate(bool oldVal, bool newVal) { isFeminine = newVal; MelonCoroutines.Start(waitForLoad()); }, 0, false); ((MelonEventBase<LemonAction<bool, bool>>)(object)toggleBasicColors.OnEntryValueChanged).Subscribe((LemonAction<bool, bool>)delegate(bool oldVal, bool newVal) { toggleColorsBasic(newVal); }, 0, false); UI.RegisterMelon((MelonBase)(object)this, (MelonPreferences_Category[])(object)new MelonPreferences_Category[2] { options, extraoptions }); } [IteratorStateMachine(typeof(<waitForLoad>d__32))] private IEnumerator waitForLoad() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <waitForLoad>d__32(0) { <>4__this = this }; } public override void OnSceneWasLoaded(int buildindex, string buildname) { isSetup = false; if (buildindex != 0) { MelonCoroutines.Start(waitForLoad()); } } public override void OnUpdate() { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) ((MelonBase)this).OnUpdate(); if (isLeftPulsing) { doLeftPulse(); } if (isRightPulsing) { doRightPulse(); } if (Input.GetKeyDown((KeyCode)110)) { isLeftPulsing = true; } if (Input.GetKeyDown((KeyCode)109)) { isRightPulsing = true; } if (Input.GetKeyDown((KeyCode)106)) { swapTex(); } if (Input.GetKeyDown((KeyCode)102)) { mat.SetTexture("_ColorAtlas", source); } if (callback) { callback = false; for (int i = 0; i < pixels.Length; i++) { pixels[i] = new Color(outputColors[i].r, outputColors[i].g, outputColors[i].b, 1f); } editable.SetPixels(Il2CppStructArray<Color>.op_Implicit(pixels)); editable.Apply(); MelonLogger.Msg("done"); isSetup = true; } } private void swapTex() { mat.SetTexture("_ColorAtlas", (Texture)(object)editable); } private void maskSetup() { mat = ((Renderer)((Component)((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).transform.GetChild(1).GetChild(0)).GetComponent<SkinnedMeshRenderer>()).material; source = mat.GetTexture("_ColorAtlas"); editable = CopyReadable(source); BasicColor newMarkingColor = new BasicColor { r = 1f, g = 0f, b = 0f, a = 1f }; pixels = Il2CppArrayBase<Color>.op_Implicit((Il2CppArrayBase<Color>)(object)editable.GetPixels()); StreamReader streamReader = new StreamReader("UserData/ShiftStoneMarkings/InitialMask.txt"); List<List<int>> initMask = new List<List<int>>(); while (!streamReader.EndOfStream) { string text = streamReader.ReadLine(); string[] array = text.Split(' '); initMask.Add(new List<int>(2) { int.Parse(array[0]), int.Parse(array[1]) }); } myColors = new List<BasicColor>(); for (int i = 0; i < pixels.Length; i++) { myColors.Add(new BasicColor { r = pixels[i].r, g = pixels[i].g, b = pixels[i].b, a = pixels[i].a }); } BasicColor black = new BasicColor { r = 0f, g = 0f, b = 0f, a = 1f }; outputColors = new List<BasicColor>(myColors.Count); for (int j = 0; j < myColors.Count; j++) { outputColors.Add(black); } new Thread((ThreadStart)delegate { for (int k = 0; k < myColors.Count; k++) { outputColors.Add(black); } total = myColors.Count; for (int l = 0; l < initMask.Count; l++) { for (int m = initMask[l][0]; m < initMask[l][1]; m++) { if (!isFeminine) { if (!myColors[m].equals(myColors[85])) { float a = myColors[m].a; myColors[m] = newMarkingColor; myColors[m].setA(a); outputColors[m] = newMarkingColor; } } else if (!myColors[m].similar(myColors[85], 0.14f)) { float a2 = myColors[m].a; myColors[m] = newMarkingColor; myColors[m].setA(a2); outputColors[m] = newMarkingColor; } } progress = l; } callback = true; }).Start(); } private Texture2D CopyReadable(Texture source) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) RenderTexture temporary = RenderTexture.GetTemporary(source.width, source.height, 0, (RenderTextureFormat)7, (RenderTextureReadWrite)2); Graphics.Blit(source, temporary); RenderTexture active = RenderTexture.active; RenderTexture.active = temporary; Texture2D val = new Texture2D(source.width, source.height, (TextureFormat)4, false, false); val.ReadPixels(new Rect(0f, 0f, (float)source.width, (float)source.height), 0, 0); val.Apply(); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); return val; } private void shaderSetup() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Expected O, but got Unknown //IL_01d8: Unknown result type (might be due to invalid IL or missing references) LoadAsset(); SkinnedMeshRenderer component = ((Component)((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).transform.GetChild(1).GetChild(0)).GetComponent<SkinnedMeshRenderer>(); GameObject val = new GameObject("MarkingGlowOverlayLeft"); val.transform.SetParent(((Component)component).transform, false); GameObject val2 = new GameObject("MarkingGlowOverlayRight"); val2.transform.SetParent(((Component)component).transform, false); overlayLeft = val.AddComponent<SkinnedMeshRenderer>(); overlayRight = val2.AddComponent<SkinnedMeshRenderer>(); overlayLeft.sharedMesh = component.sharedMesh; overlayLeft.bones = component.bones; overlayLeft.rootBone = component.rootBone; ((Renderer)overlayLeft).material = new Material(glowShader); ((Renderer)overlayLeft).material.SetColor("_EmissionColor", Color.red); ((Renderer)overlayLeft).material.SetFloat("_GlowStrength", glowStrength); ((Renderer)overlayLeft).material.SetFloat("PulseSpeed", 2f); ((Renderer)overlayLeft).material.SetTexture("_ColorAtlas", (Texture)(object)editable); ((Renderer)overlayLeft).material.SetFloat("_PulseAmount", -(float)Math.PI / 2f); ((Renderer)overlayLeft).material.SetFloat("_Offset", 0.005f); ((Renderer)overlayLeft).material.SetFloat("_Toggle", 0f); overlayRight.sharedMesh = component.sharedMesh; overlayRight.bones = component.bones; overlayRight.rootBone = component.rootBone; ((Renderer)overlayRight).material = new Material(glowShader); ((Renderer)overlayRight).material.SetColor("_EmissionColor", Color.blue); ((Renderer)overlayRight).material.SetFloat("_GlowStrength", glowStrength); ((Renderer)overlayRight).material.SetFloat("PulseSpeed", 2f); ((Renderer)overlayRight).material.SetTexture("_ColorAtlas", (Texture)(object)editable); ((Renderer)overlayRight).material.SetFloat("_PulseAmount", -(float)Math.PI / 2f); ((Renderer)overlayRight).material.SetFloat("_Offset", 0.005f); ((Renderer)overlayRight).material.SetFloat("_Toggle", 0f); setStoneColors(); } public void LoadAsset() { glowShader = AssetBundles.LoadAssetFromStream<Shader>((MelonMod)(object)this, "ShiftStoneMarkings.GlowShader.glowshaderbundle", "gloweffect"); } private void doLeftPulse() { if (isSetup) { ((Renderer)overlayLeft).material.SetFloat("_Toggle", 1f); ((Renderer)overlayLeft).material.SetFloat("_PulseAmount", pulseAmountLeft); pulseAmountLeft += 0.1f; if (pulseAmountLeft > 4.712389f) { pulseAmountLeft = -(float)Math.PI / 2f; isLeftPulsing = false; ((Renderer)overlayLeft).material.SetFloat("_Toggle", 0f); } } } private void doRightPulse() { if (isSetup) { ((Renderer)overlayRight).material.SetFloat("_Toggle", 1f); ((Renderer)overlayRight).material.SetFloat("_PulseAmount", pulseAmountRight); pulseAmountRight += 0.1f; if (pulseAmountRight > 4.712389f) { pulseAmountRight = -(float)Math.PI / 2f; isRightPulsing = false; ((Renderer)overlayRight).material.SetFloat("_Toggle", 0f); } } } public static void setStoneColors() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Singleton<PlayerManager>.instance.localPlayer.Controller != (Object)null && (Object)(object)overlayLeft != (Object)null && (Object)(object)overlayRight != (Object)null) { int[] array = Il2CppArrayBase<int>.op_Implicit((Il2CppArrayBase<int>)(object)((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).GetComponent<PlayerShiftstoneSystem>().GetCurrentShiftStoneConfiguration()); ((Renderer)overlayLeft).material.SetColor("_EmissionColor", shiftStoneColors[array[0]]); ((Renderer)overlayRight).material.SetColor("_EmissionColor", shiftStoneColors[array[1]]); } } public void toggleMod(bool isOn) { if (isOn) { ((Component)overlayLeft).gameObject.SetActive(true); ((Component)overlayRight).gameObject.SetActive(true); } else { ((Component)overlayLeft).gameObject.SetActive(false); ((Component)overlayRight).gameObject.SetActive(false); } } private void toggleColorsBasic(bool newVal) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (newVal) { shiftStoneColors = (Color[])(object)new Color[8] { Color.purple, Color.yellow, Color.teal, Color.orange, Color.blue, Color.green, Color.limeGreen, Color.red }; } else { shiftStoneColors = (Color[])(object)new Color[8] { Color32.op_Implicit(new Color32((byte)190, (byte)0, byte.MaxValue, alpha)), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)210, (byte)0, alpha)), Color32.op_Implicit(new Color32((byte)0, (byte)210, (byte)170, alpha)), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)100, (byte)0, alpha)), Color32.op_Implicit(new Color32((byte)0, (byte)100, byte.MaxValue, alpha)), Color32.op_Implicit(new Color32((byte)0, (byte)220, (byte)70, alpha)), Color32.op_Implicit(new Color32((byte)170, byte.MaxValue, (byte)0, alpha)), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)0, (byte)45, alpha)) }; } setStoneColors(); } } }