Skip to content

Commit

Permalink
option to set hues for even/odd chart setting
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Oct 17, 2021
1 parent 1fbac78 commit bbca3fa
Show file tree
Hide file tree
Showing 8 changed files with 369 additions and 28 deletions.
18 changes: 18 additions & 0 deletions ARKBreedingStats/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,24 @@
<setting name="InfoGraphicShowRegionNamesIfNoImage" serializeAs="String">
<value>False</value>
</setting>
<setting name="ChartHueMin" serializeAs="String">
<value>0</value>
</setting>
<setting name="ChartHueMax" serializeAs="String">
<value>120</value>
</setting>
<setting name="ChartHueEvenMin" serializeAs="String">
<value>120</value>
</setting>
<setting name="ChartHueEvenMax" serializeAs="String">
<value>200</value>
</setting>
<setting name="ChartHueOddMin" serializeAs="String">
<value>240</value>
</setting>
<setting name="ChartHueOddMax" serializeAs="String">
<value>320</value>
</setting>
</ARKBreedingStats.Properties.Settings>
</userSettings>
</configuration>
17 changes: 16 additions & 1 deletion ARKBreedingStats/Pedigree/PedigreeCreature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ public Creature Creature
}

_tt.SetToolTip(labelSex, "Sex: " + Loc.S(_creature.sex.ToString()));
var minChartLevel = CreatureCollection.CurrentCreatureCollection?.minChartLevel ?? 0;
var maxChartLevel = CreatureCollection.CurrentCreatureCollection?.maxChartLevel ?? 50;
var chartLevelRange = maxChartLevel - minChartLevel;
var hueRangeEven = Properties.Settings.Default.ChartHueEvenMax - Properties.Settings.Default.ChartHueEvenMin;
var hueRangeOdd = Properties.Settings.Default.ChartHueOddMax - Properties.Settings.Default.ChartHueOddMin;
for (int s = 0; s < DisplayedStatsCount; s++)
{
int si = DisplayedStats[s];
Expand Down Expand Up @@ -179,7 +184,17 @@ public Creature Creature
_labels[s].BackColor = Utils.AdjustColorLight(_creature.levelsWild[si] == 254 ? Utils.Level254 : Utils.Level255, _creature.topBreedingStats[si] ? 0.2 : 0.7);
else if (Properties.Settings.Default.HighlightEvenOdd)
{
_labels[s].BackColor = Utils.ColorFromHue((_creature.levelsWild[si] % 2 == 0 ? 120 : 240) + Math.Min(_creature.levelsWild[si], 48), _creature.topBreedingStats[si] ? 0.4 : 0.7);
var levelForColor = Math.Min(maxChartLevel, Math.Max(minChartLevel, _creature.levelsWild[si]));
int hue;
if (_creature.levelsWild[si] % 2 == 0)
{
hue = Properties.Settings.Default.ChartHueEvenMin + levelForColor * hueRangeEven / chartLevelRange;
}
else
{
hue = Properties.Settings.Default.ChartHueOddMin + levelForColor * hueRangeOdd / chartLevelRange;
}
_labels[s].BackColor = Utils.ColorFromHue(hue, _creature.topBreedingStats[si] ? 0.4 : 0.7);
}
else
_labels[s].BackColor = Utils.GetColorFromPercent((int)(_creature.levelsWild[si] * 2.5), _creature.topBreedingStats[si] ? 0.2 : 0.7);
Expand Down
72 changes: 72 additions & 0 deletions ARKBreedingStats/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions ARKBreedingStats/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -464,5 +464,23 @@
<Setting Name="InfoGraphicShowRegionNamesIfNoImage" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ChartHueMin" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="ChartHueMax" Type="System.Int32" Scope="User">
<Value Profile="(Default)">120</Value>
</Setting>
<Setting Name="ChartHueEvenMin" Type="System.Int32" Scope="User">
<Value Profile="(Default)">120</Value>
</Setting>
<Setting Name="ChartHueEvenMax" Type="System.Int32" Scope="User">
<Value Profile="(Default)">200</Value>
</Setting>
<Setting Name="ChartHueOddMin" Type="System.Int32" Scope="User">
<Value Profile="(Default)">240</Value>
</Setting>
<Setting Name="ChartHueOddMax" Type="System.Int32" Scope="User">
<Value Profile="(Default)">320</Value>
</Setting>
</Settings>
</SettingsFile>
2 changes: 2 additions & 0 deletions ARKBreedingStats/library/CreatureCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public CreatureCollection()
[JsonProperty]
public int maxWildLevel = 150;
[JsonProperty]
public int minChartLevel;
[JsonProperty]
public int maxChartLevel = 50;
[JsonProperty]
public int maxBreedingSuggestions = 10;
Expand Down
Loading

0 comments on commit bbca3fa

Please sign in to comment.