Implement new games and 1 lang

Games: Rogue Company & The Outer Worlds | Languauges: Zulu
This commit is contained in:
GMatrixGames 2020-11-14 15:58:58 -05:00
parent 4e5df3ee50
commit 0d11af9188
No known key found for this signature in database
GPG Key ID: 19B7F96FB9AF302F
14 changed files with 457 additions and 368 deletions

View File

@ -10,8 +10,10 @@
MinecraftDungeons,
BattleBreakers,
Spellbreak,
StateOfDecay2, // WIP
TheCycle
StateOfDecay2,
TheCycle,
TheOuterWorlds,
RogueCompany
}
public enum EFModel
@ -63,7 +65,8 @@
Swedish = 19,
Thai = 20,
Indonesian = 21,
VietnameseVietnam = 22
VietnameseVietnam = 22,
Zulu = 23
}
public enum EJsonType: long

View File

@ -71,6 +71,7 @@
<None Remove="Resources\power.png" />
<None Remove="Resources\progress-download.png" />
<None Remove="Resources\refresh.png" />
<None Remove="Resources\roguecompany.png" />
<None Remove="Resources\rotate-3d.png" />
<None Remove="Resources\share-all.png" />
<None Remove="Resources\share.png" />
@ -82,6 +83,7 @@
<None Remove="Resources\T-Icon-Pets-64.png" />
<None Remove="Resources\T-Icon-Quests-64.png" />
<None Remove="Resources\thecycle.ico" />
<None Remove="Resources\theouterworlds.png" />
<None Remove="Resources\T_ClipSize_Weapon_Stats.png" />
<None Remove="Resources\T_DamagePerBullet_Weapon_Stats.png" />
<None Remove="Resources\T_Placeholder_Challenge_Image.png" />
@ -170,6 +172,7 @@
<Resource Include="Resources\power.png" />
<Resource Include="Resources\progress-download.png" />
<Resource Include="Resources\refresh.png" />
<Resource Include="Resources\roguecompany.png" />
<Resource Include="Resources\share-all.png" />
<Resource Include="Resources\share.png" />
<Resource Include="Resources\sign-direction-plus.png" />
@ -180,6 +183,7 @@
<Resource Include="Resources\T-Icon-Pets-64.png" />
<Resource Include="Resources\T-Icon-Quests-64.png" />
<Resource Include="Resources\thecycle.ico" />
<Resource Include="Resources\theouterworlds.png" />
<Resource Include="Resources\T_ClipSize_Weapon_Stats.png" />
<Resource Include="Resources\T_DamagePerBullet_Weapon_Stats.png" />
<Resource Include="Resources\T_Placeholder_Challenge_Image.png" />

View File

@ -67,6 +67,8 @@ namespace FModel
EGame.Spellbreak => Resources.GameName_Spellbreak,
EGame.StateOfDecay2 => Resources.GameName_StateofDecay2,
EGame.TheCycle => Resources.GameName_TheCycle,
EGame.TheOuterWorlds => Resources.GameName_TheOuterWorlds,
EGame.RogueCompany => Resources.GameName_RogueCompany,
EGame.Unknown => "Unknown",
_ => "Unknown"
};

View File

@ -35,7 +35,7 @@ using System.Windows.Controls;
using System.Windows.Input;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Net.NetworkInformation;
using PropertyInfo = FModel.PakReader.IO.PropertyInfo;
namespace FModel
{
@ -106,41 +106,43 @@ namespace FModel
private async void LoadMappings()
{
string rawMappings = "{}";
string rawEnumMappings = "{}";
try
{
#if DEBUG
if (File.Exists("TypeMappings.json"))
{
rawMappings = await File.ReadAllTextAsync("TypeMappings.json");
}
else if (NetworkInterface.GetIsNetworkAvailable())
{
rawMappings = await Endpoints.GetStringEndpoint(Endpoints.FORTNITE_TYPE_MAPPINGS);
}
if (File.Exists("EnumMappings.json"))
{
rawEnumMappings = await File.ReadAllTextAsync("EnumMappings.json");
}
else if (NetworkInterface.GetIsNetworkAvailable())
{
rawEnumMappings = await Endpoints.GetStringEndpoint(Endpoints.FORTNITE_ENUM_MAPPINGS);
}
#else
rawMappings = await Endpoints.GetStringEndpoint(Endpoints.FORTNITE_TYPE_MAPPINGS);
rawEnumMappings = await Endpoints.GetStringEndpoint(Endpoints.FORTNITE_ENUM_MAPPINGS);
#endif
var serializerSettings = new JsonSerializerSettings
{
ContractResolver = new DefaultContractResolver
string rawMappings = null;
string rawEnumMappings = null;
try
{
NamingStrategy = new CamelCaseNamingStrategy(false, false)
rawMappings = await File.ReadAllTextAsync(@"C:\Users\GMatrixGames\Desktop\FTest\FortniteTypeMappings\TypeMappings.json");
rawEnumMappings = await File.ReadAllTextAsync(@"C:\Users\GMatrixGames\Desktop\FTest\FortniteTypeMappings\EnumMappings.json");
}
};
Globals.TypeMappings = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<int, PakReader.IO.PropertyInfo>>>(rawMappings, serializerSettings);
Globals.EnumMappings = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<int, string>>>(rawEnumMappings, serializerSettings);
catch
{
rawMappings ??= await Endpoints.GetStringEndpoint(Endpoints.FORTNITE_TYPE_MAPPINGS);
rawEnumMappings ??= await Endpoints.GetStringEndpoint(Endpoints.FORTNITE_ENUM_MAPPINGS);
}
#else
var rawMappings = await Endpoints.GetStringEndpoint(Endpoints.FORTNITE_TYPE_MAPPINGS);
var rawEnumMappings = await Endpoints.GetStringEndpoint(Endpoints.FORTNITE_ENUM_MAPPINGS);
#endif
var serializerSettings = new JsonSerializerSettings
{
ContractResolver = new DefaultContractResolver
{ NamingStrategy = new CamelCaseNamingStrategy(false, false) }
};
Globals.TypeMappings =
JsonConvert.DeserializeObject<Dictionary<string, Dictionary<int, PropertyInfo>>>(rawMappings,
serializerSettings);
Globals.EnumMappings = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<int, string>>>(rawEnumMappings,
serializerSettings);
}
catch (Exception exception)
{
DebugHelper.WriteException(exception, "Failed to load Mappings");
Globals.TypeMappings ??= new Dictionary<string, Dictionary<int, PropertyInfo>>();
Globals.EnumMappings ??= new Dictionary<string, Dictionary<int, string>>();
}
}
public void ReloadMappings(object sender, RoutedEventArgs e)

File diff suppressed because it is too large Load Diff

View File

@ -1085,4 +1085,13 @@ It's now the most used free software to leak on Fortnite.</value>
<data name="Packages" xml:space="preserve">
<value>Packages</value>
</data>
<data name="GameName_RogueCompany" xml:space="preserve">
<value>Rogue Company</value>
</data>
<data name="GameName_TheOuterWorlds" xml:space="preserve">
<value>The Outer Worlds</value>
</data>
<data name="Zulu" xml:space="preserve">
<value>Zulu</value>
</data>
</root>

View File

@ -823,4 +823,13 @@
<data name="GameName_TheCycle" xml:space="preserve">
<value>《The Cycle》</value>
</data>
<data name="GameName_RogueCompany" xml:space="preserve">
<value>《Rogue Company》</value>
</data>
<data name="GameName_TheOuterWorlds" xml:space="preserve">
<value>《The Outer Worlds》</value>
</data>
<data name="Zulu" xml:space="preserve">
<value>祖鲁语</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -37,6 +37,8 @@ namespace FModel.Utils
"g3" => EGame.Spellbreak,
"StateOfDecay2" => EGame.StateOfDecay2,
"Prospect" => EGame.TheCycle,
"Indiana" => EGame.TheOuterWorlds,
"RogueCompany" => EGame.RogueCompany,
_ => EGame.Unknown,
};
}

View File

@ -61,6 +61,8 @@ namespace FModel.Utils
m = Regex.Match(mount + KvP.Value.Name, $"{gameName}/Content/Localization/Game/{langCode}/Game.locres", RegexOptions.IgnoreCase);
else if (Globals.Game.ActualGame == EGame.TheCycle)
m = Regex.Match(mount + KvP.Value.Name, $"{gameName}/Content/Localization/ProspectGame/{langCode}/ProspectGame.locres", RegexOptions.IgnoreCase);
else if (Globals.Game.ActualGame == EGame.RogueCompany)
m = Regex.Match(mount + KvP.Value.Name, $"{gameName}/Content/Localization/KillstreakGame/{langCode}/KillstreakGame.locres", RegexOptions.IgnoreCase);
if (m != null && m.Success)
{
@ -255,6 +257,20 @@ namespace FModel.Utils
ELanguage.Chinese => "zh",
_ => "en"
},
EGame.RogueCompany => lang switch
{
ELanguage.English => "en",
ELanguage.German => "de",
ELanguage.SpanishLatin => "es",
ELanguage.French => "fr",
ELanguage.Polish => "pl",
ELanguage.PortugueseBrazil => "pt",
ELanguage.Japanese => "ja",
ELanguage.Russian => "ru",
ELanguage.Chinese => "zh",
ELanguage.Zulu => "zu",
_ => "en"
},
_ => "en"
};
}

View File

@ -105,16 +105,23 @@ namespace FModel.Utils
return string.Empty;
}
// public static string GetStateOfDecay2PakFilesPath()
// {
// (_, string _, string sod2PakFilesPath) = GetUEGameFilesPath("<Replace when known with EGL name>");
// if (!string.IsNullOrEmpty(sod2PakFilesPath))
// {
// return $"{sod2PakFilesPath}\\StateOfDecay2\\Content\\Paks";
// }
//
// return string.Empty;
// }
public static string GetRogueCompanyFilesPath()
{
(_, string _, string rogueCompanyFilesPath) = GetUEGameFilesPath("Pewee");
if (!string.IsNullOrEmpty(rogueCompanyFilesPath))
return $"{rogueCompanyFilesPath}\\RogueCompany\\Content\\Paks";
else
return string.Empty;
}
public static string GetTheOuterWorldsFilesPath()
{
(_, string _, string theOuterWorldsFilesPath) = GetUEGameFilesPath("Rosemallow");
if (!string.IsNullOrEmpty(theOuterWorldsFilesPath))
return $"{theOuterWorldsFilesPath}\\Indiana\\Content\\Paks";
else
return string.Empty;
}
public static string GetBorderlands3PakFilesPath()
{
@ -127,7 +134,7 @@ namespace FModel.Utils
public static string GetTheCyclePakFilesPath()
{
(_, string _, string theCycleFilesPath) = GetUEGameFilesPath("AzaleaAlpha"); // TODO: Change when out of alpha
(_, string _, string theCycleFilesPath) = GetUEGameFilesPath("AzaleaAlpha");
if (!string.IsNullOrEmpty(theCycleFilesPath))
return $"{theCycleFilesPath}\\Prospect\\Content\\Paks";
else

View File

@ -73,7 +73,8 @@ namespace FModel.ViewModels.ComboBox
new ComboBoxViewModel { Id = 19, Content = Properties.Resources.Swedish, Property = ELanguage.Swedish },
new ComboBoxViewModel { Id = 20, Content = Properties.Resources.Thai, Property = ELanguage.Thai },
new ComboBoxViewModel { Id = 21, Content = Properties.Resources.Indonesian, Property = ELanguage.Indonesian },
new ComboBoxViewModel { Id = 22, Content = Properties.Resources.VietnameseVietnam, Property = ELanguage.VietnameseVietnam }
new ComboBoxViewModel { Id = 22, Content = Properties.Resources.VietnameseVietnam, Property = ELanguage.VietnameseVietnam },
new ComboBoxViewModel { Id = 23, Content = Properties.Resources.Zulu, Property = ELanguage.Zulu}
};
public static ObservableCollection<ComboBoxViewModel> jsonCbViewModel = new ObservableCollection<ComboBoxViewModel>

View File

@ -100,14 +100,21 @@ namespace FModel.Windows.Launcher
ComboBoxVm.gamesCbViewModel.Add(new ComboBoxViewModel { Id = i++, Content = Properties.Resources.GameName_TheCycle, Property = theCyclePath });
}
//string sod2Path = Paks.GetStateOfDecay2PakFilesPath();
//if (!string.IsNullOrEmpty(sod2Path))
//{
// WIP
// DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[UWP / LauncherInstalled.dat]", $"State of Decay 2 found at {sod2Path}");
// Globals.gNotifier.ShowCustomMessage("State of Decay 2", Properties.Resources.PathAutoDetected, "/FModel;component/Resources/sod2.ico");
// ComboBoxVm.gamesCbViewModel.Add(new ComboBoxViewModel { Id = i++, Content = "State of Decay 2", Property = sod2Path });
//}
string rogueCompanyPath = Paks.GetRogueCompanyFilesPath();
if (!string.IsNullOrEmpty(rogueCompanyPath))
{
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[LauncherInstalled.dat]", $"Rogue Company found at {rogueCompanyPath}");
Globals.gNotifier.ShowCustomMessage(Properties.Resources.GameName_RogueCompany, Properties.Resources.PathAutoDetected, "/FModel;component/Resources/roguecompany.png");
ComboBoxVm.gamesCbViewModel.Add(new ComboBoxViewModel { Id = i++, Content = Properties.Resources.GameName_RogueCompany, Property = rogueCompanyPath });
}
string theOuterWorldsPath = Paks.GetTheOuterWorldsFilesPath();
if (!string.IsNullOrEmpty(theOuterWorldsPath))
{
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[LauncherInstalled.dat]", $"The Outer Worlds found at {theOuterWorldsPath}");
Globals.gNotifier.ShowCustomMessage(Properties.Resources.GameName_TheOuterWorlds, Properties.Resources.PathAutoDetected, "/FModel;component/Resources/theouterworlds.png");
ComboBoxVm.gamesCbViewModel.Add(new ComboBoxViewModel { Id = i++, Content = Properties.Resources.GameName_TheOuterWorlds, Property = theOuterWorldsPath });
}
Games_CbBox.SelectedItem = ComboBoxVm.gamesCbViewModel.FirstOrDefault(x => x.Property.ToString() == Properties.Settings.Default.PakPath);
}