Added support for Minecraft Dungeons

This commit is contained in:
Jackson 2020-06-18 02:29:54 -07:00
parent aa3a7fc0c4
commit be867be2f8
8 changed files with 41 additions and 1 deletions

View File

@ -6,7 +6,8 @@
Fortnite,
Valorant,
DeadByDaylight,
Borderlands3
Borderlands3,
MinecraftDungeons
}
public enum EFModel

View File

@ -78,6 +78,7 @@
<None Remove="Resources\key.png" />
<None Remove="Resources\lock-open-variant.ico" />
<None Remove="Resources\magnify.png" />
<None Remove="Resources\minecraftdungeons.ico" />
<None Remove="Resources\open-in-new.png" />
<None Remove="Resources\pause.png" />
<None Remove="Resources\paypal.png" />
@ -181,6 +182,7 @@
<Resource Include="Resources\key.png" />
<Resource Include="Resources\lock-open-variant.ico" />
<Resource Include="Resources\magnify.png" />
<Resource Include="Resources\minecraftdungeons.ico" />
<Resource Include="Resources\open-in-new.png" />
<Resource Include="Resources\pause.png" />
<Resource Include="Resources\paypal.png" />

View File

@ -54,6 +54,7 @@ namespace FModel
EGame.Valorant => "Valorant",
EGame.DeadByDaylight => "Dead By Daylight",
EGame.Borderlands3 => "Borderlands 3",
EGame.MinecraftDungeons => "Minecraft Dungeons",
EGame.Unknown => "Unknown",
_ => "Unknown",
};

View File

@ -0,0 +1,7 @@
namespace FModel.Grabber.Paks
{
public class LauncherSettings
{
public string productLibraryDir;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -28,6 +28,7 @@ namespace FModel.Utils
"ShooterGame" => EGame.Valorant,
"DeadByDaylight" => EGame.DeadByDaylight,
"OakGame" => EGame.Borderlands3,
"Dungeons" => EGame.MinecraftDungeons,
_ => EGame.Unknown,
};
}
@ -42,6 +43,7 @@ namespace FModel.Utils
EGame.Valorant => "ShooterGame",
EGame.DeadByDaylight => "DeadByDaylight",
EGame.Borderlands3 => "OakGame",
EGame.MinecraftDungeons => "Dungeons",
_ => string.Empty,
};

View File

@ -4,6 +4,7 @@ using Newtonsoft.Json;
using PakReader.Parsers.Objects;
using System.Collections.Generic;
using System.IO;
using System;
namespace FModel.Utils
{
@ -82,6 +83,23 @@ 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)
if(!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");
}
return string.Empty;
}
public static void Merge(Dictionary<string, FPakEntry> tempFiles, out Dictionary<string, FPakEntry> files, string mount)
{

View File

@ -62,6 +62,15 @@ namespace FModel.Windows.Launcher
Globals.gNotifier.ShowCustomMessage("Borderlands 3", Properties.Resources.PathAutoDetected, "/FModel;component/Resources/borderlands3.ico");
ComboBoxVm.gamesCbViewModel.Add(new ComboBoxViewModel { Id = i++, Content = "Borderlands 3", Property = borderlands3FilesPath });
}
string minecraftdungeonsFilesPath = Paks.GetMinecraftDungeonsPakFilesPath();
if (!string.IsNullOrEmpty(minecraftdungeonsFilesPath))
{
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[launcher_settings.json]", $"Minecraft Dungeons found at {minecraftdungeonsFilesPath}");
Globals.gNotifier.ShowCustomMessage("Minecraft Dungeons", Properties.Resources.PathAutoDetected, "/FModel;component/Resources/minecraftdungeons.ico");
ComboBoxVm.gamesCbViewModel.Add(new ComboBoxViewModel { Id = i++, Content = "Minecraft Dungeons", Property = minecraftdungeonsFilesPath });
}
Games_CbBox.SelectedItem = ComboBoxVm.gamesCbViewModel.Where(x => x.Property.ToString() == Properties.Settings.Default.PakPath).FirstOrDefault();
}