Пример #1
0
        public void LoadItems(
            string itemsfileVanilla,
            string itemsfileExpansion1,
            string itemsfileMod,
            ProgressTracker tracker
        ) {
            int numFiles = GrimFolderUtility.CountExisting(itemsfileVanilla, itemsfileExpansion1, itemsfileMod);
            tracker.MaxValue = numFiles;

            ItemAccumulator accumulator = new ItemAccumulator();
            if (File.Exists(itemsfileVanilla)) {
                Parser.Arz.ArzParser.LoadItemRecords(itemsfileVanilla, true).ForEach(accumulator.Add);
                tracker.Increment();
            }
            if (File.Exists(itemsfileExpansion1)) {
                Parser.Arz.ArzParser.LoadItemRecords(itemsfileExpansion1, true).ForEach(accumulator.Add);
                tracker.Increment();
            }
            if (File.Exists(itemsfileMod)) {
                Parser.Arz.ArzParser.LoadItemRecords(itemsfileMod, true).ForEach(accumulator.Add);
                tracker.Increment();
            }

            Items = accumulator.Items;
        }
Пример #2
0
        public void LoadItems(
            List <string> arzFiles,
            ProgressTracker tracker
            )
        {
            tracker.MaxValue = arzFiles.Select(File.Exists).Count();

            // Developers can flip this switch to get a full dump of the GD database.
            // Setting it to true will cause the parsing to skip a lot of data that IA does not need.
            const bool skipIrrelevantStats = false;

            ItemAccumulator accumulator = new ItemAccumulator();

            foreach (string arzFile in arzFiles)
            {
                if (File.Exists(arzFile))
                {
                    Logger.Debug($"Parsing / Loading items from {arzFile}");
                    Parser.Arz.ArzParser.LoadItemRecords(arzFile, skipIrrelevantStats).ForEach(accumulator.Add);
                    tracker.Increment();
                }
                else
                {
                    Logger.Debug($"Ignnoring non existing arz file {arzFile}");
                }
            }

            Items = accumulator.Items;
        }
Пример #3
0
        public void LoadItems(
            List <string> arzFiles,
            ProgressTracker tracker
            )
        {
            tracker.MaxValue = arzFiles.Select(File.Exists).Count();

            // Developers can flip this switch to get a full dump of the GD database.
            // Setting it to true will cause the parsing to skip a lot of data that IA does not need.
            const bool skipIrrelevantStats = true;  // "skipLots"

            ItemAccumulator accumulator = new ItemAccumulator();

            try {
                foreach (string arzFile in arzFiles)
                {
                    if (File.Exists(arzFile))
                    {
                        Logger.Debug($"Parsing / Loading items from {arzFile}");
                        Parser.Arz.ArzParser.LoadItemRecords(arzFile, skipIrrelevantStats).ForEach(accumulator.Add);
                        tracker.Increment();
                    }
                    else
                    {
                        Logger.Debug($"Ignoring non existing arz file {arzFile}");
                    }
                }
            }
            catch (ArgumentException ex) {
                Logger.Warn(ex.Message, ex);
                MessageBox.Show(RuntimeSettings.Language.GetTag("iatag_ui_corrupted"));
                throw ex;
            }

            Items = accumulator.Items;
        }
Пример #4
0
        public void LoadItems(
            List <string> arzFiles,
            ProgressTracker tracker
            )
        {
            tracker.MaxValue = arzFiles.Select(File.Exists).Count();

            // Developers can flip this switch to get a full dump of the GD database.
            // Setting it to true will cause the parsing to skip a lot of data that IA does not need.
            const bool skipIrrelevantStats = true;  // "skipLots"

            ItemAccumulator accumulator = new ItemAccumulator();

            try {
                foreach (string arzFile in arzFiles)
                {
                    if (File.Exists(arzFile))
                    {
                        Logger.Debug($"Parsing / Loading items from {arzFile}");
                        Parser.Arz.ArzParser.LoadItemRecords(arzFile, skipIrrelevantStats).ForEach(accumulator.Add);
                        tracker.Increment();
                    }
                    else
                    {
                        Logger.Debug($"Ignoring non existing arz file {arzFile}");
                    }
                }
            }
            catch (ArgumentException ex) {
                Logger.Warn(ex.Message, ex);
                MessageBox.Show("Game installation is corrupted.\nPlease verify the integrity of your Grim Dawn installation and try again.\n\n(Easily done in steam)");
                throw ex;
            }

            Items = accumulator.Items;
        }