Ejemplo n.º 1
0
        private static void LoadIcons(string arcItemsFile)
        {
            Logger.Info($"Loading item icons from {arcItemsFile}.");

            var isArcFileLocked = IOHelper.IsFileLocked(new FileInfo(arcItemsFile));
            var arcTempFile     = new TemporaryCopy(arcItemsFile, isArcFileLocked);
            var arcItemFileName = arcTempFile.Filename;

            if (isArcFileLocked)
            {
                Logger.Info($"The file {arcItemsFile} is currently locked for reading. Perhaps Grim Dawn is running?");
                Logger.Info($"A copy of {arcItemsFile} has been created at {arcItemFileName}");
            }

            if (!File.Exists(arcItemFileName))
            {
                Logger.Warn($"Item icon file \"{arcItemFileName}\" could not be located.");
            }

            try {
                DDSImageReader.ExtractItemIcons(arcItemFileName, GlobalPaths.StorageFolder);
            }
            catch (ArgumentException ex) {
                // Ideally we'd like to catch the specific exception, but the available log files don't contain the exception name..
                Logger.Error(ex.Message, ex);
                MessageBox.Show(
                    "Unable to parse icons, ARZ file is corrupted.\nIf you are using steam, please verify the install integrity.",
                    "Corrupted GD installation", MessageBoxButtons.OK);
            }
        }
Ejemplo n.º 2
0
        private static void LoadIcons(string arcItemsFile)
        {
            Logger.Info($"Loading item icons from {arcItemsFile}..");

            bool          arcfileLocked = IOHelper.IsFileLocked(new FileInfo(arcItemsFile));
            TemporaryCopy arcTempFile   = new TemporaryCopy(arcItemsFile, arcfileLocked);
            string        arcItemfile   = arcTempFile.Filename;

            if (arcfileLocked)
            {
                Logger.Info($"The file {arcItemsFile} is currently locked for reading. Perhaps Grim Dawn is running?");
                Logger.Info($"A copy of {arcItemsFile} has been created at {arcItemfile}");
            }
            if (!File.Exists(arcItemfile))
            {
                Logger.Warn($"Item icon file \"{arcItemfile}\" could not be located..");
            }

            DDSImageReader.ExtractItemIcons(arcItemfile, GlobalPaths.StorageFolder);
        }