Compare commits
2 Commits
e8b579db54
...
4aaeed7abc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4aaeed7abc | ||
|
|
a50d7df8d5 |
@@ -1,7 +1,6 @@
|
|||||||
using BepInEx;
|
using BepInEx;
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using ServerSync;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@@ -10,14 +9,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";
|
||||||
private const string ModVersion = "1.3.0";
|
private const string ModVersion = "1.2.1";
|
||||||
|
|
||||||
private static readonly ConfigSync configSync = new ConfigSync(ModGUID)
|
|
||||||
{
|
|
||||||
DisplayName = ModName,
|
|
||||||
CurrentVersion = ModVersion,
|
|
||||||
MinimumRequiredVersion = ModVersion
|
|
||||||
};
|
|
||||||
|
|
||||||
public static ConfigEntry<bool> Config_Locked;
|
public static ConfigEntry<bool> Config_Locked;
|
||||||
public static ConfigEntry<int> Config_OreMultiplier;
|
public static ConfigEntry<int> Config_OreMultiplier;
|
||||||
@@ -28,28 +20,13 @@ public class MxValheimMod : BaseUnityPlugin
|
|||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
Config_Locked = BindSyncConfig("General", "Lock Configuration", true, "If obsession is on, only admins can change settings.");
|
Config_OreMultiplier = Config.Bind("General","OreMultiplier",3,"How many items should drop for every 1 ore/scrap found.");
|
||||||
configSync.AddLockingConfigEntry(Config_Locked);
|
Config_rangeMultiplier = Config.Bind("General", "CraftingRangeMultiplier",2.0f,"Multiplier for the workbench build/crafting range. Default is 2x.");
|
||||||
Config_OreMultiplier = BindSyncConfig("General","OreMultiplier",3,"How many items should drop for every 1 ore/scrap found.");
|
Config_bowDrawSpeedBonusPerLevel = Config.Bind("General", "BowDrawSpeedBonusPercentPerLevel", 1.0f, "Shorten the bow draw speed by this percent for every bow upgrade level.");
|
||||||
Config_rangeMultiplier = BindSyncConfig("General", "CraftingRangeMultiplier",2.0f,"Multiplier for the workbench build/crafting range. Default is 2x.");
|
Config_rainDamage = Config.Bind("General", "RainDamage", true, "Set to true to stop rain damage, false to return to vanilla behavior.");
|
||||||
Config_bowDrawSpeedBonusPerLevel = BindSyncConfig("General", "BowDrawSpeedBonusPercentPerLevel", 1.0f, "Shorten the bow draw speed by this percent for every bow upgrade level.");
|
Config_boatSpeed = Config.Bind("General", "BoatSpeedMultiplier", 2.0f, "Your boat/raft will move without wind at a speed multiplied by this value.");
|
||||||
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.");
|
|
||||||
|
|
||||||
Harmony harmony = new Harmony(ModGUID);
|
Harmony harmony = new Harmony(ModGUID);
|
||||||
harmony.PatchAll();
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
<RootNamespace>MxValheim</RootNamespace>
|
<RootNamespace>MxValheim</RootNamespace>
|
||||||
<AssemblyName>MxValheim</AssemblyName>
|
<AssemblyName>MxValheim</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||||
|
<LangVersion>12.0</LangVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -43,9 +44,6 @@
|
|||||||
<Reference Include="BepInEx">
|
<Reference Include="BepInEx">
|
||||||
<HintPath>E:\SteamLibrary\steamapps\common\Valheim\BepInEx\core\BepInEx.dll</HintPath>
|
<HintPath>E:\SteamLibrary\steamapps\common\Valheim\BepInEx\core\BepInEx.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="ServerSync">
|
|
||||||
<HintPath>C:\Users\blood\Downloads\ServerSync.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
@@ -73,5 +71,8 @@
|
|||||||
<Compile Include="Patch\WearNTear.cs" />
|
<Compile Include="Patch\WearNTear.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="ILRepack.targets" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user