Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ScannableCodes v1.0.9
BepInEx/plugins/ScannableCodes/uk.1a3.scannablecodes.dll
Decompiled 2 weeks agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("uk.1a3.scannablecodes")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.9.0")] [assembly: AssemblyInformationalVersion("1.0.9+0668548a3dd0a62d22866383aca1467d84877a4d")] [assembly: AssemblyProduct("ScannableCodes")] [assembly: AssemblyTitle("uk.1a3.scannablecodes")] [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 ScannableCodes { [BepInPlugin("uk.1a3.scannablecodes", "ScannableCodes", "1.0.9")] internal class PluginLoader : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("uk.1a3.scannablecodes"); private static bool initialized; internal static ManualLogSource logSource; public static PluginLoader Instance { get; private set; } private void Awake() { if (!initialized) { initialized = true; Instance = this; ScanConfig.InitConfig(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); harmony.PatchAll(executingAssembly); logSource = Logger.CreateLogSource("uk.1a3.scannablecodes"); logSource.LogInfo((object)"Loaded ScannableCodes"); } } public void BindConfig<T>(ref ConfigEntry<T> config, string section, string key, T defaultValue, string description = "") { config = ((BaseUnityPlugin)this).Config.Bind<T>(section, key, defaultValue, description); } } internal class ScanConfig { internal static ConfigEntry<bool> SpikeTrapScanEnabled; internal static void InitConfig() { PluginLoader.Instance.BindConfig(ref SpikeTrapScanEnabled, "Settings", "Spike Traps", defaultValue: true, "Should spike traps be able to be scanned?"); } } [HarmonyPatch] internal static class ScanPatch { [HarmonyPatch(typeof(TerminalAccessibleObject), "SetCodeTo")] [HarmonyPostfix] private static void SetCodeTo(ref TerminalAccessibleObject __instance, int codeIndex) { if (__instance.objectCode == null) { return; } Transform val = (Object.op_Implicit((Object)(object)((Component)__instance).transform.parent) ? ((Component)__instance).transform.parent : ((Component)__instance).transform); ScanNodeProperties componentInChildren = ((Component)val).GetComponentInChildren<ScanNodeProperties>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.subText = " " + __instance.objectCode.ToUpper(); if (__instance.isBigDoor) { componentInChildren.maxRange = 8; } else if ((Object)(object)((Component)__instance).GetComponent<Turret>() != (Object)null) { componentInChildren.maxRange = 10; } PluginLoader.logSource.LogDebug((object)$"Set code of {((Object)val).name}: {__instance.objectCode.ToUpper()} (Range: {componentInChildren.maxRange})"); } } [HarmonyPatch(typeof(SpikeRoofTrap), "Start")] [HarmonyPostfix] private static void SpikeRoofTrap_Start(SpikeRoofTrap __instance) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (ScanConfig.SpikeTrapScanEnabled.Value) { GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); obj.tag = "DoNotSet"; obj.layer = 22; obj.transform.parent = __instance.stickingPointsContainer; obj.transform.localPosition = new Vector3(-0.8f, 0f, -0.5f); Object.Destroy((Object)(object)obj.GetComponent<MeshFilter>()); Object.Destroy((Object)(object)obj.GetComponent<MeshRenderer>()); ScanNodeProperties obj2 = obj.AddComponent<ScanNodeProperties>(); obj2.headerText = "Spike Trap"; obj2.subText = ""; obj2.requiresLineOfSight = true; obj2.maxRange = 8; obj2.minRange = 1; obj2.scrapValue = 0; obj2.creatureScanID = -1; obj2.nodeType = 1; } } } internal static class MyPluginInfo { public const string PLUGIN_GUID = "uk.1a3.scannablecodes"; public const string PLUGIN_NAME = "ScannableCodes"; public const string PLUGIN_VERSION = "1.0.9"; } }