Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Sep 9, 2024
2 parents b77c803 + 798aba1 commit b3e6e17
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ARKBreedingStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.63.1.0")]
[assembly: AssemblyFileVersion("0.63.1.1")]
[assembly: NeutralResourcesLanguage("en")]

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ private void ResetCurrentSettingsToDefault(object sender, EventArgs e)
SelectedStatsOptions.StatOptions[si] = new StatLevelColors
{
LevelGraphRepresentation = LevelGraphRepresentation.GetDefaultValue,
LevelGraphRepresentationMutation = LevelGraphRepresentation.GetDefaultMutationLevelValue
LevelGraphRepresentationMutation = LevelGraphRepresentation.GetDefaultMutationLevelValue,
UseDifferentColorsForMutationLevels = true
};
_statOptionsControls[si].SetStatOptions(SelectedStatsOptions.StatOptions[si], isNotRoot, SelectedStatsOptions.ParentOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private LevelGraphRepresentation GetLevelGraphRepresentation(int level, bool use
&& level % 2 == 1)
return LevelGraphRepresentationOdd;

return LevelGraphRepresentation;
return LevelGraphRepresentation ?? LevelGraphRepresentation.GetDefaultValue;
}

public Color GetLevelColor(int level, bool useCustomOdd = true, bool mutationLevel = false)
Expand Down Expand Up @@ -85,9 +85,9 @@ public override void Initialize()
/// <summary>
/// Call before saving. Sets unused settings to null.
/// </summary>
public override void PrepareForSaving()
public override void PrepareForSaving(bool isRoot)
{
if (!OverrideParent)
if (!OverrideParent && !isRoot)
{
LevelGraphRepresentation = null;
LevelGraphRepresentationOdd = null;
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/StatsOptions/StatOptionsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public abstract class StatOptionsBase
{
public abstract void Initialize();

public abstract void PrepareForSaving();
public abstract void PrepareForSaving(bool isRoot);

/// <summary>
/// If true don't use values of parent but overrides of this object.
Expand Down
4 changes: 2 additions & 2 deletions ARKBreedingStats/StatsOptions/StatsOptionsSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void SaveSettings()
o.ParentName = null; // don't save direct loop
foreach (var so in o.StatOptions)
{
so.PrepareForSaving();
so.PrepareForSaving(string.IsNullOrEmpty(o.Name));
}
}

Expand Down Expand Up @@ -171,7 +171,7 @@ public StatsOptions<T> GetStatsOptions(Species species)
}
else
{
// error, on default settings available
// error, no default settings available
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public override void Initialize()
OverrideParent = OverrideParentBool;
}

public override void PrepareForSaving()
public override void PrepareForSaving(bool isRoot)
{
OverrideParentBool = OverrideParent;
OverrideParentBool = OverrideParent || isRoot;
}

public override bool DefinesData() => true;
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ARK Smart Breeding": {
"Id": "ARK Smart Breeding",
"Category": "main",
"version": "0.63.1.0"
"version": "0.63.1.1"
},
"SpeciesColorImages": {
"Id": "SpeciesColorImages",
Expand Down

0 comments on commit b3e6e17

Please sign in to comment.