Esempio n. 1
0
        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.");
                }
            }
        }
Esempio n. 2
0
        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"));
            }
        }
Esempio n. 3
0
        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.");
                }
            }
        }
Esempio n. 4
0
        /// <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.");
                }
            }
        }