diff --git a/SA-Mod-Manager/App.xaml.cs b/SA-Mod-Manager/App.xaml.cs index f8c36379..36385b4e 100644 --- a/SA-Mod-Manager/App.xaml.cs +++ b/SA-Mod-Manager/App.xaml.cs @@ -137,7 +137,7 @@ protected override async void OnStartup(StartupEventArgs e) } - public static void UpdateDependenciesLocation(string oldD3D8Path) + public static void UpdateDependenciesLocation() { if (Directory.Exists(App.extLibPath) == false && Directory.Exists(App.oldExtLibPath)) { @@ -154,10 +154,6 @@ public static void UpdateDependenciesLocation(string oldD3D8Path) { File.Copy(newPath, newPath.Replace(App.oldExtLibPath, App.extLibPath), true); } - - - if (App.CurrentGame.id == GameEntry.GameType.SADX && File.Exists(oldD3D8Path)) - File.Delete(oldD3D8Path); } catch { } } diff --git a/SA-Mod-Manager/Controls/SADX/GameConfig.xaml.cs b/SA-Mod-Manager/Controls/SADX/GameConfig.xaml.cs index a16d8c21..ed788032 100644 --- a/SA-Mod-Manager/Controls/SADX/GameConfig.xaml.cs +++ b/SA-Mod-Manager/Controls/SADX/GameConfig.xaml.cs @@ -26,7 +26,7 @@ public partial class GameConfig : UserControl #region Variables public GameSettings GameProfile; - bool suppressEvent = false; + bool suppressEvent = false; public static string OldD3d8to9GamePath = Path.Combine(App.CurrentGame.gameDirectory, "d3d8.dll"); private static string d3d8to9Path = Path.Combine(App.extLibPath, "d3d8m.dll"); private readonly double LowOpacityBtn = 0.7; @@ -49,6 +49,7 @@ public GameConfig(ref object gameSettings, ref bool suppressEvent_) SetPatches(); } + Loaded += GameConfig_Loaded; } @@ -57,10 +58,15 @@ private void GameConfig_Loaded(object sender, RoutedEventArgs e) { SetupBindings(); SetPatches(); - //CheckOldD3D9Dll(); SetTextureFilterList(); InitMouseList(); + if (App.CurrentGame.id == GameEntry.GameType.SADX && File.Exists(OldD3d8to9GamePath)) + { + File.Delete(OldD3d8to9GamePath); + SetD3D9(); + } + mouseAction.SelectionChanged += mouseAction_SelectionChanged; mouseBtnAssign.SelectionChanged += mouseBtnAssign_SelectionChanged; } @@ -191,7 +197,12 @@ public static void UpdateD3D8Paths() { OldD3d8to9GamePath = Path.Combine(App.CurrentGame.gameDirectory, "d3d8.dll"); d3d8to9Path = Path.Combine(App.extLibPath, "d3d8m.dll"); - } + } + + public void SetD3D9() + { + comboRenderBackend.SelectedIndex = 1; + } private void comboTextureFilter_SelectionChanged(object sender, SelectionChangedEventArgs e) diff --git a/SA-Mod-Manager/UI/MainWindow.xaml.cs b/SA-Mod-Manager/UI/MainWindow.xaml.cs index f9486234..2f4c1615 100644 --- a/SA-Mod-Manager/UI/MainWindow.xaml.cs +++ b/SA-Mod-Manager/UI/MainWindow.xaml.cs @@ -1469,10 +1469,9 @@ private void UpdateManagerInfo() App.extLibPath = Path.Combine(App.CurrentGame.modDirectory, ".modloader", "extlib"); - if (App.CurrentGame?.id == GameEntry.GameType.SADX) - Controls.SADX.GameConfig.UpdateD3D8Paths(); - - App.UpdateDependenciesLocation(Controls.SADX.GameConfig.OldD3d8to9GamePath); + Controls.SADX.GameConfig.UpdateD3D8Paths(); + + App.UpdateDependenciesLocation(); } else