Decompiled source of ItemInfoDisplayForkedRU v1.0.10

plugins/com.azurexl.ItemInfoDisplayUA.dll

Decompiled 2 weeks ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Resources;
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 ItemInfoDisplay.Properties;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Peak;
using Peak.Afflictions;
using TMPro;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.azurexl.ItemInfoDisplayUA")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.10.0")]
[assembly: AssemblyInformationalVersion("1.0.10+5e2f55f776dbfce5d48664c62c49b2da3056a5d5")]
[assembly: AssemblyProduct("com.azurexl.ItemInfoDisplayUA")]
[assembly: AssemblyTitle("ItemInfoDisplay")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.10.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace ItemInfoDisplay
{
	[BepInPlugin("com.azurexl.ItemInfoDisplayUA", "ItemInfoDisplay", "1.0.10")]
	public class Plugin : BaseUnityPlugin
	{
		private static class ItemInfoDisplayUpdatePatch
		{
			[HarmonyPatch(typeof(CharacterItems), "Update")]
			[HarmonyPostfix]
			private static void ItemInfoDisplayUpdate(CharacterItems __instance)
			{
				try
				{
					if ((Object)(object)guiManager == (Object)null)
					{
						AddDisplayObject();
					}
					else if ((Object)(object)Character.observedCharacter.data.currentItem != (Object)null)
					{
						if (hasChanged)
						{
							hasChanged = false;
							ProcessItemGameObject();
						}
						else if (Mathf.Abs(Character.observedCharacter.data.sinceItemAttach - lastKnownSinceItemAttach) >= configForceUpdateTime.Value)
						{
							hasChanged = true;
							lastKnownSinceItemAttach = Character.observedCharacter.data.sinceItemAttach;
						}
						if (!((Component)itemInfoDisplayTextMesh).gameObject.activeSelf)
						{
							((Component)itemInfoDisplayTextMesh).gameObject.SetActive(true);
						}
					}
					else if (((Component)itemInfoDisplayTextMesh).gameObject.activeSelf)
					{
						((Component)itemInfoDisplayTextMesh).gameObject.SetActive(false);
					}
				}
				catch (Exception ex)
				{
					Log.LogError((object)(ex.Message + ex.StackTrace));
				}
			}
		}

		private static class ItemInfoDisplayEquipPatch
		{
			[HarmonyPatch(typeof(CharacterItems), "Equip")]
			[HarmonyPostfix]
			private static void ItemInfoDisplayEquip(CharacterItems __instance)
			{
				try
				{
					if (Character.observedCharacter == __instance.character)
					{
						hasChanged = true;
					}
				}
				catch (Exception ex)
				{
					Log.LogError((object)(ex.Message + ex.StackTrace));
				}
			}
		}

		private static class ItemInfoDisplayFinishCookingPatch
		{
			[HarmonyPatch(typeof(ItemCooking), "FinishCooking")]
			[HarmonyPostfix]
			private static void ItemInfoDisplayFinishCooking(ItemCooking __instance)
			{
				try
				{
					if (Character.observedCharacter == ((ItemComponent)__instance).item.holderCharacter)
					{
						hasChanged = true;
					}
				}
				catch (Exception ex)
				{
					Log.LogError((object)(ex.Message + ex.StackTrace));
				}
			}
		}

		private static class ItemInfoDisplayReduceUsesRPCPatch
		{
			[HarmonyPatch(typeof(Action_ReduceUses), "ReduceUsesRPC")]
			[HarmonyPostfix]
			private static void ItemInfoDisplayReduceUsesRPC(Action_ReduceUses __instance)
			{
				try
				{
					if (Character.observedCharacter == ((ItemActionBase)__instance).character)
					{
						hasChanged = true;
					}
				}
				catch (Exception ex)
				{
					Log.LogError((object)(ex.Message + ex.StackTrace));
				}
			}
		}

		private static GUIManager guiManager;

		private static TextMeshProUGUI itemInfoDisplayTextMesh;

		private static Dictionary<string, string> effectColors = new Dictionary<string, string>();

		private static float lastKnownSinceItemAttach;

		private static bool hasChanged;

		private static ConfigEntry<float> configFontSize;

		private static ConfigEntry<float> configOutlineWidth;

		private static ConfigEntry<float> configLineSpacing;

		private static ConfigEntry<float> configSizeDeltaX;

		private static ConfigEntry<float> configForceUpdateTime;

		public const string Id = "com.azurexl.ItemInfoDisplayUA";

		internal static ManualLogSource Log { get; private set; } = null;

		public static string Name => "ItemInfoDisplay";

		public static string Version => "1.0.10";

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			InitEffectColors(effectColors);
			lastKnownSinceItemAttach = 0f;
			hasChanged = true;
			configFontSize = ((BaseUnityPlugin)this).Config.Bind<float>("ItemInfoDisplay", "Font Size", 20f, "Customize the Font Size for description text.");
			configOutlineWidth = ((BaseUnityPlugin)this).Config.Bind<float>("ItemInfoDisplay", "Outline Width", 0.08f, "Customize the Outline Width for item description text.");
			configLineSpacing = ((BaseUnityPlugin)this).Config.Bind<float>("ItemInfoDisplay", "Line Spacing", -35f, "Customize the Line Spacing for item description text.");
			configSizeDeltaX = ((BaseUnityPlugin)this).Config.Bind<float>("ItemInfoDisplay", "Size Delta X", 550f, "Customize the horizontal length of the container for the mod. Increasing moves text left, decreasing moves text right.");
			configForceUpdateTime = ((BaseUnityPlugin)this).Config.Bind<float>("ItemInfoDisplay", "Force Update Time", 1f, "Customize the time in seconds until the mod forces an update for the item.");
			Harmony.CreateAndPatchAll(typeof(ItemInfoDisplayUpdatePatch), (string)null);
			Harmony.CreateAndPatchAll(typeof(ItemInfoDisplayEquipPatch), (string)null);
			Harmony.CreateAndPatchAll(typeof(ItemInfoDisplayFinishCookingPatch), (string)null);
			Harmony.CreateAndPatchAll(typeof(ItemInfoDisplayReduceUsesRPCPatch), (string)null);
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
		}

		private unsafe static void ProcessItemGameObject()
		{
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Expected O, but got Unknown
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Expected O, but got Unknown
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Expected O, but got Unknown
			//IL_0385: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Expected O, but got Unknown
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Expected O, but got Unknown
			//IL_0442: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Expected O, but got Unknown
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_049d: Expected O, but got Unknown
			//IL_054c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0553: Expected O, but got Unknown
			//IL_058e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0595: Expected O, but got Unknown
			//IL_073f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0746: Expected O, but got Unknown
			//IL_07b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bc: Expected O, but got Unknown
			//IL_0823: Unknown result type (might be due to invalid IL or missing references)
			//IL_082a: Expected O, but got Unknown
			//IL_09e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ef: Expected O, but got Unknown
			//IL_0651: Unknown result type (might be due to invalid IL or missing references)
			//IL_0656: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c31: Expected O, but got Unknown
			//IL_0ce8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cef: Expected O, but got Unknown
			//IL_0e40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e47: Expected O, but got Unknown
			//IL_0f2b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f32: Expected O, but got Unknown
			//IL_0fc8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fcf: Expected O, but got Unknown
			//IL_1047: Unknown result type (might be due to invalid IL or missing references)
			//IL_104e: Expected O, but got Unknown
			//IL_1477: Unknown result type (might be due to invalid IL or missing references)
			//IL_147e: Expected O, but got Unknown
			//IL_166f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1676: Expected O, but got Unknown
			//IL_1813: Unknown result type (might be due to invalid IL or missing references)
			//IL_181a: Expected O, but got Unknown
			//IL_195d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1964: Expected O, but got Unknown
			//IL_19f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_19ff: Expected O, but got Unknown
			//IL_1b8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b92: Expected O, but got Unknown
			//IL_1c64: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c6b: Expected O, but got Unknown
			//IL_1d5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d64: Expected O, but got Unknown
			Item currentItem = Character.observedCharacter.data.currentItem;
			GameObject gameObject = ((Component)currentItem).gameObject;
			Component[] components = gameObject.GetComponents(typeof(Component));
			bool flag = false;
			string text = "";
			string text2 = "";
			string text3 = "";
			string text4 = "";
			string text5 = "";
			((TMP_Text)itemInfoDisplayTextMesh).text = "";
			text2 = ((Ascents.itemWeightModifier <= 0) ? (text2 + GetText("WEIGHT", effectColors["Weight"], ((float)currentItem.carryWeight * 2.5f).ToString("F1").Replace(".0", "")) + "</color>") : (text2 + GetText("WEIGHT", effectColors["Weight"], ((float)(currentItem.carryWeight + Ascents.itemWeightModifier) * 2.5f).ToString("F1").Replace(".0", "")) + "</color>"));
			if (((Object)gameObject).name.Equals("Bugle(Clone)"))
			{
				TextMeshProUGUI obj = itemInfoDisplayTextMesh;
				((TMP_Text)obj).text = ((TMP_Text)obj).text + GetText("Bugle") + "\n";
			}
			else if (((Object)gameObject).name.Equals("Pirate Compass(Clone)"))
			{
				TextMeshProUGUI obj2 = itemInfoDisplayTextMesh;
				((TMP_Text)obj2).text = ((TMP_Text)obj2).text + GetText("Pirate Compass", effectColors["Injury"]);
			}
			else if (((Object)gameObject).name.Equals("Compass(Clone)"))
			{
				TextMeshProUGUI obj3 = itemInfoDisplayTextMesh;
				((TMP_Text)obj3).text = ((TMP_Text)obj3).text + GetText("Compass", effectColors["Injury"]);
			}
			else if (((Object)gameObject).name.Equals("Shell Big(Clone)"))
			{
				TextMeshProUGUI obj4 = itemInfoDisplayTextMesh;
				((TMP_Text)obj4).text = ((TMP_Text)obj4).text + GetText("Shell Big", effectColors["Hunger"]);
			}
			TextMeshProUGUI val10;
			for (int i = 0; i < components.Length; i++)
			{
				if (((object)components[i]).GetType() == typeof(ItemUseFeedback))
				{
					ItemUseFeedback val = (ItemUseFeedback)components[i];
					if (val.useAnimation.Equals("Eat") || val.useAnimation.Equals("Drink") || val.useAnimation.Equals("Heal"))
					{
						flag = true;
					}
				}
				else if (((object)components[i]).GetType() == typeof(Action_Consume))
				{
					flag = true;
				}
				else if (((object)components[i]).GetType() == typeof(Action_RestoreHunger))
				{
					Action_RestoreHunger val2 = (Action_RestoreHunger)components[i];
					text += ProcessEffect(val2.restorationAmount * -1f, "Hunger");
				}
				else if (((object)components[i]).GetType() == typeof(Action_GiveExtraStamina))
				{
					Action_GiveExtraStamina val3 = (Action_GiveExtraStamina)components[i];
					text += ProcessEffect(val3.amount, "Extra Stamina");
				}
				else if (((object)components[i]).GetType() == typeof(Action_InflictPoison))
				{
					Action_InflictPoison val4 = (Action_InflictPoison)components[i];
					text += GetText("InflictPoison", val4.delay.ToString(), ProcessEffectOverTime(val4.poisonPerSecond, 1f, val4.inflictionTime, "Poison"));
				}
				else if (((object)components[i]).GetType() == typeof(Action_AddOrRemoveThorns))
				{
					Action_AddOrRemoveThorns val5 = (Action_AddOrRemoveThorns)components[i];
					text += ProcessEffect((float)val5.thornCount * 0.05f, "Thorns");
				}
				else if (((object)components[i]).GetType() == typeof(Action_ModifyStatus))
				{
					Action_ModifyStatus val6 = (Action_ModifyStatus)components[i];
					text += ProcessEffect(val6.changeAmount, ((object)Unsafe.As<STATUSTYPE, STATUSTYPE>(ref val6.statusType)/*cast due to .constrained prefix*/).ToString());
				}
				else if (((object)components[i]).GetType() == typeof(Action_ApplyMassAffliction))
				{
					Action_ApplyMassAffliction val7 = (Action_ApplyMassAffliction)components[i];
					text5 += GetText("ApplyMassAffliction");
					text5 += ProcessAffliction(((Action_ApplyAffliction)val7).affliction);
					if (((Action_ApplyAffliction)val7).extraAfflictions.Length == 0)
					{
						continue;
					}
					for (int j = 0; j < ((Action_ApplyAffliction)val7).extraAfflictions.Length; j++)
					{
						if (text5.EndsWith('\n'))
						{
							text5 = text5.Remove(text5.Length - 1);
						}
						text5 = text5 + ",\n" + ProcessAffliction(((Action_ApplyAffliction)val7).extraAfflictions[j]);
					}
				}
				else if (((object)components[i]).GetType() == typeof(Action_ApplyAffliction))
				{
					Action_ApplyAffliction val8 = (Action_ApplyAffliction)components[i];
					text5 += ProcessAffliction(val8.affliction);
				}
				else if (((object)components[i]).GetType() == typeof(Action_ClearAllStatus))
				{
					Action_ClearAllStatus val9 = (Action_ClearAllStatus)components[i];
					TextMeshProUGUI obj5 = itemInfoDisplayTextMesh;
					((TMP_Text)obj5).text = ((TMP_Text)obj5).text + GetText("ClearAllStatusLocalized", effectColors["ItemInfoDisplayPositive"]).TrimEnd('\n');
					if (val9.excludeCurse)
					{
						TextMeshProUGUI obj6 = itemInfoDisplayTextMesh;
						((TMP_Text)obj6).text = ((TMP_Text)obj6).text + GetText("ExceptStatus", effectColors["Curse"], GetText("Effect_CURSE").ToUpper());
					}
					if (val9.otherExclusions.Count > 0)
					{
						foreach (STATUSTYPE otherExclusion in val9.otherExclusions)
						{
							val10 = itemInfoDisplayTextMesh;
							((TMP_Text)val10).text = ((TMP_Text)val10).text + ", " + effectColors[((object)(*(STATUSTYPE*)(&otherExclusion))/*cast due to .constrained prefix*/).ToString()] + GetText("Effect_" + ((object)(*(STATUSTYPE*)(&otherExclusion))/*cast due to .constrained prefix*/).ToString().ToUpper()).ToUpper() + "</color>";
						}
					}
					((TMP_Text)itemInfoDisplayTextMesh).text = ((TMP_Text)itemInfoDisplayTextMesh).text.Replace(", <#E13542>CRAB</color>", "") + "\n";
				}
				else if (((object)components[i]).GetType() == typeof(Action_ConsumeAndSpawn))
				{
					Action_ConsumeAndSpawn val11 = (Action_ConsumeAndSpawn)components[i];
					if (((object)val11.itemToSpawn).ToString().Contains("Peel"))
					{
						TextMeshProUGUI obj7 = itemInfoDisplayTextMesh;
						((TMP_Text)obj7).text = ((TMP_Text)obj7).text + GetText("ConsumeAndSpawn_Peel");
					}
				}
				else if (((object)components[i]).GetType() == typeof(Action_ReduceUses))
				{
					OptionableIntItemData val12 = (OptionableIntItemData)currentItem.data.data[(DataEntryKey)2];
					if (val12.HasData && val12.Value > 1)
					{
						text3 += GetText("ReduceUses", val12.Value.ToString());
					}
				}
				else if (((object)components[i]).GetType() == typeof(Lantern))
				{
					Lantern val13 = (Lantern)components[i];
					if (((Object)gameObject).name.Equals("Torch(Clone)"))
					{
						TextMeshProUGUI obj8 = itemInfoDisplayTextMesh;
						((TMP_Text)obj8).text = ((TMP_Text)obj8).text + GetText("Torch");
					}
					else
					{
						text5 += GetText("Lantern");
					}
					if (((Object)gameObject).name.Equals("Lantern_Faerie(Clone)"))
					{
						StatusField component = ((Component)gameObject.transform.Find("FaerieLantern/Light/Heat")).GetComponent<StatusField>();
						text5 += ProcessEffectOverTime(((StatusFieldBase)component).statusAmountPerSecond, 1f, val13.startingFuel, ((object)Unsafe.As<STATUSTYPE, STATUSTYPE>(ref ((StatusFieldBase)component).statusType)/*cast due to .constrained prefix*/).ToString());
						foreach (StatusFieldStatus additionalStatus in ((StatusFieldBase)component).additionalStatuses)
						{
							if (text5.EndsWith('\n'))
							{
								text5 = text5.Remove(text5.Length - 1);
							}
							text5 = text5 + ",\n" + ProcessEffectOverTime(additionalStatus.statusAmountPerSecond, 1f, val13.startingFuel, ((object)Unsafe.As<STATUSTYPE, STATUSTYPE>(ref additionalStatus.statusType)/*cast due to .constrained prefix*/).ToString());
						}
					}
					else if (((Object)gameObject).name.Equals("Lantern(Clone)"))
					{
						StatusField component2 = ((Component)gameObject.transform.Find("GasLantern/Light/Heat")).GetComponent<StatusField>();
						text5 += ProcessEffectOverTime(((StatusFieldBase)component2).statusAmountPerSecond, 1f, val13.startingFuel, ((object)Unsafe.As<STATUSTYPE, STATUSTYPE>(ref ((StatusFieldBase)component2).statusType)/*cast due to .constrained prefix*/).ToString());
					}
				}
				else if (((object)components[i]).GetType() == typeof(Action_RaycastDart))
				{
					Action_RaycastDart val14 = (Action_RaycastDart)components[i];
					flag = true;
					text5 += GetText("RaycastDart");
					for (int k = 0; k < val14.afflictionsOnHit.Length; k++)
					{
						text5 += ProcessAffliction(val14.afflictionsOnHit[k]);
						if (text5.EndsWith('\n'))
						{
							text5 = text5.Remove(text5.Length - 1);
						}
						text5 += ",\n";
					}
					if (text5.EndsWith('\n'))
					{
						text5 = text5.Remove(text5.Length - 2);
					}
					text5 += "\n";
				}
				else if (((object)components[i]).GetType() == typeof(MagicBugle))
				{
					TextMeshProUGUI obj9 = itemInfoDisplayTextMesh;
					((TMP_Text)obj9).text = ((TMP_Text)obj9).text + GetText("MagicBugle");
				}
				else if (((object)components[i]).GetType() == typeof(ClimbingSpikeComponent))
				{
					TextMeshProUGUI obj10 = itemInfoDisplayTextMesh;
					((TMP_Text)obj10).text = ((TMP_Text)obj10).text + GetText("ClimbingSpike", effectColors["Extra Stamina"]);
				}
				else if (((object)components[i]).GetType() == typeof(Action_Flare))
				{
					TextMeshProUGUI obj11 = itemInfoDisplayTextMesh;
					((TMP_Text)obj11).text = ((TMP_Text)obj11).text + GetText("Flare");
				}
				else if (((object)components[i]).GetType() == typeof(Backpack))
				{
					TextMeshProUGUI obj12 = itemInfoDisplayTextMesh;
					((TMP_Text)obj12).text = ((TMP_Text)obj12).text + GetText("Backpack");
				}
				else if (((object)components[i]).GetType() == typeof(BananaPeel))
				{
					TextMeshProUGUI obj13 = itemInfoDisplayTextMesh;
					((TMP_Text)obj13).text = ((TMP_Text)obj13).text + GetText("BananaPeel", effectColors["Hunger"]);
				}
				else if (((object)components[i]).GetType() == typeof(Constructable))
				{
					Constructable val15 = (Constructable)components[i];
					if (((Object)val15.constructedPrefab).name.Equals("PortableStovetop_Placed"))
					{
						TextMeshProUGUI obj14 = itemInfoDisplayTextMesh;
						((TMP_Text)obj14).text = ((TMP_Text)obj14).text + GetText("Constructable_PortableStovetop_Placed", effectColors["Injury"], val15.constructedPrefab.GetComponent<Campfire>().burnsFor.ToString());
					}
					else
					{
						TextMeshProUGUI obj15 = itemInfoDisplayTextMesh;
						((TMP_Text)obj15).text = ((TMP_Text)obj15).text + GetText("Constructable");
					}
				}
				else if (((object)components[i]).GetType() == typeof(RopeSpool))
				{
					RopeSpool val16 = (RopeSpool)components[i];
					if (val16.isAntiRope)
					{
						TextMeshProUGUI obj16 = itemInfoDisplayTextMesh;
						((TMP_Text)obj16).text = ((TMP_Text)obj16).text + GetText("RopeSpool_AntiRope");
					}
					else
					{
						TextMeshProUGUI obj17 = itemInfoDisplayTextMesh;
						((TMP_Text)obj17).text = ((TMP_Text)obj17).text + GetText("RopeSpool");
					}
					TextMeshProUGUI obj18 = itemInfoDisplayTextMesh;
					((TMP_Text)obj18).text = ((TMP_Text)obj18).text + GetText("RopeSpool_TIP", (val16.minSegments / 4f).ToString("F2").Replace(".0", ""), ((float)Rope.MaxSegments / 4f).ToString("F1").Replace(".0", ""));
					if (configForceUpdateTime.Value <= 1f)
					{
						text3 += GetText("RopeLeft", (val16.RopeFuel / 4f).ToString("F2").Replace(".00", ""));
					}
				}
				else if (((object)components[i]).GetType() == typeof(RopeShooter))
				{
					RopeShooter val17 = (RopeShooter)components[i];
					if (((Object)val17.ropeAnchorWithRopePref).name.Equals("RopeAnchorForRopeShooterAnti"))
					{
						TextMeshProUGUI obj19 = itemInfoDisplayTextMesh;
						((TMP_Text)obj19).text = ((TMP_Text)obj19).text + GetText("RopeShooter_Anti", (val17.maxLength / 4f).ToString("F1").Replace(".0", ""));
					}
					else
					{
						TextMeshProUGUI obj20 = itemInfoDisplayTextMesh;
						((TMP_Text)obj20).text = ((TMP_Text)obj20).text + GetText("RopeShooter", (val17.maxLength / 4f).ToString("F1").Replace(".0", ""));
					}
				}
				else if (((object)components[i]).GetType() == typeof(Antigrav))
				{
					Antigrav val18 = (Antigrav)components[i];
					if (val18.intensity != 0f)
					{
						text5 += GetText("Antigrav", effectColors["Injury"]);
					}
				}
				else if (((object)components[i]).GetType() == typeof(Action_Balloon))
				{
					text5 += GetText("Balloon");
				}
				else if (((object)components[i]).GetType() == typeof(VineShooter))
				{
					VineShooter val19 = (VineShooter)components[i];
					TextMeshProUGUI obj21 = itemInfoDisplayTextMesh;
					((TMP_Text)obj21).text = ((TMP_Text)obj21).text + GetText("VineShooter", (val19.maxLength / 1.6666666f).ToString("F1").Replace(".0", ""));
				}
				else if (((object)components[i]).GetType() == typeof(ShelfShroom))
				{
					ShelfShroom val20 = (ShelfShroom)components[i];
					if (((Object)val20.instantiateOnBreak).name.Equals("HealingPuffShroomSpawn"))
					{
						GameObject gameObject2 = ((Component)val20.instantiateOnBreak.transform.Find("VFX_SporeHealingExplo")).gameObject;
						AOE component3 = gameObject2.GetComponent<AOE>();
						GameObject gameObject3 = ((Component)gameObject2.transform.Find("VFX_SporePoisonExplo")).gameObject;
						AOE component4 = gameObject3.GetComponent<AOE>();
						AOE[] components2 = gameObject3.GetComponents<AOE>();
						TimeEvent component5 = gameObject3.GetComponent<TimeEvent>();
						RemoveAfterSeconds component6 = gameObject3.GetComponent<RemoveAfterSeconds>();
						TextMeshProUGUI obj22 = itemInfoDisplayTextMesh;
						((TMP_Text)obj22).text = ((TMP_Text)obj22).text + GetText("HealingPuffShroom", effectColors["Hunger"]);
						TextMeshProUGUI obj23 = itemInfoDisplayTextMesh;
						((TMP_Text)obj23).text = ((TMP_Text)obj23).text + ProcessEffect(Mathf.Round(component3.statusAmount * 0.9f * 40f) / 40f, ((object)Unsafe.As<STATUSTYPE, STATUSTYPE>(ref component3.statusType)/*cast due to .constrained prefix*/).ToString());
						TextMeshProUGUI obj24 = itemInfoDisplayTextMesh;
						((TMP_Text)obj24).text = ((TMP_Text)obj24).text + ProcessEffectOverTime(Mathf.Round(component4.statusAmount * (1f / component5.rate) * 40f) / 40f, 1f, component6.seconds, ((object)Unsafe.As<STATUSTYPE, STATUSTYPE>(ref component4.statusType)/*cast due to .constrained prefix*/).ToString());
						if (components2.Length > 1)
						{
							TextMeshProUGUI obj25 = itemInfoDisplayTextMesh;
							((TMP_Text)obj25).text = ((TMP_Text)obj25).text + ProcessEffectOverTime(Mathf.Round(components2[1].statusAmount * (1f / component5.rate) * 40f) / 40f, 1f, component6.seconds + 1f, ((object)Unsafe.As<STATUSTYPE, STATUSTYPE>(ref components2[1].statusType)/*cast due to .constrained prefix*/).ToString());
						}
					}
					else if (((Object)val20.instantiateOnBreak).name.Equals("ShelfShroomSpawn"))
					{
						TextMeshProUGUI obj26 = itemInfoDisplayTextMesh;
						((TMP_Text)obj26).text = ((TMP_Text)obj26).text + GetText("ShelfShroomSpawn", effectColors["Hunger"]);
					}
					else if (((Object)val20.instantiateOnBreak).name.Equals("BounceShroomSpawn"))
					{
						TextMeshProUGUI obj27 = itemInfoDisplayTextMesh;
						((TMP_Text)obj27).text = ((TMP_Text)obj27).text + GetText("BounceShroomSpawn", effectColors["Hunger"]);
					}
				}
				else if (((object)components[i]).GetType() == typeof(ScoutEffigy))
				{
					TextMeshProUGUI obj28 = itemInfoDisplayTextMesh;
					((TMP_Text)obj28).text = ((TMP_Text)obj28).text + GetText("ScoutEffigy", effectColors["Extra Stamina"]);
				}
				else if (((object)components[i]).GetType() == typeof(Action_Die))
				{
					TextMeshProUGUI obj29 = itemInfoDisplayTextMesh;
					((TMP_Text)obj29).text = ((TMP_Text)obj29).text + GetText("DieWhenUsed", effectColors["Curse"]);
				}
				else if (((object)components[i]).GetType() == typeof(Action_SpawnGuidebookPage))
				{
					flag = true;
					TextMeshProUGUI obj30 = itemInfoDisplayTextMesh;
					((TMP_Text)obj30).text = ((TMP_Text)obj30).text + GetText("SpawnGuidebookPage");
				}
				else if (((object)components[i]).GetType() == typeof(Action_Guidebook))
				{
					TextMeshProUGUI obj31 = itemInfoDisplayTextMesh;
					((TMP_Text)obj31).text = ((TMP_Text)obj31).text + GetText("Guidebook");
				}
				else if (((object)components[i]).GetType() == typeof(Action_CallScoutmaster))
				{
					TextMeshProUGUI obj32 = itemInfoDisplayTextMesh;
					((TMP_Text)obj32).text = ((TMP_Text)obj32).text + GetText("CallScoutmaster", effectColors["Injury"]);
				}
				else if (((object)components[i]).GetType() == typeof(Action_MoraleBoost))
				{
					Action_MoraleBoost val21 = (Action_MoraleBoost)components[i];
					if (val21.boostRadius < 0f)
					{
						TextMeshProUGUI obj33 = itemInfoDisplayTextMesh;
						((TMP_Text)obj33).text = ((TMP_Text)obj33).text + GetText("MoraleBoostSelf", effectColors["ItemInfoDisplayPositive"], effectColors["Extra Stamina"], (val21.baselineStaminaBoost * 100f).ToString("F1").Replace(".0", ""));
					}
					else if (val21.boostRadius > 0f)
					{
						TextMeshProUGUI obj34 = itemInfoDisplayTextMesh;
						((TMP_Text)obj34).text = ((TMP_Text)obj34).text + GetText("MoraleBoostNearby", effectColors["ItemInfoDisplayPositive"], effectColors["Extra Stamina"], (val21.baselineStaminaBoost * 100f).ToString("F1").Replace(".0", ""));
					}
				}
				else if (((object)components[i]).GetType() == typeof(Breakable))
				{
					TextMeshProUGUI obj35 = itemInfoDisplayTextMesh;
					((TMP_Text)obj35).text = ((TMP_Text)obj35).text + GetText("Breakable", effectColors["Hunger"]);
				}
				else if (((object)components[i]).GetType() == typeof(Bonkable))
				{
					TextMeshProUGUI obj36 = itemInfoDisplayTextMesh;
					((TMP_Text)obj36).text = ((TMP_Text)obj36).text + GetText("Bonkable", effectColors["Hunger"], effectColors["Injury"]);
				}
				else if (((object)components[i]).GetType() == typeof(MagicBean))
				{
					MagicBean val22 = (MagicBean)components[i];
					TextMeshProUGUI obj37 = itemInfoDisplayTextMesh;
					((TMP_Text)obj37).text = ((TMP_Text)obj37).text + GetText("MagicBean", effectColors["Hunger"], (val22.plantPrefab.maxLength / 2f).ToString("F1").Replace(".0", ""));
				}
				else if (((object)components[i]).GetType() == typeof(BingBong))
				{
					TextMeshProUGUI obj38 = itemInfoDisplayTextMesh;
					((TMP_Text)obj38).text = ((TMP_Text)obj38).text + GetText("BingBong");
				}
				else if (((object)components[i]).GetType() == typeof(Action_Passport))
				{
					TextMeshProUGUI obj39 = itemInfoDisplayTextMesh;
					((TMP_Text)obj39).text = ((TMP_Text)obj39).text + GetText("Passport") + "\n";
				}
				else if (((object)components[i]).GetType() == typeof(Actions_Binoculars))
				{
					TextMeshProUGUI obj40 = itemInfoDisplayTextMesh;
					((TMP_Text)obj40).text = ((TMP_Text)obj40).text + GetText("Binoculars");
				}
				else if (((object)components[i]).GetType() == typeof(Action_WarpToRandomPlayer))
				{
					TextMeshProUGUI obj41 = itemInfoDisplayTextMesh;
					((TMP_Text)obj41).text = ((TMP_Text)obj41).text + GetText("WarpToRandomPlayer");
				}
				else if (((object)components[i]).GetType() == typeof(Action_WarpToBiome))
				{
					Action_WarpToBiome val23 = (Action_WarpToBiome)components[i];
					TextMeshProUGUI obj42 = itemInfoDisplayTextMesh;
					((TMP_Text)obj42).text = ((TMP_Text)obj42).text + GetText("WarpToBiome", ((object)Unsafe.As<Segment, Segment>(ref val23.segmentToWarpTo)/*cast due to .constrained prefix*/).ToString().ToUpper());
				}
				else if (((object)components[i]).GetType() == typeof(Parasol))
				{
					TextMeshProUGUI obj43 = itemInfoDisplayTextMesh;
					((TMP_Text)obj43).text = ((TMP_Text)obj43).text + GetText("Parasol") + "\n";
				}
				else if (((object)components[i]).GetType() == typeof(Frisbee))
				{
					TextMeshProUGUI obj44 = itemInfoDisplayTextMesh;
					((TMP_Text)obj44).text = ((TMP_Text)obj44).text + GetText("Frisbee", effectColors["Hunger"]);
				}
				else if (((object)components[i]).GetType() == typeof(Action_ConstructableScoutCannonScroll))
				{
					TextMeshProUGUI obj45 = itemInfoDisplayTextMesh;
					((TMP_Text)obj45).text = ((TMP_Text)obj45).text + GetText("ConstructableScoutCannonScroll");
				}
				else if (((object)components[i]).GetType() == typeof(Dynamite))
				{
					Dynamite val24 = (Dynamite)components[i];
					TextMeshProUGUI obj46 = itemInfoDisplayTextMesh;
					((TMP_Text)obj46).text = ((TMP_Text)obj46).text + GetText("Dynamite", effectColors["Injury"], (val24.explosionPrefab.GetComponent<AOE>().statusAmount * 100f).ToString("F1").Replace(".0", ""));
				}
				else if (((object)components[i]).GetType() == typeof(Scorpion))
				{
					Scorpion val25 = (Scorpion)components[i];
					if (configForceUpdateTime.Value <= 1f)
					{
						float num = Mathf.Max(0.5f, 1f - currentItem.holderCharacter.refs.afflictions.statusSum + 0.05f) * 100f;
						TextMeshProUGUI obj47 = itemInfoDisplayTextMesh;
						((TMP_Text)obj47).text = ((TMP_Text)obj47).text + GetText("ScorpionExact", effectColors["Poison"], effectColors["Curse"], effectColors["Heat"], num.ToString("F1").Replace(".0", ""), val25.totalPoisonTime.ToString("F1").Replace(".0", ""));
					}
					else
					{
						TextMeshProUGUI obj48 = itemInfoDisplayTextMesh;
						((TMP_Text)obj48).text = ((TMP_Text)obj48).text + GetText("ScorpionRange", effectColors["Poison"], effectColors["Curse"], effectColors["Heat"], val25.totalPoisonTime.ToString("F1").Replace(".0", ""));
					}
				}
				else if (((object)components[i]).GetType() == typeof(Action_Spawn))
				{
					Action_Spawn val26 = (Action_Spawn)components[i];
					if (((Object)val26.objectToSpawn).name.Equals("VFX_Sunscreen"))
					{
						AOE component7 = ((Component)val26.objectToSpawn.transform.Find("AOE")).GetComponent<AOE>();
						RemoveAfterSeconds component8 = ((Component)val26.objectToSpawn.transform.Find("AOE")).GetComponent<RemoveAfterSeconds>();
						TextMeshProUGUI obj49 = itemInfoDisplayTextMesh;
						((TMP_Text)obj49).text = ((TMP_Text)obj49).text + GetText("VFX_Sunscreen", component8.seconds.ToString("F1").Replace(".0", ""), ProcessAffliction(component7.affliction));
					}
				}
				else if (((object)components[i]).GetType() == typeof(CactusBall))
				{
					CactusBall val27 = (CactusBall)components[i];
					TextMeshProUGUI obj50 = itemInfoDisplayTextMesh;
					((TMP_Text)obj50).text = ((TMP_Text)obj50).text + GetText("CactusBall", effectColors["Thorns"], effectColors["Hunger"], (((StickyItemComponent)val27).throwChargeRequirement * 100f).ToString("F1").Replace(".0", ""));
				}
				else if (((object)components[i]).GetType() == typeof(BingBongShieldWhileHolding))
				{
					TextMeshProUGUI obj51 = itemInfoDisplayTextMesh;
					((TMP_Text)obj51).text = ((TMP_Text)obj51).text + GetText("BingBongShieldWhileHolding", effectColors["Shield"]);
				}
				else if (((object)components[i]).GetType() == typeof(ItemCooking))
				{
					ItemCooking val28 = (ItemCooking)components[i];
					if (val28.wreckWhenCooked && val28.timesCookedLocal >= 1)
					{
						text4 += GetText("COOKED_BROKEN", effectColors["Curse"]);
					}
					else if (val28.wreckWhenCooked)
					{
						text4 += GetText("COOK_BROKEN", effectColors["Curse"]);
					}
					else if (val28.timesCookedLocal >= 12)
					{
						text4 += GetText("COOKED_MAX", effectColors["Curse"], val28.timesCookedLocal.ToString());
					}
					else if (val28.timesCookedLocal == 0)
					{
						text4 = text4 + "\n" + GetText("COOK", effectColors["Extra Stamina"]) + "</color>";
					}
					else if (val28.timesCookedLocal == 1)
					{
						text4 += GetText("COOKED", effectColors["Extra Stamina"], val28.timesCookedLocal.ToString(), effectColors["Hunger"]);
					}
					else if (val28.timesCookedLocal == 2)
					{
						text4 += GetText("COOKED", effectColors["Hunger"], val28.timesCookedLocal.ToString(), effectColors["Injury"]);
					}
					else if (val28.timesCookedLocal == 3)
					{
						text4 += GetText("COOKED", effectColors["Injury"], val28.timesCookedLocal.ToString(), effectColors["Poison"]);
					}
					else if (val28.timesCookedLocal >= 4)
					{
						text4 += GetText("COOKED", effectColors["Poison"], val28.timesCookedLocal.ToString(), "");
					}
				}
			}
			if (text.Length > 0 && flag)
			{
				((TMP_Text)itemInfoDisplayTextMesh).text = text + "\n" + ((TMP_Text)itemInfoDisplayTextMesh).text;
			}
			if (text5.Length > 0)
			{
				TextMeshProUGUI obj52 = itemInfoDisplayTextMesh;
				((TMP_Text)obj52).text = ((TMP_Text)obj52).text + "\n" + text5;
			}
			val10 = itemInfoDisplayTextMesh;
			((TMP_Text)val10).text = ((TMP_Text)val10).text + "\n" + text2 + text3 + text4;
			((TMP_Text)itemInfoDisplayTextMesh).text = ((TMP_Text)itemInfoDisplayTextMesh).text.Replace("\n\n\n", "\n\n");
		}

		private static string ProcessEffect(float amount, string effect)
		{
			string text = "";
			string text2 = string.Empty;
			string key = string.Empty;
			if (amount == 0f)
			{
				return text;
			}
			if (amount > 0f)
			{
				text2 = ((!effect.Equals("Extra Stamina")) ? effectColors["ItemInfoDisplayNegative"] : effectColors["ItemInfoDisplayPositive"]);
				key = "GAIN";
			}
			else if (amount < 0f)
			{
				text2 = ((!effect.Equals("Extra Stamina")) ? effectColors["ItemInfoDisplayPositive"] : effectColors["ItemInfoDisplayNegative"]);
				key = "REMOVE";
			}
			return text + GetText("ProcessEffect", text2, GetText(key), effectColors[effect], (Mathf.Abs(amount) * 100f).ToString("F1").Replace(".0", ""), GetText("Effect_" + effect.ToUpper()).ToUpper());
		}

		private static string ProcessEffectOverTime(float amountPerSecond, float rate, float time, string effect)
		{
			string text = "";
			string text2 = string.Empty;
			string key = string.Empty;
			if (amountPerSecond == 0f || time == 0f)
			{
				return text;
			}
			if (amountPerSecond > 0f)
			{
				text2 = ((!effect.Equals("Extra Stamina")) ? effectColors["ItemInfoDisplayNegative"] : effectColors["ItemInfoDisplayPositive"]);
				key = "GAIN";
			}
			else if (amountPerSecond < 0f)
			{
				text2 = ((!effect.Equals("Extra Stamina")) ? effectColors["ItemInfoDisplayPositive"] : effectColors["ItemInfoDisplayNegative"]);
				key = "REMOVE";
			}
			return text + GetText("ProcessEffectOverTime", text2, GetText(key), effectColors[effect], (Mathf.Abs(amountPerSecond) * time * (1f / rate) * 100f).ToString("F1").Replace(".0", ""), GetText("Effect_" + effect.ToUpper()).ToUpper(), time.ToString());
		}

		private static string ProcessAffliction(Affliction affliction)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Invalid comparison between Unknown and I4
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Invalid comparison between Unknown and I4
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Invalid comparison between Unknown and I4
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Expected O, but got Unknown
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Invalid comparison between Unknown and I4
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Expected O, but got Unknown
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Invalid comparison between Unknown and I4
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Expected O, but got Unknown
			//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a9: Invalid comparison between Unknown and I4
			//IL_039b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Expected O, but got Unknown
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cf: Invalid comparison between Unknown and I4
			//IL_04af: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b6: Expected O, but got Unknown
			//IL_06de: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e4: Invalid comparison between Unknown and I4
			//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dc: Expected O, but got Unknown
			//IL_0793: Unknown result type (might be due to invalid IL or missing references)
			//IL_079a: Invalid comparison between Unknown and I4
			//IL_079d: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a4: Expected O, but got Unknown
			string text = "";
			if ((int)affliction.GetAfflictionType() == 2)
			{
				Affliction_FasterBoi val = (Affliction_FasterBoi)affliction;
				text += GetText("FasterBoi", effectColors["ItemInfoDisplayPositive"], (((Affliction)val).totalTime + val.climbDelay).ToString("F1").Replace(".0", ""), effectColors["Extra Stamina"], Mathf.Round(val.moveSpeedMod * 100f).ToString("F1").Replace(".0", ""), ((Affliction)val).totalTime.ToString("F1").Replace(".0", ""), Mathf.Round(val.climbSpeedMod * 100f).ToString("F1").Replace(".0", ""), effectColors["ItemInfoDisplayNegative"], effectColors["Drowsy"], (val.drowsyOnEnd * 100f).ToString("F1").Replace(".0", ""));
			}
			else if ((int)affliction.GetAfflictionType() == 8)
			{
				Affliction_ClearAllStatus val2 = (Affliction_ClearAllStatus)affliction;
				text += (val2.excludeCurse ? GetText("ClearAllStatusExceptCurse", effectColors["ItemInfoDisplayPositive"], effectColors["Curse"]) : GetText("ClearAllStatusLocalized", effectColors["ItemInfoDisplayPositive"]));
			}
			else if ((int)affliction.GetAfflictionType() == 10)
			{
				Affliction_AddBonusStamina val3 = (Affliction_AddBonusStamina)affliction;
				text += GetText("AddBonusStamina", effectColors["ItemInfoDisplayPositive"], effectColors["Extra Stamina"], (val3.staminaAmount * 100f).ToString("F1").Replace(".0", ""));
			}
			else if ((int)affliction.GetAfflictionType() == 1)
			{
				Affliction_InfiniteStamina val4 = (Affliction_InfiniteStamina)affliction;
				text += ((val4.climbDelay > 0f) ? GetText("InfiniteStaminaSplit", effectColors["ItemInfoDisplayPositive"], (((Affliction)val4).totalTime + val4.climbDelay).ToString("F1").Replace(".0", ""), effectColors["Extra Stamina"], ((Affliction)val4).totalTime.ToString("F1").Replace(".0", "")) : GetText("InfiniteStamina", effectColors["ItemInfoDisplayPositive"], ((Affliction)val4).totalTime.ToString("F1").Replace(".0", ""), effectColors["Extra Stamina"]));
				if (val4.drowsyAffliction != null)
				{
					text = text + GetText("Afterwards") + ProcessAffliction(val4.drowsyAffliction);
				}
			}
			else if ((int)affliction.GetAfflictionType() == 7)
			{
				Affliction_AdjustStatus val5 = (Affliction_AdjustStatus)affliction;
				string key = ((val5.statusAmount > 0f) ? "GAIN" : "REMOVE");
				string text2 = ((val5.statusAmount > 0f) ? effectColors["ItemInfoDisplayNegative"] : effectColors["ItemInfoDisplayPositive"]);
				text += GetText("ProcessEffect", text2, GetText(key), effectColors[((object)Unsafe.As<STATUSTYPE, STATUSTYPE>(ref val5.statusType)/*cast due to .constrained prefix*/).ToString()], (Mathf.Abs(val5.statusAmount) * 100f).ToString("F1").Replace(".0", ""), GetText("Effect_" + ((object)Unsafe.As<STATUSTYPE, STATUSTYPE>(ref val5.statusType)/*cast due to .constrained prefix*/).ToString().ToUpper()).ToUpper());
			}
			else if ((int)affliction.GetAfflictionType() == 11)
			{
				Affliction_AdjustDrowsyOverTime val6 = (Affliction_AdjustDrowsyOverTime)affliction;
				string key2 = ((val6.statusPerSecond > 0f) ? "GAIN" : "REMOVE");
				string text3 = ((val6.statusPerSecond > 0f) ? effectColors["ItemInfoDisplayNegative"] : effectColors["ItemInfoDisplayPositive"]);
				text += GetText("StatusOverTime", text3, GetText(key2), effectColors["Drowsy"], (Mathf.Round(Mathf.Abs(val6.statusPerSecond) * ((Affliction)val6).totalTime * 100f * 0.4f) / 0.4f).ToString("F1").Replace(".0", ""), GetText("Effect_DROWSY").ToUpper(), ((Affliction)val6).totalTime.ToString("F1").Replace(".0", ""));
			}
			else if ((int)affliction.GetAfflictionType() == 5)
			{
				Affliction_AdjustColdOverTime val7 = (Affliction_AdjustColdOverTime)affliction;
				string key3 = ((val7.statusPerSecond > 0f) ? "GAIN" : "REMOVE");
				string text4 = ((val7.statusPerSecond > 0f) ? effectColors["ItemInfoDisplayNegative"] : effectColors["ItemInfoDisplayPositive"]);
				text += GetText("StatusOverTime", text4, GetText(key3), effectColors["Cold"], (Mathf.Abs(val7.statusPerSecond) * ((Affliction)val7).totalTime * 100f).ToString("F1").Replace(".0", ""), GetText("Effect_COLD").ToUpper(), ((Affliction)val7).totalTime.ToString("F1").Replace(".0", ""));
			}
			else if ((int)affliction.GetAfflictionType() == 6)
			{
				text += GetText("Chaos", effectColors["ItemInfoDisplayPositive"], effectColors["Hunger"], effectColors["Extra Stamina"], effectColors["Injury"], effectColors["Poison"], effectColors["Cold"], effectColors["Hot"], effectColors["Drowsy"]);
			}
			else if ((int)affliction.GetAfflictionType() == 13)
			{
				Affliction_Sunscreen val8 = (Affliction_Sunscreen)affliction;
				text += GetText("ProcessAffliction_Sunscreen", effectColors["Heat"], ((Affliction)val8).totalTime.ToString("F1").Replace(".0", ""));
			}
			return text;
		}

		private static void AddDisplayObject()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("GAME/GUIManager");
			guiManager = val.GetComponent<GUIManager>();
			TMP_FontAsset font = ((TMP_Text)guiManager.heroDayText).font;
			GameObject gameObject = ((Component)val.transform.Find("Canvas_HUD/Prompts/ItemPromptLayout")).gameObject;
			GameObject val2 = new GameObject("ItemInfoDisplay");
			val2.transform.SetParent(gameObject.transform);
			itemInfoDisplayTextMesh = val2.AddComponent<TextMeshProUGUI>();
			RectTransform component = val2.GetComponent<RectTransform>();
			component.sizeDelta = new Vector2(configSizeDeltaX.Value, 0f);
			((TMP_Text)itemInfoDisplayTextMesh).font = font;
			((TMP_Text)itemInfoDisplayTextMesh).fontSize = configFontSize.Value;
			((TMP_Text)itemInfoDisplayTextMesh).alignment = (TextAlignmentOptions)1025;
			((TMP_Text)itemInfoDisplayTextMesh).lineSpacing = configLineSpacing.Value;
			((TMP_Text)itemInfoDisplayTextMesh).text = "";
			((TMP_Text)itemInfoDisplayTextMesh).outlineWidth = configOutlineWidth.Value;
			LoadLocalizedText();
		}

		private static string GetText(string key, params string[] args)
		{
			return string.Format(LocalizedText.GetText(("Mod_" + Name + "_" + key).ToUpper(), true), args);
		}

		private static void LoadLocalizedText()
		{
			Dictionary<string, List<string>> dictionary = JsonConvert.DeserializeObject<Dictionary<string, List<string>>>(Resources.Localized_Text);
			if (dictionary != null)
			{
				foreach (KeyValuePair<string, List<string>> item in dictionary)
				{
					List<string> value = item.Value;
					string firstValue = value[0];
					value = value.Select((string x) => (!string.IsNullOrEmpty(x)) ? x : firstValue).ToList();
					LocalizedText.MAIN_TABLE.Add(("Mod_" + Name + "_" + item.Key).ToUpper(), value);
				}
				return;
			}
			Log.LogError((object)"LoadLocalizedText Fail");
		}

		private static void InitEffectColors(Dictionary<string, string> dict)
		{
			dict.Add("Hunger", "<#FFBD16>");
			dict.Add("Extra Stamina", "<#BFEC1B>");
			dict.Add("Injury", "<#FF5300>");
			dict.Add("Crab", "<#E13542>");
			dict.Add("Poison", "<#A139FF>");
			dict.Add("Cold", "<#00BCFF>");
			dict.Add("Heat", "<#C80918>");
			dict.Add("Hot", "<#C80918>");
			dict.Add("Sleepy", "<#FF5CA4>");
			dict.Add("Drowsy", "<#FF5CA4>");
			dict.Add("Curse", "<#1B0043>");
			dict.Add("Weight", "<#A65A1C>");
			dict.Add("Thorns", "<#768E00>");
			dict.Add("Shield", "<#D48E00>");
			dict.Add("ItemInfoDisplayPositive", "<#DDFFDD>");
			dict.Add("ItemInfoDisplayNegative", "<#FFCCCC>");
		}
	}
}
namespace ItemInfoDisplay.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					ResourceManager resourceManager = new ResourceManager("ItemInfoDisplay.Properties.Resources", typeof(Resources).Assembly);
					resourceMan = resourceManager;
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal static string Localized_Text => ResourceManager.GetString("Localized_Text", resourceCulture);

		internal Resources()
		{
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}