using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
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;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("DescriptionOverride")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0-alpha.0+bba318df88d26fcda20167919cf2bc620d23cd14")]
[assembly: AssemblyProduct("DescriptionOverride")]
[assembly: AssemblyTitle("DescriptionOverride")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.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;
}
}
}
[BepInPlugin("sparroh.descriptionoverride", "DescriptionOverride", "1.0.2")]
[MycoMod(/*Could not decode attribute arguments.*/)]
public class DescriptionOverridePlugin : BaseUnityPlugin
{
public const string PluginGUID = "sparroh.descriptionoverride";
public const string PluginName = "DescriptionOverride";
public const string PluginVersion = "1.0.2";
internal static ConfigEntry<bool> EnableOverride;
internal static ManualLogSource Logger;
private Harmony harmony;
private void Awake()
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
Logger = ((BaseUnityPlugin)this).Logger;
EnableOverride = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableDescriptionOverride", true, "If true, uses the serialized _description field instead of TextBlocks.");
harmony = new Harmony("sparroh.descriptionoverride");
harmony.PatchAll();
Logger.LogInfo((object)"DescriptionOverride loaded successfully.");
}
private void OnDestroy()
{
Harmony obj = harmony;
if (obj != null)
{
obj.UnpatchSelf();
}
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
public static class DescriptionPatch
{
private static bool Prefix(Upgrade __instance, ref string __result)
{
if (!DescriptionOverridePlugin.EnableOverride.Value)
{
return true;
}
string text = null;
FieldInfo fieldInfo = null;
try
{
GearUpgrade val = (GearUpgrade)(object)((__instance is GearUpgrade) ? __instance : null);
if (val != null)
{
fieldInfo = AccessTools.Field(typeof(GearUpgrade), "_description");
if (fieldInfo != null)
{
text = (string)fieldInfo.GetValue(val);
}
}
else
{
PlayerUpgrade val2 = (PlayerUpgrade)(object)((__instance is PlayerUpgrade) ? __instance : null);
if (val2 != null)
{
fieldInfo = AccessTools.Field(typeof(PlayerUpgrade), "_description");
if (fieldInfo != null)
{
text = (string)fieldInfo.GetValue(val2);
}
}
}
}
catch (Exception)
{
}
if (!string.IsNullOrEmpty(text))
{
__result = text;
return false;
}
return true;
}
}
[CompilerGenerated]
[ExcludeFromCodeCoverage]
internal static class GitVersionInformation
{
public const string AssemblySemFileVer = "0.0.1.0";
public const string AssemblySemVer = "0.0.1.0";
public const string BranchName = "master";
public const string BuildMetaData = "";
public const string CommitDate = "2025-10-17";
public const string CommitsSinceVersionSource = "1";
public const string EscapedBranchName = "master";
public const string FullBuildMetaData = "Branch.master.Sha.bba318df88d26fcda20167919cf2bc620d23cd14";
public const string FullSemVer = "0.0.1-1";
public const string InformationalVersion = "0.0.1-1+Branch.master.Sha.bba318df88d26fcda20167919cf2bc620d23cd14";
public const string Major = "0";
public const string MajorMinorPatch = "0.0.1";
public const string Minor = "0";
public const string Patch = "1";
public const string PreReleaseLabel = "";
public const string PreReleaseLabelWithDash = "";
public const string PreReleaseNumber = "1";
public const string PreReleaseTag = "1";
public const string PreReleaseTagWithDash = "-1";
public const string SemVer = "0.0.1-1";
public const string Sha = "bba318df88d26fcda20167919cf2bc620d23cd14";
public const string ShortSha = "bba318d";
public const string UncommittedChanges = "12";
public const string VersionSourceSha = "";
public const string WeightedPreReleaseNumber = "55001";
}
namespace DescriptionOverride
{
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "DescriptionOverride";
public const string PLUGIN_NAME = "DescriptionOverride";
public const string PLUGIN_VERSION = "0.0.0";
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}