public bool NeedUpdate(string grimdawnLocation) { string databaseFile = GrimFolderUtility.FindArzFile(grimdawnLocation); if (!string.IsNullOrEmpty(databaseFile)) { long lastModified = File.GetLastWriteTime(databaseFile).Ticks; if (_databaseSettingDao.GetLastDatabaseUpdate() < lastModified) { Logger.Debug($"A new database parse is required, the file \"{databaseFile}\" has been modified"); return(true); } var expansionLocation = Path.Combine(grimdawnLocation, "gdx1"); if (Directory.Exists(expansionLocation)) { return(NeedUpdate(expansionLocation)); } } else { Logger.WarnFormat("Could not locate database at \"{0}\"", grimdawnLocation); } return(false); }
public static void LoadIconsOnly(string grimdawnLocation) { Logger.Debug("Icon loading requested"); { var arcItemsFile = GrimFolderUtility.FindArcFile(grimdawnLocation, "items.arc"); if (!string.IsNullOrEmpty(arcItemsFile)) { Logger.Debug($"Loading vanilla icons from {arcItemsFile}"); LoadIcons(arcItemsFile); } else { Logger.Warn("Could not find the vanilla icons, skipping."); } } foreach (string path in GrimFolderUtility.GetGrimExpansionFolders(grimdawnLocation)) { var arcItemsFile = GrimFolderUtility.FindArcFile(path, "items.arc"); if (!string.IsNullOrEmpty(arcItemsFile)) { Logger.Debug($"Loading expansion icons from {arcItemsFile}"); LoadIcons(arcItemsFile); } else { Logger.Warn("Could not find the expansion, skipping."); } } }
public static void LoadIconsOnly(string grimDawnLocation) { void LoadIconsOrWarn(string arcfile) { if (!string.IsNullOrEmpty(arcfile)) { Logger.Debug($"Loading icons from {arcfile}"); LoadIcons(arcfile); } else { Logger.Warn("Could not find the icons, skipping."); } } Logger.Debug("Icon loading requested"); LoadIconsOrWarn(GrimFolderUtility.FindArcFile(grimDawnLocation, "items.arc")); LoadIconsOrWarn(GrimFolderUtility.FindArcFile(grimDawnLocation, "Level Art.arc")); foreach (var path in GrimFolderUtility.GetGrimExpansionFolders(grimDawnLocation)) { LoadIconsOrWarn(GrimFolderUtility.FindArcFile(path, "items.arc")); LoadIconsOrWarn(GrimFolderUtility.FindArcFile(path, "Level Art.arc")); } }
public static void LoadIconsOnly(string grimdawnLocation) { Logger.Debug("Icon loading requested"); { var arcItemsFile = GrimFolderUtility.FindArcFile(grimdawnLocation, "items.arc"); if (!string.IsNullOrEmpty(arcItemsFile)) { Logger.Debug($"Loading vanilla icons from {arcItemsFile}"); LoadIcons(arcItemsFile); } else { Logger.Warn("Could not find the vanilla icons, skipping."); } } var expansionFolder = Path.Combine(grimdawnLocation, "gdx1"); if (Directory.Exists(expansionFolder)) { var arcItemsFile = GrimFolderUtility.FindArcFile(expansionFolder, "items.arc"); if (!string.IsNullOrEmpty(arcItemsFile)) { Logger.Debug($"Loading expansion icons from {arcItemsFile}"); LoadIcons(arcItemsFile); } else { Logger.Warn("Could not find the expansion, skipping."); } } var crucibleFolder = Path.Combine(grimdawnLocation, "mods", "survivalmode"); if (Directory.Exists(crucibleFolder)) { var arcItemsFile = GrimFolderUtility.FindArcFile(crucibleFolder, "items.arc"); if (!string.IsNullOrEmpty(arcItemsFile)) { Logger.Debug($"Loading \"The Crucible\" icons from {arcItemsFile}"); LoadIcons(arcItemsFile); } else { Logger.Warn("Could not find \"The crucible\", skipping."); } } }
/// <summary> /// Load icons for the selected mod /// </summary> /// <param name="modPath"></param> public static void LoadSelectedModIcons(string modPath) { var fileNames = Directory.EnumerateFiles(modPath, "*items.arc", SearchOption.AllDirectories).ToList(); foreach (var fileName in fileNames) { var arcFile = GrimFolderUtility.FindArcFile(modPath, fileName); if (!string.IsNullOrEmpty(arcFile)) { Logger.Debug($"Loading mods icons from {arcFile} ({modPath})"); LoadIcons(arcFile); } else { Logger.Warn($"Could not find the file {arcFile}, skipping."); } } }