using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("VentureValheim.NoVegvisirHints")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("VentureValheim.NoVegvisirHints")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("C89FE73C-B004-4421-9C68-D8511708D7ED")] [assembly: AssemblyFileVersion("0.2.1")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.2.1.0")] [module: UnverifiableCode] 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; } } } namespace VentureValheim.NoVegvisirHints { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.orianaventure.mod.NoVegvisirHints", "NoVegvisirHints", "0.2.1")] public class NoVegvisirHintsPlugin : BaseUnityPlugin { private const string ModName = "NoVegvisirHints"; private const string ModVersion = "0.2.1"; private const string Author = "com.orianaventure.mod"; private const string ModGUID = "com.orianaventure.mod.NoVegvisirHints"; private static string ConfigFileName = "com.orianaventure.mod.NoVegvisirHints.cfg"; private static string ConfigFileFullPath; private readonly Harmony HarmonyInstance = new Harmony("com.orianaventure.mod.NoVegvisirHints"); public static readonly ManualLogSource NoVegvisirHintsLogger; public static ConfigEntry CE_SetLookDirection; private readonly ConfigurationManagerAttributes AdminConfig = new ConfigurationManagerAttributes { IsAdminOnly = true }; private readonly ConfigurationManagerAttributes ClientConfig = new ConfigurationManagerAttributes { IsAdminOnly = false }; private DateTime _lastReloadTime; private const long RELOAD_DELAY = 10000000L; public static bool GetSetLookDirection() { return CE_SetLookDirection.Value; } private void AddConfig(string key, string section, string description, bool synced, T value, ref ConfigEntry configEntry) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown string extendedDescription = GetExtendedDescription(description, synced); configEntry = ((BaseUnityPlugin)this).Config.Bind(section, key, value, new ConfigDescription(extendedDescription, (AcceptableValueBase)null, new object[1] { synced ? AdminConfig : ClientConfig })); } public string GetExtendedDescription(string description, bool synchronizedSetting) { return description + (synchronizedSetting ? " [Synced with Server]" : " [Not Synced with Server]"); } public void Awake() { AddConfig("SetLookDirection", "General", "True to turn the camera in the direction of the location when pins are blocked (boolean).", synced: true, value: true, ref CE_SetLookDirection); Assembly executingAssembly = Assembly.GetExecutingAssembly(); HarmonyInstance.PatchAll(executingAssembly); SetupWatcher(); } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } private void SetupWatcher() { _lastReloadTime = DateTime.Now; FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName); fileSystemWatcher.Changed += ReadConfigValues; fileSystemWatcher.Created += ReadConfigValues; fileSystemWatcher.Renamed += ReadConfigValues; fileSystemWatcher.IncludeSubdirectories = true; fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject; fileSystemWatcher.EnableRaisingEvents = true; } private void ReadConfigValues(object sender, FileSystemEventArgs e) { DateTime now = DateTime.Now; long num = now.Ticks - _lastReloadTime.Ticks; if (File.Exists(ConfigFileFullPath) && num >= 10000000) { try { NoVegvisirHintsLogger.LogInfo((object)"Attempting to reload configuration..."); ((BaseUnityPlugin)this).Config.Reload(); } catch { NoVegvisirHintsLogger.LogError((object)("There was an issue loading " + ConfigFileName)); return; } _lastReloadTime = now; } } static NoVegvisirHintsPlugin() { string configPath = Paths.ConfigPath; char directorySeparatorChar = Path.DirectorySeparatorChar; ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName; NoVegvisirHintsLogger = Logger.CreateLogSource("NoVegvisirHints"); CE_SetLookDirection = null; } } public class NoVegvisirHints { [HarmonyPatch(typeof(Vegvisir), "Interact")] public static class Patch_Vegvisir_Interact { private static void Prefix(Vegvisir __instance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (__instance.m_locations.Count > 1) { return; } foreach (VegvisrLocation location in __instance.m_locations) { location.m_pinType = (PinType)(-1); } } } [HarmonyPatch(typeof(Minimap), "DiscoverLocation")] public static class Patch_Minimap_DiscoverLocation { private static bool Prefix(PinType type, Vector3 pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) PinType val = (PinType)(-1); if (type == val) { NoVegvisirHintsPlugin.NoVegvisirHintsLogger.LogDebug((object)"Map pin blocked!"); if ((Object)(object)Player.m_localPlayer != (Object)null && NoVegvisirHintsPlugin.GetSetLookDirection()) { ((Character)Player.m_localPlayer).SetLookDir(pos - ((Component)Player.m_localPlayer).transform.position, 3.5f); } return false; } return true; } } } }