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.Configuration; using BepInEx.Logging; using HarmonyLib; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [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("ValheimCreate")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.2.15.0")] [assembly: AssemblyInformationalVersion("0.2.15+e8576d0c75f18f1a7da71fbbd0cd61e148f5fbb5")] [assembly: AssemblyProduct("ValheimCreate")] [assembly: AssemblyTitle("ValheimCreate")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.2.15.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 ValheimCreate { internal static class FreePiecesConfig { internal sealed class ExtraPiece { internal string PrefabName { get; } internal string DisplayName { get; } internal ExtraPiece(string prefabName, string displayName) { PrefabName = prefabName; DisplayName = displayName; } } internal static readonly IReadOnlyList All = new ExtraPiece[2] { new ExtraPiece("piece_groundtorch_wood", "Standing Wood Torch"), new ExtraPiece("stake_wall", "Stake Wall") }; internal static readonly Dictionary> Entries = new Dictionary>(); internal static void Bind(ConfigFile config) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown foreach (ExtraPiece item in All) { Entries[item.PrefabName] = config.Bind("Extra Free Pieces", item.DisplayName, false, new ConfigDescription("Place and remove " + item.DisplayName + " for free.", (AcceptableValueBase)null, Array.Empty())); } } internal static bool IsEnabled(string prefabName) { if (Entries.TryGetValue(prefabName, out ConfigEntry value)) { return value.Value; } return false; } } internal class FreePiecesUI : MonoBehaviour { private GameObject? _panel; private GameObject? _openButton; private bool _panelVisible; private void Start() { GUIManager.OnCustomGUIAvailable += CreateUI; } private void OnDestroy() { GUIManager.OnCustomGUIAvailable -= CreateUI; } private void Update() { if ((Object)(object)_openButton == (Object)null) { return; } bool flag = (Object)(object)Player.m_localPlayer != (Object)null && ((Character)Player.m_localPlayer).InPlaceMode() && (Object)(object)Hud.instance != (Object)null && (Object)(object)Hud.instance.m_pieceSelectionWindow != (Object)null && Hud.instance.m_pieceSelectionWindow.activeSelf; if (_openButton.activeSelf != flag) { _openButton.SetActive(flag); if (!flag) { SetPanelVisible(visible: false); } } } private void CreateUI() { CreateOpenButton(); CreateConfigPanel(); } private void CreateOpenButton() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown _openButton = GUIManager.Instance.CreateButton("Free Build Piece Selection", GUIManager.CustomGUIFront.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -290f), 130f, 34f); _openButton.SetActive(false); ((UnityEvent)_openButton.GetComponent