Skip to content

Commit ec75a1c

Browse files
committed
Update to 1.9.2 with compatibility with the latest update of the game (0.217.30)
1 parent 3994197 commit ec75a1c

File tree

10 files changed

+59
-354
lines changed

10 files changed

+59
-354
lines changed

ValheimTooler/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
3333
// en utilisant '*', comme indiqué ci-dessous :
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.9.1")]
36-
[assembly: AssemblyFileVersion("1.9.1")]
35+
[assembly: AssemblyVersion("1.9.2")]
36+
[assembly: AssemblyFileVersion("1.9.2")]

ValheimTooler/UI/SpriteManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static Texture2D TextureFromSprite(Sprite sprite, bool resize = true)
4242
newText.Apply();
4343

4444
if (resize && (newText.width > 200 || newText.height > 200))
45-
newText.Resize(60, 60);
45+
newText.Reinitialize(60, 60);
4646

4747
return newText;
4848
}

ValheimTooler/Utils/ConfigManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Diagnostics;
12
using System.IO;
23
using System.Reflection;
34
using UnityEngine;
@@ -46,7 +47,7 @@ public static class ConfigManager
4647

4748
static ConfigManager()
4849
{
49-
var valheimAssemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
50+
var valheimAssemblyFolder = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
5051

5152
var configPathFilePath = Path.Combine(valheimAssemblyFolder, "config_vt.path");
5253
var configPath = "";

ValheimTooler/ValheimTooler.csproj

Lines changed: 24 additions & 320 deletions
Large diffs are not rendered by default.

ValheimToolerLauncher/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
5252
// en utilisant '*', comme indiqué ci-dessous :
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.9.1")]
55-
[assembly: AssemblyFileVersion("1.9.1")]
54+
[assembly: AssemblyVersion("1.9.2")]
55+
[assembly: AssemblyFileVersion("1.9.2")]

ValheimToolerLauncher/ValheimToolerLauncher.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@
6565
<HintPath>..\packages\Autoupdater.NET.Official.1.6.4\lib\net45\AutoUpdater.NET.dll</HintPath>
6666
</Reference>
6767
<Reference Include="CustomMarshalers" />
68-
<Reference Include="HandyControl, Version=3.1.0.0, Culture=neutral, PublicKeyToken=45be8712787a1e5b, processorArchitecture=MSIL">
69-
<HintPath>..\packages\HandyControls.3.1.1\lib\net47\HandyControl.dll</HintPath>
68+
<Reference Include="HandyControl, Version=3.4.0.0, Culture=neutral, PublicKeyToken=45be8712787a1e5b, processorArchitecture=MSIL">
69+
<HintPath>..\packages\HandyControls.3.4.5\lib\net472\HandyControl.dll</HintPath>
7070
</Reference>
7171
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.4.0, Culture=neutral, PublicKeyToken=8985beaab7ea3f04, processorArchitecture=MSIL">
7272
<HintPath>..\packages\Microsoft-WindowsAPICodePack-Core.1.1.4\lib\net472\Microsoft.WindowsAPICodePack.dll</HintPath>
7373
</Reference>
7474
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.4.0, Culture=neutral, PublicKeyToken=8985beaab7ea3f04, processorArchitecture=MSIL">
7575
<HintPath>..\packages\Microsoft-WindowsAPICodePack-Shell.1.1.4\lib\net472\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
7676
</Reference>
77-
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
78-
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
77+
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
78+
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
7979
</Reference>
8080
<Reference Include="SharpMonoInjector">
8181
<HintPath>.\SharpMonoInjector.dll</HintPath>

ValheimToolerLauncher/ViewModels/MainWindowViewModel.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Threading.Tasks;
66
using ValheimToolerLauncher.Properties;
77
using ValheimToolerLauncher.Views;
8+
using System.Collections.Generic;
89

910
namespace ValheimToolerLauncher.ViewModels
1011
{
@@ -133,6 +134,20 @@ private async void ExecuteOnWindowLoadedCommand(object parameter)
133134
Settings.Default.updateSettings = false;
134135
Settings.Default.Save();
135136
_isUpgrade = true;
137+
138+
// Code purely for 1.9.2, time to remove unused files as the autoupdater will not do it
139+
DirectoryInfo managedDir = new DirectoryInfo("Managed");
140+
IEnumerable<FileInfo> managedFiles = managedDir.GetFiles("*.dll", SearchOption.TopDirectoryOnly);
141+
142+
var acceptList = new List<string>{ "0Harmony.dll", "Mono.Cecil.dll", "Mono.Cecil.Mdb.dll", "Mono.Cecil.Pdb.dll", "Mono.Cecil.Rocks.dll", "MonoMod.RuntimeDetour.dll", "MonoMod.Utils.dll", "SharpConfig.dll" };
143+
144+
foreach (FileInfo file in managedFiles)
145+
{
146+
if (!acceptList.Contains(file.Name))
147+
{
148+
file.Delete();
149+
}
150+
}
136151
}
137152

138153
_installer = new Installer();

ValheimToolerLauncher/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Autoupdater.NET.Official" version="1.6.4" targetFramework="net472" />
4-
<package id="HandyControls" version="3.1.1" targetFramework="net472" />
4+
<package id="HandyControls" version="3.4.5" targetFramework="net472" />
55
<package id="Microsoft-WindowsAPICodePack-Core" version="1.1.4" targetFramework="net472" />
66
<package id="Microsoft-WindowsAPICodePack-Shell" version="1.1.4" targetFramework="net472" />
7-
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
7+
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
88
</packages>

ValheimToolerMod/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
3333
// en utilisant '*', comme indiqué ci-dessous :
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.9.1.0")]
36-
[assembly: AssemblyFileVersion("1.9.1.0")]
35+
[assembly: AssemblyVersion("1.9.2.0")]
36+
[assembly: AssemblyFileVersion("1.9.2.0")]

ValheimToolerMod/ValheimToolerMod.cs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23
using System.IO;
34
using System.Linq;
45
using System.Reflection;
@@ -14,7 +15,7 @@ public class ValheimToolerMod : BaseUnityPlugin
1415
{
1516
const string PluginGUID = "com.github.Astropilot.ValheimTooler";
1617
const string PluginName = "ValheimTooler";
17-
const string PluginVersion = "1.9.1";
18+
const string PluginVersion = "1.9.2";
1819

1920
private Harmony _harmony;
2021

@@ -36,26 +37,10 @@ private void LoadPlugin()
3637
_harmony?.UnpatchSelf();
3738
_harmony = null;
3839

39-
string bepInExPluginsPath = Paths.PluginPath;
40-
var valheimToolerFiles = Directory.GetFiles(bepInExPluginsPath, "ValheimToolerMod.dll", SearchOption.AllDirectories).ToList();
41-
string configpathfilepath = null;
40+
var valheimAssemblyFolder = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
41+
var configPathFilePath = Path.Combine(valheimAssemblyFolder, "config_vt.path");
4242

43-
while (configpathfilepath == null && valheimToolerFiles.Count > 0)
44-
{
45-
string valheimToolerPath = Path.GetDirectoryName(valheimToolerFiles[0]);
46-
47-
valheimToolerFiles.RemoveAt(0);
48-
49-
if (File.Exists(Path.Combine(valheimToolerPath, "ValheimTooler.dll")))
50-
{
51-
configpathfilepath = Path.Combine(valheimToolerPath, "config_vt.path");
52-
}
53-
}
54-
55-
if (!string.IsNullOrEmpty(configpathfilepath))
56-
{
57-
File.WriteAllText(configpathfilepath, Paths.ConfigPath);
58-
}
43+
File.WriteAllText(configPathFilePath, Paths.ConfigPath);
5944

6045
CallLoaderInit();
6146
}

0 commit comments

Comments
 (0)