Merge pull request #96 from GMatrixGames/uwp

Add icon and detection message/add game to selector
This commit is contained in:
Valentin 2020-07-15 19:55:37 +02:00 committed by GitHub
commit 48a920d273
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 17 deletions

View File

@ -97,6 +97,7 @@
<None Remove="Resources\sign-direction.png" />
<None Remove="Resources\spellbreak.ico" />
<None Remove="Resources\stop.png" />
<None Remove="Resources\sod2.ico" />
<None Remove="Resources\T-Icon-Pets-64.png" />
<None Remove="Resources\T-Icon-Quests-64.png" />
<None Remove="Resources\T_ClipSize_Weapon_Stats.png" />
@ -205,6 +206,7 @@
<Resource Include="Resources\sign-direction.png" />
<Resource Include="Resources\spellbreak.ico" />
<Resource Include="Resources\stop.png" />
<Resource Include="Resources\sod2.ico" />
<Resource Include="Resources\T-Icon-Pets-64.png" />
<Resource Include="Resources\T-Icon-Quests-64.png" />
<Resource Include="Resources\T_ClipSize_Weapon_Stats.png" />

BIN
FModel/Resources/sod2.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -30,10 +30,12 @@ namespace FModel.Utils
foreach (InstallationList installationList in launcherDat.InstallationList)
{
if (installationList.AppName.Equals(game))
return (installationList.AppName, installationList.AppVersion, installationList.InstallLocation);
return (installationList.AppName, installationList.AppVersion,
installationList.InstallLocation);
}
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[LauncherInstalled.dat]", $"{game} not found");
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[LauncherInstalled.dat]",
$"{game} not found");
return (string.Empty, string.Empty, string.Empty);
}
}
@ -69,7 +71,7 @@ namespace FModel.Utils
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[WindowsApps]", "Folder not found");
return (string.Empty, string.Empty);
}
public static string GetFortnitePakFilesPath()
{
(_, string _, string fortniteFilesPath) = GetUEGameFilesPath("Fortnite");
@ -94,7 +96,8 @@ namespace FModel.Utils
if (KvP.Key.Contains("VALORANT/live/"))
return $"{KvP.Key.Replace("/", "\\")}ShooterGame\\Content\\Paks";
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[RiotClientInstalls.json]", "Valorant not found");
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[RiotClientInstalls.json]",
"Valorant not found");
}
}
}
@ -106,14 +109,17 @@ namespace FModel.Utils
public static string GetStateOfDecay2PakFilesPath()
{
// WIP
(_, string _, string sod2PakFilesPath) = (null, null, null);
(_, string sod2UWPPakFilesPath) = (string.Empty, string.Empty);
(_, string _, string sod2PakFilesPath) = (string.Empty, string.Empty, string.Empty);
if (!GetUWPPakFilesPath("Microsoft.Dayton_1.3544.68.2_x64__8wekyb3d8bbwe").Equals(null))
(_, sod2PakFilesPath) = GetUWPPakFilesPath("Microsoft.Dayton_1.3544.68.2_x64__8wekyb3d8bbwe");
(_, sod2UWPPakFilesPath) = GetUWPPakFilesPath("Microsoft.Dayton_1.3544.68.2_x64__8wekyb3d8bbwe");
else
(_, _, sod2PakFilesPath) = GetUEGameFilesPath("<Unknown Epic Games Name>");
if (!string.IsNullOrEmpty(sod2PakFilesPath))
return $"{sod2PakFilesPath}\\StateOfDecay2\\Content\\Paks";
else if (!string.IsNullOrEmpty(sod2UWPPakFilesPath))
return $"{sod2UWPPakFilesPath}\\StateOfDecay2\\Content\\Paks";
return string.Empty;
}
@ -125,21 +131,24 @@ namespace FModel.Utils
else
return string.Empty;
}
public static string GetMinecraftDungeonsPakFilesPath()
{
var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
var install = $"{appData}/.minecraft_dungeons/launcher_settings.json";
if (File.Exists(install))
{
{
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[launcher_settings.json]", install);
var launcherSettings = JsonConvert.DeserializeObject<LauncherSettings>(File.ReadAllText(install));
if (launcherSettings.productLibraryDir != null && !string.IsNullOrEmpty(launcherSettings.productLibraryDir))
if (launcherSettings.productLibraryDir != null &&
!string.IsNullOrEmpty(launcherSettings.productLibraryDir))
return $"{launcherSettings.productLibraryDir}\\dungeons\\dungeons\\Dungeons\\Content\\Paks";
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[launcher_settings.json]", "Minecraft Dungeons not found");
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[launcher_settings.json]",
"Minecraft Dungeons not found");
}
return string.Empty;
}
@ -161,7 +170,8 @@ namespace FModel.Utils
return string.Empty;
}
public static void Merge(Dictionary<string, FPakEntry> tempFiles, out Dictionary<string, FPakEntry> files, string mount)
public static void Merge(Dictionary<string, FPakEntry> tempFiles, out Dictionary<string, FPakEntry> files,
string mount)
{
files = new Dictionary<string, FPakEntry>();
foreach (FPakEntry entry in tempFiles.Values)
@ -250,4 +260,4 @@ namespace FModel.Utils
return false;
}
}
}
}

View File

@ -90,10 +90,10 @@ namespace FModel.Windows.Launcher
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 });
// WIP
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[WindowsApps]", $"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 });
}
Games_CbBox.SelectedItem = ComboBoxVm.gamesCbViewModel.Where(x => x.Property.ToString() == Properties.Settings.Default.PakPath).FirstOrDefault();