using System;
using System.Collections;
using System.Collections.Generic;
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 REPOLib;
using REPOLib.Modules;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Autodesk.Fbx")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("FbxBuildTestAssets")]
[assembly: IgnoresAccessChecksTo("Klattersynth")]
[assembly: IgnoresAccessChecksTo("Photon3Unity3D")]
[assembly: IgnoresAccessChecksTo("PhotonChat")]
[assembly: IgnoresAccessChecksTo("PhotonRealtime")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.API")]
[assembly: IgnoresAccessChecksTo("PhotonVoice")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime.Public")]
[assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization")]
[assembly: IgnoresAccessChecksTo("Sirenix.Utilities")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Formats.Fbx.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Postprocessing.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Antlr3.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Core")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Flow")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.State")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("websocket-sharp")]
[assembly: AssemblyCompany("Ronneberg")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ShopItemDescriptions")]
[assembly: AssemblyTitle("ShopItemDescriptions")]
[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.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]
[Microsoft.CodeAnalysis.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]
[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 ShopItemDescriptions
{
[HarmonyPatch(typeof(HUD))]
public class HudPatcher : MonoBehaviour
{
[HarmonyPostfix]
[HarmonyPatch("Awake")]
public static void Awake_Postfix(HUD __instance)
{
ShopItemDescriptions.Logger.LogInfo((object)"HUD Awake Postfix adding ShopItemDescriptionsUI");
ShopItemDescriptions.Instance.LoadShopHud();
}
}
[BepInPlugin("Ronneberg.ShopItemDescriptions", "ShopItemDescriptions", "1.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class ShopItemDescriptions : BaseUnityPlugin
{
public GameObject? itemDescriptionUIPrefab;
internal static ShopItemDescriptions Instance { get; private set; }
internal static ManualLogSource Logger => Instance._logger;
private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger;
internal Harmony? Harmony { get; set; }
private void Awake()
{
Instance = this;
((Component)this).gameObject.transform.parent = null;
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
Patch();
Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!");
}
internal void Patch()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
//IL_0026: Expected O, but got Unknown
if (Harmony == null)
{
Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
Harmony val2 = val;
Harmony = val;
}
Harmony.PatchAll();
string path = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location) ?? string.Empty;
string text = Path.Combine(path, "shopitemdescriptions");
BundleLoader.LoadBundle(text, (Action<AssetBundle>)delegate(AssetBundle assetBundle)
{
itemDescriptionUIPrefab = assetBundle.LoadAsset<GameObject>("ItemDescription");
}, false);
}
public void LoadShopHud()
{
if (!((Object)(object)itemDescriptionUIPrefab == (Object)null))
{
GameObject val = Object.Instantiate<GameObject>(itemDescriptionUIPrefab);
val.AddComponent<ShopItemDescriptionsUI>();
}
}
internal void Unpatch()
{
Harmony? harmony = Harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
private void Update()
{
}
}
public class ShopItemDescriptionsUI : MonoBehaviour
{
public TextMeshProUGUI? Text;
public Image? scanLines;
public static ShopItemDescriptionsUI? Instance { get; private set; }
private void Awake()
{
Instance = this;
Text = ((Component)this).GetComponentInChildren<TextMeshProUGUI>();
scanLines = ((Component)this).GetComponent<Image>();
UpdateItemDescriptionsForVanillaItems();
((MonoBehaviour)this).StartCoroutine(AttachToHud());
Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
((Behaviour)Text).enabled = false;
((Behaviour)scanLines).enabled = false;
}
public void Update()
{
if (SemiFunc.RunIsShop() && !((Object)(object)Text == (Object)null) && !((Object)(object)scanLines == (Object)null))
{
if (PhysGrabber.instance.grabbed)
{
ItemAttributes currentlyLookingAtItemAttributes = PhysGrabber.instance.currentlyLookingAtItemAttributes;
ShowItemDescription(currentlyLookingAtItemAttributes);
}
else
{
((Behaviour)scanLines).enabled = false;
((Behaviour)Text).enabled = false;
((TMP_Text)Text).text = string.Empty;
}
}
}
private IEnumerator AttachToHud()
{
GameObject hud = null;
while ((Object)(object)hud == (Object)null)
{
yield return (object)new WaitForSeconds(1f);
hud = GameObject.Find("Game Hud");
}
((Component)this).transform.SetParent(hud.transform);
((Component)this).GetComponent<RectTransform>().anchoredPosition = new Vector2(-184f, 66.4f);
((Component)this).GetComponent<RectTransform>().sizeDelta = new Vector2(173f, 136.7f);
}
public void ShowItemDescription(ItemAttributes itemAttributes)
{
if (!((Object)(object)itemAttributes == (Object)null) && !(itemAttributes.item.description == "") && !((Object)(object)Text == (Object)null) && !((Object)(object)scanLines == (Object)null))
{
((TMP_Text)Text).text = itemAttributes.item.description;
((Behaviour)scanLines).enabled = true;
((Behaviour)Text).enabled = true;
}
}
public void UpdateItemDescriptionsForVanillaItems()
{
IReadOnlyList<Item> allItems = Items.AllItems;
foreach (Item item in allItems)
{
string itemAssetName = item.itemAssetName;
GameObject prefab = item.prefab;
switch (itemAssetName)
{
case "Item Grenade Explosive":
item.description = "A grenade that explodes after 3 Seconds.";
break;
case "Item Cart Medium":
item.description = "An extra C.A.R.T. to carry items on levels, will NOT despawn if left on location when extracting, and will return to the truck every time a new level is started.";
break;
case "Item Cart Small":
item.description = "A smaller, carryable version of the C.A.R.T. that is storable within the player's hotbar, and taken out when needed. Items stored in the Pocket C.A.R.T. will drop onto the ground if the Pocket C.A.R.T. is picked up while they're inside it.";
break;
case "Item Drone Battery":
item.description = "Can be attached to objects that need energy (melee weapons, tools, guns, other drones) to recharge them without needed to return to the truck. Using the Recharge Drone to charge other items will drain the battery of the Recharge Drone.";
break;
case "Item Drone Feather":
item.description = "Can be attached to objects and players, which reduces the weight of the object to a minimum";
break;
case "Item Drone Indestructible":
item.description = "Can be attached to valuables, causing them to be indestructible. If the attached item is too far away from the drone, it'll automatically teleport back within distance.";
break;
case "Item Drone Torque":
item.description = "Can be attached to objects and players, causing the host to begin rolling. Items like the inflatable hammer and rubber duck can trigger their collision effects.\r\nPlayers can stand up via jumping to overcome the rolling effect, and enter the tumble state again to continue rolling. If attached to an object, the object will roll to you. If attached to an enemy, the enemy will roll away from you, draining the battery of the drone significantly.";
break;
case "Item Drone Zero Gravity":
item.description = "Can be attached to objects and players, allowing you to remove the gravity of the object";
break;
case "Item Extraction Tracker":
item.description = "Points towards inactive extraction zones, displaying distance; inactive if all zones are active or completed.\u200b";
break;
case "Item Grenade Duct Taped":
item.description = "A grenade that explodes into Smaller Grenades after 3 Seconds.";
break;
case "Item Grenade Holy":
item.description = "A grenade that leaves a lingering field of holiness for 20 seconds after exploding.";
break;
case "Item Grenade Human":
item.description = "A grenade that explodes after 3 Seconds.";
break;
case "Item Grenade Shockwave":
item.description = "A grenade that explodes after 3 Seconds. Deals no damage, but pushes objects and entities away with a strong force.";
break;
case "Item Grenade Stun":
item.description = "A grenade that explodes after 3 Seconds. Stuns all entities hit.";
break;
case "Item Gun Handgun":
item.description = "A handgun that fires bullets.";
break;
case "Item Gun Shotgun":
item.description = "A shotgun that fires bullets.";
break;
case "Item Gun Tranq":
item.description = "A tranq gun that fires tranq darts. Stuns for a set amount of time.";
break;
case "Item Health Pack Large":
item.description = "A large health pack that heals you for 100 of your health.";
break;
case "Item Health Pack Medium":
item.description = "A medium health pack that heals you for 50 of your health.";
break;
case "Item Health Pack Small":
item.description = "A small health pack that heals you for 25 of your health.";
break;
case "Item Melee Baseball Bat":
item.description = "A baseball bat that can be used to hit enemies. Has high knockback";
break;
case "Item Melee Frying Pan":
item.description = "A frying pan that can be used to hit enemies.";
break;
case "Item Melee Inflatable Hammer":
item.description = "An inflatable hammer that can be used to hit enemies. Deals low damage but has a chance to create a powerful explosion.";
break;
case "Item Melee Sledge Hammer":
item.description = "A sledge hammer that can be used to hit enemies. Deals high damage but is hard to swing.";
break;
case "Item Melee Sword":
item.description = "A sword that can be used to hit enemies.";
break;
case "Item Mine Explosive":
item.description = "An explosive mine that can be placed and armed. Explodes if triggered.";
break;
case "Item Mine Shockwave":
item.description = "A shockwave mine that can be placed and armed. Explodes if triggered, pushing objects and entities away with a strong force.";
break;
case "Item Mine Stun":
item.description = "A stun mine that can be placed and armed. When triggered, stuns any entity that comes into contact with it for a certain duration.";
break;
case "Item Orb Zero Gravity":
item.description = "When activated, all objects and players (excluding this zero gravity orb) in the radius will have their gravity removed while inside the radius.";
break;
case "Item Power Crystal":
item.description = "Recharges eligible items bought from the Service Station. Automaticaly placed into the chargingstation on the Ship when bought.";
break;
case "Item Rubber Duck":
item.description = "Can be thrown by letting go while it's being moved quickly. Once thrown, it will bounce around wildly and damage anything it hits, also has a chance to cause an explosion on impact, dealing high damage.";
break;
case "Item Upgrade Map Player Count":
item.description = "Shows the number of players alive on your map";
break;
case "Item Upgrade Player Energy":
item.description = "Increase stamina by 10 points";
break;
case "Item Upgrade Player Extra Jump":
item.description = "Grants an extra jump";
break;
case "Item Upgrade Player Grab Range":
item.description = "Increase pick-up range and scrollable range";
break;
case "Item Upgrade Player Grab Strength":
item.description = "Increase strength to pick up larger, heavier items.";
break;
case "Item Upgrade Player Health":
item.description = "Increase health by 20 points.";
break;
case "Item Upgrade Player Sprint Speed":
item.description = "Increase sprint speed and stamina drain.";
break;
case "Item Upgrade Player Tumble Launch":
item.description = "Increases tumble launch distance.";
break;
case "Item Valuable Tracker":
item.description = "When active, the valuable tracker will display a number on the screen being the distance between the player and a valuable object in excess of roughly $1500, along with a beeping sound. As the player gets farther away from a valuable, the number onscreen will increase, and as the player nears a valuable object, the number will decrease until it reads FOUND on the screen.";
break;
}
}
}
}
}