using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using PluginConfig.API; using PluginConfig.API.Fields; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CustomLevelTitles")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CustomLevelTitles")] [assembly: AssemblyTitle("CustomLevelTitles")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 CustomLevelTitles { public static class Configs { private static PluginConfigurator config; public static BoolField enabler; public static StringField prelude1; public static StringField prelude2; public static StringField prelude3; public static StringField prelude4; public static StringField prelude5; public static StringField limbo1; public static StringField limbo2; public static StringField limbo3; public static StringField limbo4; public static StringField lust1; public static StringField lust2; public static StringField lust3; public static StringField lust4; public static StringField gluttony1; public static StringField gluttony2; public static StringField greed1; public static StringField greed2; public static StringField greed3; public static StringField greed4; public static StringField wrath1; public static StringField wrath2; public static StringField wrath3; public static StringField wrath4; public static StringField heresy1; public static StringField heresy2; public static StringField violence1; public static StringField violence2; public static StringField violence3; public static StringField violence4; public static StringField fraud1; public static StringField fraud2; public static StringField fraud3; public static StringField fraud4; public static StringField prime1; public static StringField prime2; public static StringField encore1; public static StringField encore2; public static void createConfig() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Expected O, but got Unknown //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Expected O, but got Unknown //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected O, but got Unknown //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Expected O, but got Unknown //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Expected O, but got Unknown //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Expected O, but got Unknown //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Expected O, but got Unknown //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Expected O, but got Unknown //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Expected O, but got Unknown //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Expected O, but got Unknown //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Expected O, but got Unknown //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Expected O, but got Unknown //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Expected O, but got Unknown //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Expected O, but got Unknown //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Expected O, but got Unknown //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Expected O, but got Unknown //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Expected O, but got Unknown //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Expected O, but got Unknown //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Expected O, but got Unknown //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Expected O, but got Unknown //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Expected O, but got Unknown //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Expected O, but got Unknown //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Expected O, but got Unknown //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Expected O, but got Unknown //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Expected O, but got Unknown //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Expected O, but got Unknown //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Expected O, but got Unknown config = PluginConfigurator.Create("CustomLevelTitles", "CustomLevelTitles"); config.SetIconWithURL(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icon.png")); enabler = new BoolField(config.rootPanel, "Enabled", "enabler", true); prelude1 = new StringField(config.rootPanel, "0-1", "prelude1", "INTO THE FIRE"); prelude2 = new StringField(config.rootPanel, "0-2", "prelude2", "THE MEATGRINDER"); prelude3 = new StringField(config.rootPanel, "0-3", "prelude3", "DOUBLE DOWN"); prelude4 = new StringField(config.rootPanel, "0-4", "prelude4", "A ONE MACHINE ARMY"); prelude5 = new StringField(config.rootPanel, "0-5", "prelude5", "CERBERUS"); limbo1 = new StringField(config.rootPanel, "1-1", "limbo1", "HEART OF THE SUNRISE"); limbo2 = new StringField(config.rootPanel, "1-2", "limbo2", "THE BURNING WOsRLD"); limbo3 = new StringField(config.rootPanel, "1-3", "limbo3", "HALL OF SACRED REMAINS"); limbo4 = new StringField(config.rootPanel, "1-4", "limbo4", "CLAIR DE LUNE"); lust1 = new StringField(config.rootPanel, "2-1", "lust1", "BRIDGE BURNER"); lust2 = new StringField(config.rootPanel, "2-2", "lust2", "DEATH AT 20,000 VOLTS"); lust3 = new StringField(config.rootPanel, "2-3", "lust3", "SHEER HEART ATTACK"); lust4 = new StringField(config.rootPanel, "2-4", "lust4", "COURT OF THE CORPSE KING"); gluttony1 = new StringField(config.rootPanel, "3-1", "gluttony1", "BELLY OF THE BEAST"); gluttony2 = new StringField(config.rootPanel, "3-2", "gluttony2", "IN THE FLESH"); greed1 = new StringField(config.rootPanel, "4-1", "greed1", "SLAVES TO POWER"); greed2 = new StringField(config.rootPanel, "4-2", "greed2", "GOD DAMN THE SUN"); greed3 = new StringField(config.rootPanel, "4-3", "greed3", "A SHOT IN THE DARK"); greed4 = new StringField(config.rootPanel, "4-4", "greed4", "CLAIR DE SOLEIL"); wrath1 = new StringField(config.rootPanel, "5-1", "wrath1", "IN THE WAKE OF POSEIDON"); wrath2 = new StringField(config.rootPanel, "5-2", "wrath2", "WAVES OF THE STARLESS SEA"); wrath3 = new StringField(config.rootPanel, "5-3", "wrath3", "SHIP OF FOOLS"); wrath4 = new StringField(config.rootPanel, "5-4", "wrath4", "LEVIATHAN"); heresy1 = new StringField(config.rootPanel, "6-1", "heresy1", "CRY FOR THE WEEPER"); heresy2 = new StringField(config.rootPanel, "6-2", "heresy2", "AESTHETICS OF HATE"); violence1 = new StringField(config.rootPanel, "7-1", "violence1", "GARDEN OF FORKING PATHS"); violence2 = new StringField(config.rootPanel, "7-2", "violence2", "LIGHT UP THE NIGHT"); violence3 = new StringField(config.rootPanel, "7-3", "violence3", "SUFFERING LEAVES, SUFFERING LEAVES"); violence4 = new StringField(config.rootPanel, "7-4", "violence4", "...LIKE ANTENNAS TO HEAVEN"); fraud1 = new StringField(config.rootPanel, "8-1", "fraud1", "HURTBREAK WONDERLAND"); fraud2 = new StringField(config.rootPanel, "8-2", "fraud2", "THROUGH THE MIRROR"); fraud3 = new StringField(config.rootPanel, "8-3", "fraud3", "DISINTEGRATION LOOP"); fraud4 = new StringField(config.rootPanel, "8-4", "fraud4", "FINAL FLIGHT"); prime1 = new StringField(config.rootPanel, "P-1", "prime1", "SOUL SURVIVOR"); prime2 = new StringField(config.rootPanel, "P-2", "prime2", "WAIT OF THE WORLD"); encore1 = new StringField(config.rootPanel, "0-E", "encore1", "THIS HEAT, AN EVIL HEAT"); encore2 = new StringField(config.rootPanel, "1-E", "encore2", "...THEN FELL THE ASHES"); } } [HarmonyPatch] public static class Patches { private static int eightThreeAppearances; [HarmonyPostfix] [HarmonyPatch(typeof(LevelNamePopup), "Start")] public static void Peeeeeeefiz(LevelNamePopup __instance) { eightThreeAppearances = 0; if (Configs.enabler.value) { string currentScene = SceneHelper.CurrentScene; if (1 == 0) { } string nameString = currentScene switch { "Level 0-1" => Configs.prelude1.value, "Level 0-2" => Configs.prelude2.value, "Level 0-3" => Configs.prelude3.value, "Level 0-4" => Configs.prelude4.value, "Level 0-5" => Configs.prelude5.value, "Level 1-1" => Configs.limbo1.value, "Level 1-2" => Configs.limbo2.value, "Level 1-3" => Configs.limbo3.value, "Level 1-4" => Configs.limbo4.value, "Level 2-1" => Configs.lust1.value, "Level 2-2" => Configs.lust2.value, "Level 2-3" => Configs.lust3.value, "Level 2-4" => Configs.lust4.value, "Level 3-1" => Configs.gluttony1.value, "Level 3-2" => Configs.gluttony2.value, "Level 4-1" => Configs.greed1.value, "Level 4-2" => Configs.greed2.value, "Level 4-3" => Configs.greed3.value, "Level 4-4" => Configs.greed4.value, "Level 5-1" => Configs.wrath1.value, "Level 5-2" => Configs.wrath2.value, "Level 5-3" => Configs.wrath3.value, "Level 5-4" => Configs.wrath4.value, "Level 6-1" => Configs.heresy1.value, "Level 6-2" => Configs.heresy2.value, "Level 7-1" => Configs.violence1.value, "Level 7-2" => Configs.violence2.value, "Level 7-3" => Configs.violence3.value, "Level 7-4" => Configs.violence4.value, "Level 8-1" => Configs.fraud1.value, "Level 8-2" => Configs.fraud2.value, "Level 8-4" => Configs.fraud4.value, "Level P-1" => Configs.prime1.value, "Level P-2" => Configs.prime2.value, "Level 0-E" => Configs.encore1.value, "Level 1-E" => Configs.encore2.value, _ => MonoSingleton.Instance.nameString, }; if (1 == 0) { } __instance.nameString = nameString; } } [HarmonyPrefix] [HarmonyPatch(typeof(LevelNamePopup), "NameAppear")] public static void Preeeeeeefiz(LevelNamePopup __instance) { if (Configs.enabler.value && !(SceneHelper.CurrentScene != "Level 8-3") && !__instance.activated) { eightThreeAppearances++; if (eightThreeAppearances >= 2) { __instance.nameString = Configs.fraud3.value; } } } [HarmonyPostfix] [HarmonyPatch(typeof(GetMissionName), "GetMissionNameOnly")] public static void Poooooooostfiz(int missionNum, ref string __result) { if (Configs.enabler.value && !SceneHelper.IsPlayingCustom) { string text = NameForMission(missionNum); if (!string.IsNullOrEmpty(text)) { __result = text; } } } private static string NameForMission(int missionNum) { if (1 == 0) { } string result = missionNum switch { 1 => Configs.prelude1.value, 2 => Configs.prelude2.value, 3 => Configs.prelude3.value, 4 => Configs.prelude4.value, 5 => Configs.prelude5.value, 6 => Configs.limbo1.value, 7 => Configs.limbo2.value, 8 => Configs.limbo3.value, 9 => Configs.limbo4.value, 10 => Configs.lust1.value, 11 => Configs.lust2.value, 12 => Configs.lust3.value, 13 => Configs.lust4.value, 14 => Configs.gluttony1.value, 15 => Configs.gluttony2.value, 16 => Configs.greed1.value, 17 => Configs.greed2.value, 18 => Configs.greed3.value, 19 => Configs.greed4.value, 20 => Configs.wrath1.value, 21 => Configs.wrath2.value, 22 => Configs.wrath3.value, 23 => Configs.wrath4.value, 24 => Configs.heresy1.value, 25 => Configs.heresy2.value, 26 => Configs.violence1.value, 27 => Configs.violence2.value, 28 => Configs.violence3.value, 29 => Configs.violence4.value, 30 => Configs.fraud1.value, 31 => Configs.fraud2.value, 32 => Configs.fraud3.value, 33 => Configs.fraud4.value, 100 => Configs.encore1.value, 101 => Configs.encore2.value, 666 => Configs.prime1.value, 667 => Configs.prime2.value, _ => null, }; if (1 == 0) { } return result; } } [BepInPlugin("Lotus.CustomLevelTitles", "CustomLevelTitles", "1.0.0")] public class Plugin : BaseUnityPlugin { public static Plugin Instance; public ManualLogSource log => ((BaseUnityPlugin)this).Logger; public void Awake() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) Instance = this; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)4; new Harmony("Lotus.CustomLevelTitles").PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"CustomLevelTitles loaded!"); Configs.createConfig(); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }