diff --git a/ARKBreedingStats/Form1.collection.cs b/ARKBreedingStats/Form1.collection.cs index 751a6125..508e29d8 100644 --- a/ARKBreedingStats/Form1.collection.cs +++ b/ARKBreedingStats/Form1.collection.cs @@ -51,31 +51,36 @@ private void NewCollection(bool resetCollection = false) } } - // use previously used multipliers again in the new file - var oldMultipliers = _creatureCollection.serverMultipliers; - var asaMode = _creatureCollection.Game == Ark.Asa; + ServerMultipliers oldMultipliers = null; + ServerMultipliers oldEventMultipliers = null; + bool asaMode; - if (!Properties.Settings.Default.KeepMultipliersForNewLibrary) + if (Properties.Settings.Default.KeepMultipliersForNewLibrary) { - oldMultipliers = null; // use default + // use previously used multipliers again in the new file + oldMultipliers = _creatureCollection.serverMultipliers; + oldEventMultipliers = _creatureCollection.serverMultipliersEvents; } // ask which game version if no default is set switch (Properties.Settings.Default.NewLibraryGame) { - case Ark.Game.Unknown: - var gameVersionDialog = new ArkVersionDialog(this); - gameVersionDialog.ShowDialog(); - if (gameVersionDialog.UseSelectionAsDefault) - Properties.Settings.Default.NewLibraryGame = gameVersionDialog.GameVersion; - asaMode = gameVersionDialog.GameVersion == Ark.Game.Asa; - break; case Ark.Game.Ase: asaMode = false; break; case Ark.Game.Asa: asaMode = true; break; + case Ark.Game.SameAsBefore: + asaMode = _creatureCollection.Game == Ark.Asa; + break; + default: + var gameVersionDialog = new ArkVersionDialog(this); + gameVersionDialog.ShowDialog(); + if (gameVersionDialog.UseSelectionAsDefault) + Properties.Settings.Default.NewLibraryGame = gameVersionDialog.GameVersion; + asaMode = gameVersionDialog.GameVersion == Ark.Game.Asa; + break; } if (oldMultipliers == null) @@ -84,6 +89,7 @@ private void NewCollection(bool resetCollection = false) _creatureCollection = new CreatureCollection { serverMultipliers = oldMultipliers, + serverMultipliersEvents = oldEventMultipliers, ModList = new List() }; _currentFileName = null; diff --git a/ARKBreedingStats/library/CreatureCollection.cs b/ARKBreedingStats/library/CreatureCollection.cs index 3c3187c6..34081e94 100644 --- a/ARKBreedingStats/library/CreatureCollection.cs +++ b/ARKBreedingStats/library/CreatureCollection.cs @@ -14,11 +14,6 @@ public class CreatureCollection { public const string CurrentLibraryFormatVersion = "1.13"; - public CreatureCollection() - { - FormatVersion = CurrentLibraryFormatVersion; - } - public const int MaxDomLevelDefault = 88; public const int MaxDomLevelSinglePlayerDefault = 88; @@ -28,7 +23,7 @@ public CreatureCollection() [JsonIgnore] public static CreatureCollection CurrentCreatureCollection; [JsonProperty] - public string FormatVersion; + public string FormatVersion = CurrentLibraryFormatVersion; [JsonProperty] public List creatures = new List(); [JsonProperty] @@ -65,12 +60,12 @@ public CreatureCollection() [JsonProperty] public ServerMultipliers serverMultipliers; [JsonProperty] - public ServerMultipliers serverMultipliersEvents; // this object's statMultipliers are not used + public ServerMultipliers serverMultipliersEvents; // only the taming and breeding multipliers of this are used /// /// Deprecated setting, remove on 2025-01-01 /// - [JsonProperty] + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool singlePlayerSettings; /// diff --git a/ARKBreedingStats/settings/Settings.cs b/ARKBreedingStats/settings/Settings.cs index 9c12c6f0..33a9558e 100644 --- a/ARKBreedingStats/settings/Settings.cs +++ b/ARKBreedingStats/settings/Settings.cs @@ -1157,6 +1157,8 @@ private void ApplyMultiplierPreset(ServerMultipliers sm, bool onlyStatMultiplier CbAllowSpeedLeveling.Checked = sm.AllowSpeedLeveling; CbAllowFlyerSpeedLeveling.Checked = sm.AllowFlyerSpeedLeveling; + cbSingleplayerSettings.Checked = sm.SinglePlayerSettings; + CbAtlasSettings.Checked = sm.AtlasSettings; } if (sm.statMultipliers == null) return; @@ -1731,6 +1733,7 @@ private void BtAutoImportLocalSettings_Click(object sender, EventArgs e) "Select one of the configs to import.", "Auto import configs", 40); if (importIndex == -1) return; + CbAtlasSettings.Checked = false; ExtractSettingsFromFile(Path.Combine(localConfigPaths[importIndex].Item1, "game.ini"), true); ExtractSettingsFromFile(Path.Combine(localConfigPaths[importIndex].Item1, "gameUserSettings.ini"), true); diff --git a/ARKBreedingStats/values/Values.cs b/ARKBreedingStats/values/Values.cs index ef8b58ca..3735e56f 100644 --- a/ARKBreedingStats/values/Values.cs +++ b/ARKBreedingStats/values/Values.cs @@ -468,8 +468,8 @@ private void OrderSpeciesAndApplyCustomVariants() /// public void ApplyMultipliers(CreatureCollection cc, bool eventMultipliers = false, bool applyStatMultipliers = true) { - currentServerMultipliers = (eventMultipliers ? cc.serverMultipliersEvents : cc.serverMultipliers)?.Copy(false); - if (currentServerMultipliers == null) currentServerMultipliers = V.serverMultipliersPresets.GetPreset(ServerMultipliersPresets.Official); + currentServerMultipliers = (eventMultipliers ? cc.serverMultipliersEvents : cc.serverMultipliers)?.Copy(false) + ?? V.serverMultipliersPresets.GetPreset(ServerMultipliersPresets.Official); if (currentServerMultipliers == null) { throw new FileNotFoundException("No default server multiplier values found.\nIt's recommend to redownload ARK Smart Breeding.");