Skip to content

Commit

Permalink
Add preferHighResTextures setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlamin committed Mar 21, 2024
1 parent b01063a commit f649106
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Services/CASC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 6 additions & 0 deletions SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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";
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -207,6 +210,9 @@ private static void HandleFlag(string flag, string? value)
case (_extractionDirFlag):
extractionDir = value;
break;
case (_preferHighResTexturesFlag):
preferHighResTextures = bool.Parse(value);
break;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion WoWDBDefs
Submodule WoWDBDefs updated 1009 files
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"region": "eu",
"locale": "enUS",
"showAllFiles": false,
"extractionDir": "extract"
"extractionDir": "extract",
"preferHighResTextures": false
}
}

0 comments on commit f649106

Please sign in to comment.