Beispiel #1
0
        private void InitializeData()
        {
            InitializeComponent();
            DisplayServerMultiplierPresets();
            multSetter = new MultiplierSetting[Values.STATS_COUNT];
            for (int s = 0; s < Values.STATS_COUNT; s++)
            {
                multSetter[s] = new MultiplierSetting
                {
                    StatName = $"{Utils.statName(s)} [{s}]"
                };
                flowLayoutPanelStatMultipliers.Controls.Add(multSetter[s]);
            }

            // set neutral numbers for stat-multipliers to the default values to easier see what is non-default
            ServerMultipliers officialMultipliers = Values.V.serverMultipliersPresets.GetPreset(ServerMultipliersPresets.OFFICIAL);

            for (int s = 0; s < Values.STATS_COUNT; s++)
            {
                if (s < officialMultipliers.statMultipliers.Length)
                {
                    multSetter[s].setNeutralValues(officialMultipliers.statMultipliers[s]);
                }
                else
                {
                    multSetter[s].setNeutralValues(null);
                }
            }
            nudTamingSpeed.NeutralNumber              = 1;
            nudDinoCharacterFoodDrain.NeutralNumber   = 1;
            nudMatingInterval.NeutralNumber           = 1;
            nudEggHatchSpeed.NeutralNumber            = 1;
            nudBabyMatureSpeed.NeutralNumber          = 1;
            nudBabyCuddleInterval.NeutralNumber       = 1;
            nudBabyImprintingStatScale.NeutralNumber  = 1;
            nudBabyFoodConsumptionSpeed.NeutralNumber = 1;
            // event
            nudTamingSpeedEvent.NeutralNumber              = 1.5M;
            nudDinoCharacterFoodDrainEvent.NeutralNumber   = 1;
            nudMatingIntervalEvent.NeutralNumber           = 1;
            nudEggHatchSpeedEvent.NeutralNumber            = 1;
            nudBabyMatureSpeedEvent.NeutralNumber          = 1;
            nudBabyCuddleIntervalEvent.NeutralNumber       = 1;
            nudBabyFoodConsumptionSpeedEvent.NeutralNumber = 1;

            customSCStarving.Title = "Starving: ";
            customSCWakeup.Title   = "Wakeup: ";
            customSCBirth.Title    = "Birth: ";
            customSCCustom.Title   = "Custom: ";

            fileSelectorExtractedSaveFolder.IsFile = false;

            Disposed       += Settings_Disposed;
            LanguageChanged = false;

            // Tooltips
            tt = new ToolTip();
            tt.SetToolTip(numericUpDownAutosaveMinutes, "To disable set to 0");
            tt.SetToolTip(chkCollectionSync, "If checked, the tool automatically reloads the library if it was changed. Use if multiple persons editing the file, e.g. via a shared folder.\nIt's recommened to check this along with \"Auto Save\"");
            tt.SetToolTip(checkBoxAutoSave, "If checked, the library is saved after each change automatically.\nIt's recommened to check this along with \"Auto Update Collection File\"");
            tt.SetToolTip(numericUpDownMaxChartLevel, "This number defines the level that is shown as maximum in the charts.\nUsually it's good to set this value to one third of the max wild level.");
            tt.SetToolTip(labelTameAdd, "PerLevelStatsMultiplier_DinoTamed_Add");
            tt.SetToolTip(labelTameAff, "PerLevelStatsMultiplier_DinoTamed_Affinity");
            tt.SetToolTip(labelWildLevel, "PerLevelStatsMultiplier_DinoWild");
            tt.SetToolTip(labelTameLevel, "PerLevelStatsMultiplier_DinoTamed");
            tt.SetToolTip(chkbSpeechRecognition, "If the overlay is enabled, you can ask via the microphone for taming-infos,\ne.g.\"Argentavis level 30\" to display basic taming-infos in the overlay");
            tt.SetToolTip(labelBabyFoodConsumptionSpeed, "BabyFoodConsumptionSpeedMultiplier");
            tt.SetToolTip(checkBoxDisplayHiddenStats, "Enable if you have the oxygen-values of all creatures, e.g. by using a mod.");
            tt.SetToolTip(labelEvent, "These values are used if the Event-Checkbox under the species-selector is selected.");
            tt.SetToolTip(cbConsiderWildLevelSteps, "Enable to sort out all level-combinations that are not possible for naturally spawned creatures.\nThe step is max-wild-level / 30 by default, e.g. with a max wildlevel of 150, only creatures with levels that are a multiple of 5 are possible (can be different with mods).\nDisable if there are creatures that have other levels, e.g. spawned in by an admin.");
            tt.SetToolTip(cbSingleplayerSettings, "Check this if you have enabled the \"Singleplayer-Settings\" in your game. This settings adjusts some of the multipliers again.");
            tt.SetToolTip(cbAllowMoreThanHundredImprinting, "Enable this if on your server more than 100% imprinting are possible, e.g. with the mod S+ with a Nanny");
            tt.SetToolTip(cbDevTools, "Shows extra tabs for multiplier-testing and extraction test-cases.");
            tt.SetToolTip(nudMaxServerLevel, "The max level allowed on the server. Currently creatures with more than 450 levels will be deleted on official servers.\nA creature that can be potentially have a higher level than this (if maximally leveled up) will be marked with a orange-red text in the library.\nSet to 0 to disable a warning in the loaded library.");
            tt.SetToolTip(lbMaxTotalLevel, "The max level allowed on the server. Currently creatures with more than 450 levels will be deleted on official servers.\nA creature that can be potentially have a higher level than this (if maximally leveled up) will be marked with a orange-red text in the library.\nSet to 0 to disable a warning in the loaded library.");

            // localizations / translations
            // for a new translation
            // * a file local/strins.[languageCode].resx needs to exist.
            // * that file needs to be added to the installer files, for that edit the file setup.iss and setup-debug.iss in the repository base folder.
            // * the entry in the next dictionary needs to be added
            languages = new Dictionary <string, string>
            {
                { "System language", "" },
                { Loc.s("de"), "de" },
                { Loc.s("en"), "en" },
                { Loc.s("es"), "es" },
                { Loc.s("fr"), "fr" },
                { Loc.s("it"), "it" },
                { Loc.s("zh"), "zh" },
            };
            foreach (string l in languages.Keys)
            {
                cbbLanguage.Items.Add(l);
            }
        }
Beispiel #2
0
        private void LoadSettings(CreatureCollection cc)
        {
            if (cc.serverMultipliers?.statMultipliers != null)
            {
                for (int s = 0; s < Values.STATS_COUNT; s++)
                {
                    if (s < cc.serverMultipliers.statMultipliers.Length && cc.serverMultipliers.statMultipliers[s].Length > 3)
                    {
                        multSetter[s].Multipliers = cc.serverMultipliers.statMultipliers[s];
                    }
                    else
                    {
                        multSetter[s].Multipliers = null;
                    }
                }
            }
            cbSingleplayerSettings.Checked = cc.singlePlayerSettings;

            nudMaxDomLevels.ValueSave             = cc.maxDomLevel;
            numericUpDownMaxBreedingSug.ValueSave = cc.maxBreedingSuggestions;
            nudMaxWildLevels.ValueSave            = cc.maxWildLevel;
            nudMaxServerLevel.ValueSave           = cc.maxServerLevel > 0 ? cc.maxServerLevel : 0;
            nudMaxGraphLevel.ValueSave            = cc.maxChartLevel;
            #region Non-event multiplier
            nudEggHatchSpeed.ValueSave            = (decimal)cc.serverMultipliers.EggHatchSpeedMultiplier;
            nudBabyMatureSpeed.ValueSave          = (decimal)cc.serverMultipliers.BabyMatureSpeedMultiplier;
            nudBabyImprintingStatScale.ValueSave  = (decimal)cc.serverMultipliers.BabyImprintingStatScaleMultiplier;
            nudBabyCuddleInterval.ValueSave       = (decimal)cc.serverMultipliers.BabyCuddleIntervalMultiplier;
            nudTamingSpeed.ValueSave              = (decimal)cc.serverMultipliers.TamingSpeedMultiplier;
            nudDinoCharacterFoodDrain.ValueSave   = (decimal)cc.serverMultipliers.DinoCharacterFoodDrainMultiplier;
            nudMatingInterval.ValueSave           = (decimal)cc.serverMultipliers.MatingIntervalMultiplier;
            nudBabyFoodConsumptionSpeed.ValueSave = (decimal)cc.serverMultipliers.BabyFoodConsumptionSpeedMultiplier;
            #endregion
            #region event-multiplier
            ServerMultipliers serverMultipliersEvent = cc.serverMultipliersEvents ?? cc.serverMultipliers;
            nudBabyCuddleIntervalEvent.ValueSave       = (decimal)serverMultipliersEvent.BabyCuddleIntervalMultiplier;
            nudTamingSpeedEvent.ValueSave              = (decimal)serverMultipliersEvent.TamingSpeedMultiplier;
            nudDinoCharacterFoodDrainEvent.ValueSave   = (decimal)serverMultipliersEvent.DinoCharacterFoodDrainMultiplier;
            nudMatingIntervalEvent.ValueSave           = (decimal)serverMultipliersEvent.MatingIntervalMultiplier;
            nudEggHatchSpeedEvent.ValueSave            = (decimal)serverMultipliersEvent.EggHatchSpeedMultiplier;
            nudBabyMatureSpeedEvent.ValueSave          = (decimal)serverMultipliersEvent.BabyMatureSpeedMultiplier;
            nudBabyFoodConsumptionSpeedEvent.ValueSave = (decimal)serverMultipliersEvent.BabyFoodConsumptionSpeedMultiplier;
            #endregion

            checkBoxAutoSave.Checked = Properties.Settings.Default.autosave;
            numericUpDownAutosaveMinutes.ValueSave = Properties.Settings.Default.autosaveMinutes;
            chkbSpeechRecognition.Checked          = Properties.Settings.Default.SpeechRecognition;
            chkCollectionSync.Checked = Properties.Settings.Default.syncCollection;
            if (Properties.Settings.Default.celsius)
            {
                radioButtonCelsius.Checked = true;
            }
            else
            {
                radioButtonFahrenheit.Checked = true;
            }
            cbIgnoreSexInBreedingPlan.Checked  = Properties.Settings.Default.IgnoreSexInBreedingPlan;
            checkBoxDisplayHiddenStats.Checked = Properties.Settings.Default.oxygenForAll;
            tbDefaultFontName.Text             = Properties.Settings.Default.DefaultFontName;
            nudDefaultFontSize.Value           = (decimal)Properties.Settings.Default.DefaultFontSize;

            #region overlay
            nudOverlayInfoDuration.ValueSave = Properties.Settings.Default.OverlayInfoDuration;
            nudOverlayTimerPosX.ValueSave    = Properties.Settings.Default.OverlayTimerPosition.X;
            nudOverlayTimerPosY.ValueSave    = Properties.Settings.Default.OverlayTimerPosition.Y;
            nudOverlayInfoPosDFR.ValueSave   = Properties.Settings.Default.OverlayInfoPosition.X;
            nudOverlayInfoPosY.ValueSave     = Properties.Settings.Default.OverlayInfoPosition.Y;
            cbCustomOverlayLocation.Checked  = Properties.Settings.Default.UseCustomOverlayLocation;
            nudCustomOverlayLocX.ValueSave   = Properties.Settings.Default.CustomOverlayLocation.X;
            nudCustomOverlayLocY.ValueSave   = Properties.Settings.Default.CustomOverlayLocation.Y;
            #endregion

            #region Timers
            cbTimersInOverlayAutomatically.Checked = Properties.Settings.Default.DisplayTimersInOverlayAutomatically;
            cbKeepExpiredTimersInOverlay.Checked   = Properties.Settings.Default.KeepExpiredTimersInOverlay;
            cbDeleteExpiredTimersOnSaving.Checked  = Properties.Settings.Default.DeleteExpiredTimersOnSaving;
            #endregion

            #region OCR
            cbShowOCRButton.Checked = Properties.Settings.Default.showOCRButton;
            nudWaitBeforeScreenCapture.ValueSave = Properties.Settings.Default.waitBeforeScreenCapture;
            nudWhiteThreshold.ValueSave          = Properties.Settings.Default.OCRWhiteThreshold;
            tbOCRCaptureApp.Text = Properties.Settings.Default.OCRApp;

            cbOCRIgnoreImprintValue.Checked = Properties.Settings.Default.OCRIgnoresImprintValue;
            #endregion

            customSCStarving.SoundFile = Properties.Settings.Default.soundStarving;
            customSCWakeup.SoundFile   = Properties.Settings.Default.soundWakeup;
            customSCBirth.SoundFile    = Properties.Settings.Default.soundBirth;
            customSCCustom.SoundFile   = Properties.Settings.Default.soundCustom;

            tbPlayAlarmsSeconds.Text = Properties.Settings.Default.playAlarmTimes;

            cbConsiderWildLevelSteps.Checked         = cc.considerWildLevelSteps;
            nudWildLevelStep.ValueSave               = cc.wildLevelStep;
            cbInventoryCheck.Checked                 = Properties.Settings.Default.inventoryCheckTimer;
            cbAllowMoreThanHundredImprinting.Checked = cc.allowMoreThanHundredImprinting;

            #region library
            cbCreatureColorsLibrary.Checked        = Properties.Settings.Default.showColorsInLibrary;
            cbApplyGlobalSpeciesToLibrary.Checked  = Properties.Settings.Default.ApplyGlobalSpeciesToLibrary;
            cbLibraryHighlightTopCreatures.Checked = Properties.Settings.Default.LibraryHighlightTopCreatures;
            #endregion

            #region import exported
            if (Properties.Settings.Default.ExportCreatureFolders != null)
            {
                foreach (string path in Properties.Settings.Default.ExportCreatureFolders)
                {
                    aTExportFolderLocationsBindingSource.Add(ATImportExportedFolderLocation.CreateFromString(path));
                }
            }
            nudWarnImportMoreThan.Value           = Properties.Settings.Default.WarnWhenImportingMoreCreaturesThan;
            cbApplyNamePatternOnImport.Checked    = Properties.Settings.Default.applyNamePatternOnImportIfEmptyName;
            cbCopyPatternNameToClipboard.Checked  = Properties.Settings.Default.copyNameToClipboardOnImportWhenAutoNameApplied;
            cbAutoImportExported.Checked          = Properties.Settings.Default.AutoImportExportedCreatures;
            cbPlaySoundOnAutomaticImport.Checked  = Properties.Settings.Default.PlaySoundOnAutoImport;
            cbMoveImportedFileToSubFolder.Checked = Properties.Settings.Default.MoveAutoImportedFileToSubFolder;
            cbDeleteAutoImportedFile.Checked      = Properties.Settings.Default.DeleteAutoImportedFile;
            nudImportLowerBoundTE.ValueSave       = (decimal)Properties.Settings.Default.ImportLowerBoundTE * 100;
            #endregion

            #region import savegame
            if (Properties.Settings.Default.arkSavegamePaths != null)
            {
                foreach (string path in Properties.Settings.Default.arkSavegamePaths)
                {
                    aTImportFileLocationBindingSource.Add(ATImportFileLocation.CreateFromString(path));
                }
            }
            fileSelectorExtractedSaveFolder.Link = Properties.Settings.Default.savegameExtractionPath;

            cbImportUpdateCreatureStatus.Checked  = cc.changeCreatureStatusOnSavegameImport;
            textBoxImportTribeNameFilter.Text     = Properties.Settings.Default.ImportTribeNameFilter;
            cbIgnoreUnknownBPOnSaveImport.Checked = Properties.Settings.Default.IgnoreUnknownBlueprintsOnSaveImport;
            cbSaveImportCryo.Checked = Properties.Settings.Default.SaveImportCryo;
            #endregion

            cbDevTools.Checked = Properties.Settings.Default.DevTools;

            cbPrettifyJSON.Checked = Properties.Settings.Default.prettifyCollectionJson;

            string langKey = languages.FirstOrDefault(x => x.Value == Properties.Settings.Default.language).Key ?? "";
            int    langI   = cbbLanguage.Items.IndexOf(langKey);
            cbbLanguage.SelectedIndex = langI == -1 ? 0 : langI;
        }
        /// <summary>
        /// Loads the given creature collection file.
        /// </summary>
        /// <param name="filePath">File that contains the collection</param>
        /// <param name="keepCurrentCreatures">add the creatures of the loaded file to the current ones</param>
        /// <param name="keepCurrentSelections">don't change the species selection or tab</param>
        /// <returns></returns>
        private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = false, bool keepCurrentSelections = false)
        {
            Species selectedSpecies        = speciesSelector1.SelectedSpecies;
            Species selectedlibrarySpecies = listBoxSpeciesLib.SelectedItem as Species;

            if (!File.Exists(filePath))
            {
                MessageBox.Show($"Save file with name \"{filePath}\" does not exist!", "File not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            List <Creature> oldCreatures = null;

            if (keepCurrentCreatures)
            {
                oldCreatures = creatureCollection.creatures;
            }

            // for the case the collectionfile has no multipliers, keep the current ones
            ServerMultipliers oldMultipliers = creatureCollection.serverMultipliers;

            // Wait until the file is readable
            const int numberOfRetries = 5;
            const int delayOnRetry    = 1000;

            FileStream fileStream = null;

            for (int i = 1; i <= numberOfRetries; ++i)
            {
                try
                {
                    if (Path.GetExtension(filePath).ToLower() == ".xml")
                    {
                        using (fileStream = File.OpenRead(filePath))
                        {
                            // use xml-serializer for old library-format
                            XmlSerializer reader = new XmlSerializer(typeof(oldLibraryFormat.CreatureCollectionOld));
                            var           creatureCollectionOld = (oldLibraryFormat.CreatureCollectionOld)reader.Deserialize(fileStream);

                            List <Mod> mods = null;
                            // first check if additional values are used, and if the according values-file is already available.
                            // if not, abort conversion and first make sure the file is available, e.g. downloaded
                            if (!string.IsNullOrEmpty(creatureCollectionOld.additionalValues))
                            {
                                // usually the old filename is equal to the mod-tag
                                bool   modFound = false;
                                string modTag   = Path.GetFileNameWithoutExtension(creatureCollectionOld.additionalValues).Replace(" ", "").ToLower().Replace("gaiamod", "gaia");
                                foreach (KeyValuePair <string, ModInfo> tmi in Values.V.modsManifest.modsByTag)
                                {
                                    if (tmi.Key.ToLower() == modTag)
                                    {
                                        modFound = true;

                                        MessageBox.Show("The library contains creatures of modded species. For a correct file-conversion the correct mod-values file is needed.\n\n"
                                                        + "If the mod-value file is not loaded, the conversion may assign wrong species to your creatures.\n"
                                                        + "If the mod-value file is not available locally, it will be tried to download it.",
                                                        "Mod values needed", MessageBoxButtons.OK, MessageBoxIcon.Information);

                                        if (Values.V.loadedModsHash != CreatureCollection.CalculateModListHash(new List <Mod>()))
                                        {
                                            LoadStatAndKibbleValues(false); // reset values to default
                                        }
                                        LoadModValueFiles(new List <string> {
                                            tmi.Value.mod.FileName
                                        }, true, true, out mods);
                                        break;
                                    }
                                }
                                if (!modFound &&
                                    MessageBox.Show("The additional-values file in the library you're loading is unknown. You should first get a values-file in the new format for that mod.\n"
                                                    + "If you're loading the library the conversion of some modded species to the new format may fail and the according creatures have to be imported again later.\n\n"
                                                    + "Do you want to load the library and risk losing creatures?", "Unknown mod-file",
                                                    MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes)
                                {
                                    return(false);
                                }
                            }

                            creatureCollection         = oldLibraryFormat.FormatConverter.ConvertXml2Asb(creatureCollectionOld, filePath);
                            creatureCollection.ModList = mods;

                            if (creatureCollection == null)
                            {
                                throw new Exception("Conversion failed");
                            }

                            string fileNameWOExt = Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileNameWithoutExtension(filePath));
                            // check if new fileName is not yet existing
                            filePath = fileNameWOExt + COLLECTION_FILE_EXTENSION;
                            if (File.Exists(filePath))
                            {
                                int fi = 2;
                                while (File.Exists(fileNameWOExt + "_" + fi + COLLECTION_FILE_EXTENSION))
                                {
                                    fi++;
                                }
                                filePath = fileNameWOExt + "_" + fi + COLLECTION_FILE_EXTENSION;
                            }

                            // save converted library
                            SaveCollectionToFileName(filePath);
                        }
                    }
                    else
                    {
                        CreatureCollection tmpCC;
                        using (StreamReader file = File.OpenText(filePath))
                        {
                            JsonSerializer serializer = new JsonSerializer();
                            tmpCC = (CreatureCollection)serializer.Deserialize(file, typeof(CreatureCollection));
                        }
                        if (!Version.TryParse(tmpCC.FormatVersion, out Version ccVersion) ||
                            !Version.TryParse(CreatureCollection.CURRENT_FORMAT_VERSION, out Version currentVersion) ||
                            ccVersion > currentVersion)
                        {
                            throw new FormatException("Unhandled format version");
                        }
                        creatureCollection = tmpCC;
                    }

                    break;
                }
                catch (IOException)
                {
                    // if file is not readable
                    Thread.Sleep(delayOnRetry);
                }
                catch (FormatException)
                {
                    // This FormatVersion is not understood, abort
                    MessageBox.Show($"This library format is unsupported in this version of ARK Smart Breeding." +
                                    "\n\nTry updating to a newer version.",
                                    "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }
                catch (InvalidOperationException e)
                {
                    MessageBox.Show($"The library-file\n{filePath}\ncouldn\'t be opened, we thought you should know.\nErrormessage:\n\n{e.Message}" + (e.InnerException == null ? string.Empty : $"\n\nInnerException:\n\n{e.InnerException.Message}"),
                                    "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }
                finally
                {
                    fileStream?.Close();
                }
            }

            if (creatureCollection.ModValueReloadNeeded)
            {
                // load original multipliers if they were changed
                if (!LoadStatAndKibbleValues(false).statValuesLoaded)
                {
                    creatureCollection = new CreatureCollection();
                    return(false);
                }
            }
            if (creatureCollection.ModValueReloadNeeded &&
                !LoadModValuesOfCollection(creatureCollection, false, false))
            {
                creatureCollection = new CreatureCollection();
                return(false);
            }

            if (creatureCollection.serverMultipliers == null)
            {
                creatureCollection.serverMultipliers = oldMultipliers ?? Values.V.serverMultipliersPresets.GetPreset(ServerMultipliersPresets.OFFICIAL);
            }

            if (speciesSelector1.LastSpecies != null && speciesSelector1.LastSpecies.Length > 0)
            {
                tamingControl1.SetSpecies(Values.V.SpeciesByBlueprint(speciesSelector1.LastSpecies[0]));
            }

            creatureCollection.FormatVersion = CreatureCollection.CURRENT_FORMAT_VERSION;

            ApplySettingsToValues();

            bool creatureWasAdded = false;

            if (keepCurrentCreatures)
            {
                creatureWasAdded = creatureCollection.MergeCreatureList(oldCreatures);
            }
            else
            {
                currentFileName = filePath;
                fileSync.ChangeFile(currentFileName);
                creatureBoxListView.Clear();
            }

            creatureCollection.DeletedCreatureGuids = null; // no longer needed

            InitializeCollection();

            filterListAllowed = false;
            SetLibraryFilter("Dead", creatureCollection.showFlags.HasFlag(CreatureFlags.Dead));
            SetLibraryFilter("Unavailable", creatureCollection.showFlags.HasFlag(CreatureFlags.Unavailable));
            SetLibraryFilter("Neutered", creatureCollection.showFlags.HasFlag(CreatureFlags.Neutered));
            SetLibraryFilter("Obelisk", creatureCollection.showFlags.HasFlag(CreatureFlags.Obelisk));
            SetLibraryFilter("Cryopod", creatureCollection.showFlags.HasFlag(CreatureFlags.Cryopod));
            SetLibraryFilter("Mutated", creatureCollection.showFlags.HasFlag(CreatureFlags.Mutated));
            checkBoxUseFiltersInTopStatCalculation.Checked = creatureCollection.useFiltersInTopStatCalculation;

            SetCollectionChanged(creatureWasAdded); // setCollectionChanged only if there really were creatures added from the old library to the just opened one

            ///// creatures loaded.

            // calculate creature values
            RecalculateAllCreaturesValues();

            if (!keepCurrentSelections && creatureCollection.creatures.Count > 0)
            {
                tabControlMain.SelectedTab = tabPageLibrary;
            }

            creatureBoxListView.maxDomLevel = creatureCollection.maxDomLevel;

            UpdateCreatureListings();

            // set global species that was set before loading
            if (selectedSpecies != null &&
                creatureCollection.creatures.Any(c => c.Species != null && c.Species.Equals(selectedSpecies))
                )
            {
                speciesSelector1.SetSpecies(selectedSpecies);
            }
            else if (creatureCollection.creatures.Any())
            {
                speciesSelector1.SetSpecies(creatureCollection.creatures[0].Species);
            }

            // set library species to what it was before loading
            if (selectedlibrarySpecies == null ||
                !creatureCollection.creatures.Any(c => c.Species != null && c.Species.Equals(selectedlibrarySpecies))
                )
            {
                selectedlibrarySpecies = speciesSelector1.SelectedSpecies;
            }
            if (selectedlibrarySpecies != null)
            {
                listBoxSpeciesLib.SelectedIndex = listBoxSpeciesLib.Items.IndexOf(selectedlibrarySpecies);
            }

            filterListAllowed = true;
            FilterLib();

            // apply last sorting
            listViewLibrary.Sort();

            UpdateTempCreatureDropDown();

            Properties.Settings.Default.LastSaveFile = filePath;
            lastAutoSaveBackup = DateTime.Now.AddMinutes(-10);

            return(true);
        }