using System; using System.Collections.Generic; 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.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Jotunn.Managers; using Microsoft.CodeAnalysis; using PortalTweaks.Configuration; using PortalTweaks.Data; using PortalTweaks.Energy; using PortalTweaks.Patches; using PortalTweaks.StatusEffects; using PortalTweaks.UI; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [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("XpandedPortal Contributors")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("XpandedPortal")] [assembly: AssemblyTitle("XpandedPortal")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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 PortalTweaks { [BepInPlugin("com.user.xpandedportal", "XpandedPortal", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class PortalTweaksPlugin : BaseUnityPlugin { public const string ModGuid = "com.user.xpandedportal"; public const string ModName = "XpandedPortal"; public const string ModVersion = "1.0.0"; internal static ManualLogSource Log; private Harmony _harmony; private void Awake() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"XpandedPortal v1.0.0 initializing..."); ModConfig.Init(((BaseUnityPlugin)this).Config); _harmony = new Harmony("com.user.xpandedportal"); _harmony.PatchAll(); Log.LogInfo((object)"XpandedPortal v1.0.0 loaded successfully."); if (Chainloader.PluginInfos.ContainsKey("com.jotunn.jotunn")) { HookJotunnSync(); } } [MethodImpl(MethodImplOptions.NoInlining)] private void HookJotunnSync() { SynchronizationManager.OnConfigurationSynchronized += delegate { Log.LogInfo((object)"Server configuration synchronized successfully."); }; } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } } namespace PortalTweaks.UI { public class PortalConfigPanel : MonoBehaviour { private GameObject? _rootPanel; private RectTransform? _rootRect; private TeleportWorld? _currentPortal; private Text? _titleText; private Text? _tagLabel; private InputField? _tagInput; private Text? _passLabel; private InputField? _passwordInput; private Text? _targetLabel; private Dropdown? _targetDropdown; private Text? _outPassLabel; private InputField? _outboundPasswordInput; private Text? _distanceText; private Text? _energyText; private Text? _weightText; private Text? _statusText; private float _uiUpdateTimer; private Button? _saveButton; private Button? _cancelButton; private List _availablePortals = new List(); public static PortalConfigPanel? Instance { get; private set; } public static void Initialize() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (GUIManager.Instance != null && !((Object)(object)GUIManager.CustomGUIFront == (Object)null) && !((Object)(object)Instance != (Object)null)) { GameObject val = new GameObject("PortalTweaks_UIHandler"); val.transform.SetParent(GUIManager.CustomGUIFront.transform, false); Instance = val.AddComponent(); } } private void Awake() { Instance = this; BuildUI(); } private void Update() { if (!((Object)(object)_rootPanel != (Object)null) || !_rootPanel.activeSelf) { return; } if (Input.GetKeyDown((KeyCode)27)) { Hide(); return; } _uiUpdateTimer += Time.deltaTime; if (_uiUpdateTimer >= 0.25f) { _uiUpdateTimer = 0f; UpdateStatus(); } } private void BuildUI() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Expected O, but got Unknown //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Expected O, but got Unknown if (GUIManager.Instance != null && !((Object)(object)GUIManager.CustomGUIFront == (Object)null)) { _rootPanel = GUIManager.Instance.CreateWoodpanel(((Component)this).transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), Vector2.zero, 580f, 360f, true); ((Object)_rootPanel).name = "PortalTweaks_ConfigPanel"; _rootRect = _rootPanel.GetComponent(); GameObject val = GUIManager.Instance.CreateText("PORTAL CONFIGURATION", _rootPanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -25f), GUIManager.Instance.AveriaSerifBold, 19, GUIManager.Instance.ValheimOrange, true, Color.black, 400f, 28f, false); _titleText = val.GetComponent(); _titleText.alignment = (TextAnchor)4; _tagLabel = CreateTextElement("Portal Tag", new Vector2(-140f, -55f), 250f); GameObject val2 = GUIManager.Instance.CreateInputField(_rootPanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(-140f, -85f), (ContentType)0, "Enter portal tag...", 15, 250f, 32f); _tagInput = val2.GetComponent(); _passLabel = CreateTextElement("Portal Password", new Vector2(140f, -55f), 250f); GameObject val3 = GUIManager.Instance.CreateInputField(_rootPanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(140f, -85f), (ContentType)0, "None (Unprotected)", 15, 250f, 32f); _passwordInput = val3.GetComponent(); _targetLabel = CreateTextElement("Outbound Destination", new Vector2(-140f, -125f), 250f); GameObject val4 = GUIManager.Instance.CreateDropDown(_rootPanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(-140f, -155f), 14, 250f, 32f); _targetDropdown = val4.GetComponent(); ((UnityEvent)(object)_targetDropdown.onValueChanged).AddListener((UnityAction)delegate { UpdateStatus(); }); _outPassLabel = CreateTextElement("Destination Password", new Vector2(140f, -125f), 250f); GameObject val5 = GUIManager.Instance.CreateInputField(_rootPanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(140f, -155f), (ContentType)0, "Password for target...", 15, 250f, 32f); _outboundPasswordInput = val5.GetComponent(); ((UnityEvent)(object)_outboundPasswordInput.onValueChanged).AddListener((UnityAction)delegate { UpdateStatus(); }); GameObject val6 = GUIManager.Instance.CreateText("", _rootPanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -198f), GUIManager.Instance.AveriaSerif, 14, Color.white, true, Color.black, 520f, 22f, false); _distanceText = val6.GetComponent(); _distanceText.alignment = (TextAnchor)4; GameObject val7 = GUIManager.Instance.CreateText("", _rootPanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -220f), GUIManager.Instance.AveriaSerif, 14, Color.white, true, Color.black, 520f, 22f, false); _energyText = val7.GetComponent(); _energyText.alignment = (TextAnchor)4; GameObject val8 = GUIManager.Instance.CreateText("", _rootPanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -220f), GUIManager.Instance.AveriaSerif, 14, Color.white, true, Color.black, 520f, 22f, false); _weightText = val8.GetComponent(); _weightText.alignment = (TextAnchor)4; GameObject val9 = GUIManager.Instance.CreateText("", _rootPanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -244f), GUIManager.Instance.AveriaSerif, 14, Color.yellow, true, Color.black, 520f, 22f, false); _statusText = val9.GetComponent(); _statusText.alignment = (TextAnchor)4; GameObject val10 = GUIManager.Instance.CreateButton("Save & Connect", _rootPanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(-80f, -288f), 140f, 36f); _saveButton = val10.GetComponent