using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using HarmonyLib; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using TradingStall; using UnityEngine; using UnityEngine.Events; 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: AssemblyTitle("TradingStall")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TradingStall")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] public static class TradingStallBuyUI { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__26_0; public static UnityAction <>9__31_0; public static UnityAction <>9__31_1; public static UnityAction <>9__31_2; public static UnityAction <>9__31_3; public static UnityAction <>9__37_0; internal void b__26_0() { _tipPanel.SetActive(false); RefreshDimOverlay(); } internal void b__31_0() { AdjustQty(-1); } internal void b__31_1(string _) { UpdateQtyTotal(); } internal void b__31_2() { AdjustQty(1); } internal void b__31_3() { _quantityPanel.SetActive(false); RefreshDimOverlay(); } internal void b__37_0() { _confirmPanel.SetActive(false); RefreshDimOverlay(); } } private static GameObject _panel; private static GameObject _titleText; private static GameObject _errorText; private static GameObject _tipPanel; private static GameObject _tipCustomInputGO; private static GameObject _tipErrorText; private static GameObject _confirmPanel; private static GameObject _confirmMessageText; private static GameObject _quantityPanel; private static GameObject _qtyItemNameText; private static GameObject _qtyInputGO; private static GameObject _qtyTotalText; private static GameObject _qtyErrorText; private static GameObject _dimOverlay; private static Action _confirmAction; private static TradingStallComponent _currentStall; private static Player _currentBuyer; private static string _qtyCurrentToken; private static int _qtyUnitPrice; private static int _qtyMaxAvailable; private static string _qtyDisplayName; private const float RowHeight = 68f; private static readonly Dictionary _messageClearRoutines = new Dictionary(); private const float MessageDisplaySeconds = 4f; public static void Show(TradingStallComponent stall, Player buyer) { if ((Object)(object)Player.m_localPlayer == (Object)null) { return; } _currentStall = stall; _currentBuyer = buyer; if (GUIManager.Instance == null) { Logger.LogError((object)"[TradingStall] GUIManager instance is null"); return; } if (!Object.op_Implicit((Object)(object)GUIManager.CustomGUIFront)) { Logger.LogError((object)"[TradingStall] GUIManager CustomGUIFront is null"); return; } if (!Object.op_Implicit((Object)(object)_panel)) { BuildPanel(); } if ((Object)(object)_titleText != (Object)null) { _titleText.GetComponent().text = stall.GetShopName(); } RefreshItems(); _panel.SetActive(true); GUIManager.BlockInput(true); } private static void Hide() { if (Object.op_Implicit((Object)(object)_panel)) { _panel.SetActive(false); } if (Object.op_Implicit((Object)(object)_tipPanel)) { _tipPanel.SetActive(false); } if (Object.op_Implicit((Object)(object)_confirmPanel)) { _confirmPanel.SetActive(false); } if (Object.op_Implicit((Object)(object)_quantityPanel)) { _quantityPanel.SetActive(false); } if (Object.op_Implicit((Object)(object)_dimOverlay)) { _dimOverlay.SetActive(false); } GUIManager.BlockInput(false); } public static void CloseIfOpen() { if ((Object)(object)_confirmPanel != (Object)null && _confirmPanel.activeSelf) { _confirmPanel.SetActive(false); RefreshDimOverlay(); } else if ((Object)(object)_tipPanel != (Object)null && _tipPanel.activeSelf) { _tipPanel.SetActive(false); RefreshDimOverlay(); } else if ((Object)(object)_quantityPanel != (Object)null && _quantityPanel.activeSelf) { _quantityPanel.SetActive(false); RefreshDimOverlay(); } else if ((Object)(object)_panel != (Object)null && _panel.activeSelf) { Hide(); } } private static void BuildPanel() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Expected O, but got Unknown //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Expected O, but got Unknown _panel = GUIManager.Instance.CreateWoodpanel(GUIManager.CustomGUIFront.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f), 520f, 520f, true); _panel.SetActive(false); _titleText = GUIManager.Instance.CreateText("Trading Stall", _panel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -40f), GUIManager.Instance.AveriaSerifBold, 28, GUIManager.Instance.ValheimOrange, true, Color.black, 460f, 40f, false); _titleText.GetComponent().alignment = (TextAnchor)4; GameObject val = GUIManager.Instance.CreateScrollView(_panel.transform, false, true, 8f, 20f, GUIManager.Instance.ValheimScrollbarHandleColorBlock, new Color(0.1568628f, 0.1019608f, 0.0627451f, 1f), 460f, 350f); ((RectTransform)val.transform).anchoredPosition = new Vector2(0f, 20f); ((Object)val).name = "ItemScrollView"; DisableContentLayoutGroup(val.transform.Find("Scroll View/Viewport/Content")); SetScrollSensitivity(val, 150f); _errorText = GUIManager.Instance.CreateText("", _panel.transform, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 70f), GUIManager.Instance.AveriaSerifBold, 16, Color.red, true, Color.black, 460f, 30f, false); GameObject val2 = CreateButtonNoSfx("Tip", _panel.transform, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(-80f, 30f), 140f, 40f); ((UnityEvent)val2.GetComponent