From f649106144d3946fa0b23d894fcaa83209da0fa1 Mon Sep 17 00:00:00 2001 From: Martin Benjamins Date: Thu, 21 Mar 2024 20:39:50 +0100 Subject: [PATCH] Add preferHighResTextures setting --- CascLib | 2 +- Services/CASC.cs | 2 +- SettingsManager.cs | 6 ++++++ WoWDBDefs | 2 +- config.json | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CascLib b/CascLib index e0fb8d5..0ad786f 160000 --- a/CascLib +++ b/CascLib @@ -1 +1 @@ -Subproject commit e0fb8d5ffd8d40995b15c71608f1e73bd623d545 +Subproject commit 0ad786fc28cc6b708c2e37567366e2151a04b6b5 diff --git a/Services/CASC.cs b/Services/CASC.cs index e21d617..20b5cd6 100644 --- a/Services/CASC.cs +++ b/Services/CASC.cs @@ -72,7 +72,7 @@ public static void InitCasc(string? basedir = null, string program = "wowt", Loc var splitName = cascHandler.Config.BuildName.Replace("WOW-", "").Split("patch"); BuildName = splitName[1].Split("_")[0] + "." + splitName[0]; - cascHandler.Root.SetFlags(locale); + cascHandler.Root.SetFlags(locale, false, SettingsManager.preferHighResTextures); var manifestFolder = SettingsManager.manifestFolder; if (!Directory.Exists(manifestFolder)) diff --git a/SettingsManager.cs b/SettingsManager.cs index 567b4a8..a5a000f 100644 --- a/SettingsManager.cs +++ b/SettingsManager.cs @@ -13,6 +13,7 @@ public static class SettingsManager public static CASCLib.LocaleFlags locale; public static bool showAllFiles = false; public static string extractionDir; + public static bool preferHighResTextures = false; // supported command line flags and switches // flag syntax: -flag value || -flag=value or --switch @@ -27,6 +28,7 @@ public static class SettingsManager private const string _localeFlag = "-locale"; private const string _showAllFilesFlag = "-showAllFiles"; private const string _extractionDirFlag = "-extractionDir"; + private const string _preferHighResTexturesFlag = "-preferHighResTextures"; // calling the double-hyphen args 'switch' instead of 'flag' because they don't have values private const string _debugSwitch = "--debug"; @@ -107,6 +109,7 @@ public static void LoadSettings() wowProduct = config.GetSection("config")["wowProduct"]; showAllFiles = bool.Parse(config.GetSection("config")["showAllFiles"]); extractionDir = config.GetSection("config")["extractionDir"]; + preferHighResTextures = bool.Parse(config.GetSection("config")["preferHighResTextures"]); } private static void SetLocale(string locValue) @@ -207,6 +210,9 @@ private static void HandleFlag(string flag, string? value) case (_extractionDirFlag): extractionDir = value; break; + case (_preferHighResTexturesFlag): + preferHighResTextures = bool.Parse(value); + break; } } } diff --git a/WoWDBDefs b/WoWDBDefs index 03b8304..2241ecc 160000 --- a/WoWDBDefs +++ b/WoWDBDefs @@ -1 +1 @@ -Subproject commit 03b830463ce8ddeab7bd13e6838c353ec3829b4d +Subproject commit 2241ecc1aea92cabc350f5b750d513a7e72e4820 diff --git a/config.json b/config.json index af25b38..0712dec 100644 --- a/config.json +++ b/config.json @@ -10,6 +10,7 @@ "region": "eu", "locale": "enUS", "showAllFiles": false, - "extractionDir": "extract" + "extractionDir": "extract", + "preferHighResTextures": false } } \ No newline at end of file