diff --git a/FModel/Enums.cs b/FModel/Enums.cs index 6e2099aa..537023c6 100644 --- a/FModel/Enums.cs +++ b/FModel/Enums.cs @@ -9,7 +9,8 @@ Borderlands3, MinecraftDungeons, BattleBreakers, - Spellbreak + Spellbreak, + StateOfDecay2 // WIP } public enum EFModel @@ -41,6 +42,7 @@ { English, French, + AustralianEnglish, German, Italian, Spanish, diff --git a/FModel/Globals.cs b/FModel/Globals.cs index f463900d..b9c39a7f 100644 --- a/FModel/Globals.cs +++ b/FModel/Globals.cs @@ -57,6 +57,7 @@ namespace FModel EGame.MinecraftDungeons => "Minecraft Dungeons", EGame.BattleBreakers => "Battle Breakers", EGame.Spellbreak => "Spellbreak", + EGame.StateOfDecay2 => "State of Decay 2", EGame.Unknown => "Unknown", _ => "Unknown", }; diff --git a/FModel/Utils/Folders.cs b/FModel/Utils/Folders.cs index e5af374f..538bad94 100644 --- a/FModel/Utils/Folders.cs +++ b/FModel/Utils/Folders.cs @@ -31,6 +31,7 @@ namespace FModel.Utils "Dungeons" => EGame.MinecraftDungeons, "WorldExplorers" => EGame.BattleBreakers, "g3" => EGame.Spellbreak, + "StateOfDecay2" => EGame.StateOfDecay2, _ => EGame.Unknown, }; } @@ -48,6 +49,7 @@ namespace FModel.Utils EGame.MinecraftDungeons => "Dungeons", EGame.BattleBreakers => "WorldExplorers", EGame.Spellbreak => "g3", + EGame.StateOfDecay2 => "StateOfDecay2", _ => string.Empty, }; diff --git a/FModel/Utils/Localizations.cs b/FModel/Utils/Localizations.cs index 50c58b48..e62858df 100644 --- a/FModel/Utils/Localizations.cs +++ b/FModel/Utils/Localizations.cs @@ -231,6 +231,19 @@ namespace FModel.Utils ELanguage.Chinese => "zh-Hans", _ => "en" }; + else if (Globals.Game.ActualGame == EGame.StateOfDecay2) + return lang switch + { + ELanguage.English => "en-US", + ELanguage.AustralianEnglish => "en-AU", + ELanguage.Russian => "ru-RU", + ELanguage.PortugueseBrazil => "pt-BR", + ELanguage.Italian => "it-IT", + ELanguage.French => "fr-FR", + ELanguage.SpanishLatin => "es-MX", + ELanguage.German => "de-DE", + _ => "en" + }; else return "en"; } diff --git a/FModel/Utils/Paks.cs b/FModel/Utils/Paks.cs index a732d1fd..9e9eac69 100644 --- a/FModel/Utils/Paks.cs +++ b/FModel/Utils/Paks.cs @@ -76,6 +76,24 @@ namespace FModel.Utils return string.Empty; } + public static (string, string, string) GetUWPPakFilesPath(string game) + { + // WIP + + DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[]", "File not found"); + return (string.Empty, string.Empty, string.Empty); + } + + public static string GetStateOfDecay2PakFilesPath() + { + // WIP - DO NOT USE + (_, string _, string sod2PakFilesPath) = GetUWPPakFilesPath("Microsoft.Dayton_1.3544.68.2_x64__8wekyb3d8bbwe"); + if (!string.IsNullOrEmpty(sod2PakFilesPath)) + return $"{sod2PakFilesPath}\\StateOfDecay2\\Content\\Paks"; + else + return string.Empty; + } + public static string GetBorderlands3PakFilesPath() { (_, string _, string borderlands3FilesPath) = GetUEGameFilesPath("Catnip"); diff --git a/FModel/Windows/Launcher/FLauncher.xaml.cs b/FModel/Windows/Launcher/FLauncher.xaml.cs index 59251109..fc7e3846 100644 --- a/FModel/Windows/Launcher/FLauncher.xaml.cs +++ b/FModel/Windows/Launcher/FLauncher.xaml.cs @@ -87,6 +87,15 @@ namespace FModel.Windows.Launcher ComboBoxVm.gamesCbViewModel.Add(new ComboBoxViewModel { Id = i++, Content = "Spellbreak", Property = spellbreakerFilesPath }); } + string sod2Path = Paks.GetStateOfDecay2PakFilesPath(); + if (!string.IsNullOrEmpty(sod2Path)) + { + // WIP - DO NOT USE + //DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[LauncherInstalled.dat]", $"Spellbreak found at {spellbreakerFilesPath}"); + //Globals.gNotifier.ShowCustomMessage("Spellbreak", Properties.Resources.PathAutoDetected, "/FModel;component/Resources/spellbreak.ico"); + //ComboBoxVm.gamesCbViewModel.Add(new ComboBoxViewModel { Id = i++, Content = "Spellbreak", Property = spellbreakerFilesPath }); + } + Games_CbBox.SelectedItem = ComboBoxVm.gamesCbViewModel.Where(x => x.Property.ToString() == Properties.Settings.Default.PakPath).FirstOrDefault(); }