diff --git a/Classes/Game.cs b/Classes/Game.cs
index 8e28b0f..cdd407e 100644
--- a/Classes/Game.cs
+++ b/Classes/Game.cs
@@ -31,7 +31,7 @@ public static string SetGameDir(string game)
path = Steam.GetGameDir(Steam.BMCAppID);
break;
}
- if (path == "" || path == null)
+ if (!Guard.IsStringValid(path))
{
Log.Output("Failed to automatically find " + Settings.game.GameName);
MessageBox.Show("Failed to automatically find " + Settings.game.GameName + " . Please browse for the game's .exe file to set the game directory");
diff --git a/Classes/JetReader.cs b/Classes/JetReader.cs
index 04efa02..e8e52d8 100644
--- a/Classes/JetReader.cs
+++ b/Classes/JetReader.cs
@@ -87,11 +87,12 @@ public void DoWork()
{
new Thread(() =>
{
+ Thread t1;
Thread t2 = new Thread(MakeMod);
t2.Start();
if (MainWindow.resetGameFiles)
{
- Thread t1 = new Thread(Game.ResetGameFiles);
+ t1 = new Thread(Game.ResetGameFiles);
t1.Start();
t1.Join();
}
diff --git a/Classes/NKHook.cs b/Classes/NKHook.cs
index fff8c46..b78984c 100644
--- a/Classes/NKHook.cs
+++ b/Classes/NKHook.cs
@@ -12,6 +12,7 @@ namespace TD_Loader.Classes
{
class NKHook
{
+ public static bool enableNKH = false;
public static string nkhDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\NKHook5";
public static string nkhEXE = nkhDir + "\\NKHook5-Injector.exe";
public static string pathTowerLoadPlugin = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\NKHook5\\Plugins\\NewTowerLoader.dll";
@@ -39,7 +40,7 @@ public static bool DoesNkhExist()
}
public static bool CanUseNKH()
{
- if (Settings.game.GameName != "BTD5" || Settings.game == null)
+ if (!enableNKH || Settings.game.GameName != "BTD5" || Settings.game == null)
return false;
if (!DoesNkhExist())
diff --git a/Classes/Settings.cs b/Classes/Settings.cs
index d20fd34..aefaf14 100644
--- a/Classes/Settings.cs
+++ b/Classes/Settings.cs
@@ -134,7 +134,7 @@ public static void SaveGameFile()
{
settings.GameName = game.GameName;
settings.BTD5Version = game.GameVersion;
- settings.BTD5Dir = game.GameDir;
+ settings.BTD5Dir = game.GameDir.Replace("\\\\", "\\");
settings.BTD5BackupDir = game.GameBackupDir;
settings.BTD5ModsDir = game.ModsDir;
settings.BTD5LoadedMods = game.LoadedMods;
@@ -143,7 +143,7 @@ public static void SaveGameFile()
{
settings.GameName = game.GameName;
settings.BTDBVersion = game.GameVersion;
- settings.BTDBDir = game.GameDir;
+ settings.BTDBDir = game.GameDir.Replace("\\\\", "\\"); ;
settings.BTDBBackupDir = game.GameBackupDir;
settings.BTDBModsDir = game.ModsDir;
settings.BTDBLoadedMods = game.LoadedMods;
@@ -152,7 +152,7 @@ public static void SaveGameFile()
{
settings.GameName = game.GameName;
settings.BMCVersion = game.GameVersion;
- settings.BMCDir = game.GameDir;
+ settings.BMCDir = game.GameDir.Replace("\\\\", "\\"); ;
settings.BMCBackupDir = game.GameBackupDir;
settings.BMCModsDir = game.ModsDir;
settings.BMCLoadedMods = game.LoadedMods;
diff --git a/Classes/log.cs b/Classes/log.cs
index b73cc43..18f5f1b 100644
--- a/Classes/log.cs
+++ b/Classes/log.cs
@@ -23,6 +23,8 @@ public static void Print(string output, bool canRepeat, bool Notice)
if (!canRepeat && output == log.lastMessage)
return;
+ if (output == "input string is null" || output == "input string is empty")
+ return;
MainWindow.instance.OutputLog.Dispatcher.BeginInvoke((Action)(() =>
{
diff --git a/MainWindow.xaml b/MainWindow.xaml
index 405f354..88a5753 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -126,7 +126,7 @@
VerticalAlignment="Top" Margin="-5,0,0,0" Background="{x:Null}">
-
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index f9cedf0..9b604fb 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -197,7 +197,7 @@ private void CreatePluginsTab()
}
private void ShowHidePlugins()
{
- if (Settings.game.GameName == "BTD5" && Settings.game != null)
+ if (NKHook.CanUseNKH() && Settings.game.GameName == "BTD5" && Settings.game != null)
{
Plugins_Tab.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { Plugins_Tab.Visibility = Visibility.Visible; }));
LaunchGrid.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { LaunchGrid.MinHeight = 195; }));
diff --git a/Mods_UserControl.xaml.cs b/Mods_UserControl.xaml.cs
index 305ec50..d4fe853 100644
--- a/Mods_UserControl.xaml.cs
+++ b/Mods_UserControl.xaml.cs
@@ -43,6 +43,7 @@ public void PopulateMods(string game)
return;
Mods_ListBox.Items.Clear();
+ SelectedMods_ListBox.Items.Clear();
modPaths = new List();
modItems = new List();
var mods = new DirectoryInfo(Settings.game.ModsDir).GetFiles("*.*");
diff --git a/Plugins_UserControl.xaml.cs b/Plugins_UserControl.xaml.cs
index b10f157..9b75a2d 100644
--- a/Plugins_UserControl.xaml.cs
+++ b/Plugins_UserControl.xaml.cs
@@ -40,6 +40,9 @@ public Plugins_UserControl()
}
public void PopulateMods()
{
+ if (Settings.game.GameName != "BTD5")
+ return;
+
modPaths = new List();
Plugins_ListBox.Items.Clear();
SelectedPlugins_ListBox.Items.Clear();
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
index 2c2fc64..8943915 100644
--- a/Properties/AssemblyInfo.cs
+++ b/Properties/AssemblyInfo.cs
@@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.1")]
-[assembly: AssemblyFileVersion("1.0.0.1")]
+[assembly: AssemblyVersion("1.2.0.0")]
+[assembly: AssemblyFileVersion("1.2.0.0")]