|
|
|
@@ -15,6 +15,7 @@ using System.Xml;
|
|
|
|
using TMPro;
|
|
|
|
using TMPro;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
using static MxValheim.Patch.Doors_Patch;
|
|
|
|
|
|
|
|
|
|
|
|
[BepInPlugin(ModGUID, ModName, ModVersion)]
|
|
|
|
[BepInPlugin(ModGUID, ModName, ModVersion)]
|
|
|
|
public class MxValheimMod : BaseUnityPlugin
|
|
|
|
public class MxValheimMod : BaseUnityPlugin
|
|
|
|
@@ -25,7 +26,7 @@ public class MxValheimMod : BaseUnityPlugin
|
|
|
|
|
|
|
|
|
|
|
|
private const string ModGUID = "ovh.mxdev.mxvalheim";
|
|
|
|
private const string ModGUID = "ovh.mxdev.mxvalheim";
|
|
|
|
private const string ModName = "MxValheim";
|
|
|
|
private const string ModName = "MxValheim";
|
|
|
|
public const string ModVersion = "1.5.7";
|
|
|
|
public const string ModVersion = "1.5.8";
|
|
|
|
|
|
|
|
|
|
|
|
public static ConfigEntry<bool> Config_Locked;
|
|
|
|
public static ConfigEntry<bool> Config_Locked;
|
|
|
|
public static ConfigEntry<int> Config_OreMultiplier;
|
|
|
|
public static ConfigEntry<int> Config_OreMultiplier;
|
|
|
|
@@ -40,6 +41,7 @@ public class MxValheimMod : BaseUnityPlugin
|
|
|
|
public static string internalConfigsPath = Path.Combine(modPath, "Configs");
|
|
|
|
public static string internalConfigsPath = Path.Combine(modPath, "Configs");
|
|
|
|
public static string WeightConfigPath => Path.Combine(internalConfigsPath, "items_weight.json");
|
|
|
|
public static string WeightConfigPath => Path.Combine(internalConfigsPath, "items_weight.json");
|
|
|
|
public static string AutoDoorConfigPath => Path.Combine(internalConfigsPath, "auto_doors.json");
|
|
|
|
public static string AutoDoorConfigPath => Path.Combine(internalConfigsPath, "auto_doors.json");
|
|
|
|
|
|
|
|
public static DoorRoot CachedConfig;
|
|
|
|
public static Dictionary<string, float> WeightSettings = new Dictionary<string, float>();
|
|
|
|
public static Dictionary<string, float> WeightSettings = new Dictionary<string, float>();
|
|
|
|
|
|
|
|
|
|
|
|
// Data structures
|
|
|
|
// Data structures
|
|
|
|
@@ -87,6 +89,7 @@ public class MxValheimMod : BaseUnityPlugin
|
|
|
|
|
|
|
|
|
|
|
|
LoadLocalization();
|
|
|
|
LoadLocalization();
|
|
|
|
LoadJsonConfig();
|
|
|
|
LoadJsonConfig();
|
|
|
|
|
|
|
|
LoadDoorConfig();
|
|
|
|
|
|
|
|
|
|
|
|
_doorTimer = MxValheimMod.Config_autoDoorClose.Value;
|
|
|
|
_doorTimer = MxValheimMod.Config_autoDoorClose.Value;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -305,6 +308,15 @@ public class MxValheimMod : BaseUnityPlugin
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void LoadDoorConfig()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (System.IO.File.Exists(AutoDoorConfigPath))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string json = System.IO.File.ReadAllText(AutoDoorConfigPath);
|
|
|
|
|
|
|
|
CachedConfig = JsonConvert.DeserializeObject<DoorRoot>(json);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal static void ShowKillMessage(string v)
|
|
|
|
internal static void ShowKillMessage(string v)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|