|
|
|
|
@@ -1,7 +1,6 @@
|
|
|
|
|
using BepInEx;
|
|
|
|
|
using BepInEx.Configuration;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using ServerSync;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
@@ -10,14 +9,7 @@ public class MxValheimMod : BaseUnityPlugin
|
|
|
|
|
{
|
|
|
|
|
private const string ModGUID = "ovh.mxdev.mxvalheim";
|
|
|
|
|
private const string ModName = "MxValheim";
|
|
|
|
|
private const string ModVersion = "1.3.0";
|
|
|
|
|
|
|
|
|
|
private static readonly ConfigSync configSync = new ConfigSync(ModGUID)
|
|
|
|
|
{
|
|
|
|
|
DisplayName = ModName,
|
|
|
|
|
CurrentVersion = ModVersion,
|
|
|
|
|
MinimumRequiredVersion = ModVersion
|
|
|
|
|
};
|
|
|
|
|
private const string ModVersion = "1.2.1";
|
|
|
|
|
|
|
|
|
|
public static ConfigEntry<bool> Config_Locked;
|
|
|
|
|
public static ConfigEntry<int> Config_OreMultiplier;
|
|
|
|
|
@@ -28,28 +20,13 @@ public class MxValheimMod : BaseUnityPlugin
|
|
|
|
|
|
|
|
|
|
void Awake()
|
|
|
|
|
{
|
|
|
|
|
Config_Locked = BindSyncConfig("General", "Lock Configuration", true, "If obsession is on, only admins can change settings.");
|
|
|
|
|
configSync.AddLockingConfigEntry(Config_Locked);
|
|
|
|
|
Config_OreMultiplier = BindSyncConfig("General","OreMultiplier",3,"How many items should drop for every 1 ore/scrap found.");
|
|
|
|
|
Config_rangeMultiplier = BindSyncConfig("General", "CraftingRangeMultiplier",2.0f,"Multiplier for the workbench build/crafting range. Default is 2x.");
|
|
|
|
|
Config_bowDrawSpeedBonusPerLevel = BindSyncConfig("General", "BowDrawSpeedBonusPercentPerLevel", 1.0f, "Shorten the bow draw speed by this percent for every bow upgrade level.");
|
|
|
|
|
Config_rainDamage = BindSyncConfig("General", "RainDamage", true, "Set to true to stop rain damage, false to return to vanilla behavior.");
|
|
|
|
|
Config_boatSpeed = BindSyncConfig("General", "BoatSpeedMultiplier", 2.0f, "Your boat/raft will move without wind at a speed multiplied by this value.");
|
|
|
|
|
Config_OreMultiplier = Config.Bind("General","OreMultiplier",3,"How many items should drop for every 1 ore/scrap found.");
|
|
|
|
|
Config_rangeMultiplier = Config.Bind("General", "CraftingRangeMultiplier",2.0f,"Multiplier for the workbench build/crafting range. Default is 2x.");
|
|
|
|
|
Config_bowDrawSpeedBonusPerLevel = Config.Bind("General", "BowDrawSpeedBonusPercentPerLevel", 1.0f, "Shorten the bow draw speed by this percent for every bow upgrade level.");
|
|
|
|
|
Config_rainDamage = Config.Bind("General", "RainDamage", true, "Set to true to stop rain damage, false to return to vanilla behavior.");
|
|
|
|
|
Config_boatSpeed = Config.Bind("General", "BoatSpeedMultiplier", 2.0f, "Your boat/raft will move without wind at a speed multiplied by this value.");
|
|
|
|
|
|
|
|
|
|
Harmony harmony = new Harmony(ModGUID);
|
|
|
|
|
harmony.PatchAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Helper method to bind a config and register it for server syncing.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private ConfigEntry<T> BindSyncConfig<T>(string group, string name, T value, string description, bool synchronizedSetting = true)
|
|
|
|
|
{
|
|
|
|
|
ConfigEntry<T> configEntry = this.Config.Bind(group, name, value, description);
|
|
|
|
|
|
|
|
|
|
SyncedConfigEntry<T> syncedConfigEntry = configSync.AddConfigEntry(configEntry);
|
|
|
|
|
syncedConfigEntry.SynchronizedConfig = synchronizedSetting;
|
|
|
|
|
|
|
|
|
|
return configEntry;
|
|
|
|
|
}
|
|
|
|
|
}
|