public FileInfos Read(XDocument document) { XElement launcherProfilesJson = document.XPathSelectElement("root/launcher/launcherProfilesJson"); XElement optionsTxt = document.XPathSelectElement("root/launcher/optionsTxt"); XElement minecraftExecutable = document.XPathSelectElement("root/launcher/minecraftExecutable"); FileInfos result = new FileInfos() { DefaultLauncherProfilesFile = XElementExtender.ReadUri(launcherProfilesJson), LauncherProfilesFilename = XElementExtender.ReadPath(launcherProfilesJson), DefaultOptionsFile = XElementExtender.ReadUri(optionsTxt), OptionsFilename = XElementExtender.ReadRelativePath(optionsTxt), DefaultMinecraftLauncherFile = XElementExtender.ReadUri(minecraftExecutable), MinecraftLauncherFilename = XElementExtender.ReadPath(minecraftExecutable), MinecraftLauncherHash = XElementExtender.ReadHash(minecraftExecutable) }; OutputConsole.PrintVerbose(result, 1); return(result); }
public static string ReadPath(XElement item) { string relPath = XElementExtender.ReadRelativePath(item); return(Path.Combine(Paths.ExecutingDirectory, relPath)); }