Skip to content

Commit

Permalink
fixed layout issue on taming-tab with taming-foods (#863). added serv…
Browse files Browse the repository at this point in the history
…er-filter for breeding-planner (#852, #823, #866).
  • Loading branch information
cadaei committed Jan 8, 2019
1 parent 36a7fd4 commit a1d53cd
Show file tree
Hide file tree
Showing 11 changed files with 409 additions and 242 deletions.
3 changes: 3 additions & 0 deletions ARKBreedingStats/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@
<setting name="ImportTribeNameFilter" serializeAs="String">
<value />
</setting>
<setting name="UseServerFilterForBreedingPlan" serializeAs="String">
<value>False</value>
</setting>
</ARKBreedingStats.Properties.Settings>
</userSettings>
</configuration>
46 changes: 30 additions & 16 deletions ARKBreedingStats/BreedingPlan.Designer.cs

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

17 changes: 17 additions & 0 deletions ARKBreedingStats/BreedingPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public BreedingPlan()
breedingPlanNeedsUpdate = false;
dontUpdateBreedingPlan = false;

cbServerFilterLibrary.Checked = Properties.Settings.Default.UseServerFilterForBreedingPlan;

tagSelectorList1.OnTagChanged += TagSelectorList1_OnTagChanged;
}

Expand Down Expand Up @@ -209,6 +211,15 @@ private void AsyncCalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMo
chosenM = new List<Creature>();
else chosenM = filterByTags(males);

// filter by servers
if (cbServerFilterLibrary.Checked)
{
chosenF = chosenF.Where(c => (c.server == "" && !creatureCollection.hiddenServers.Contains("n/a"))
|| (c.server != "" && !creatureCollection.hiddenServers.Contains(c.server))).ToList();
chosenM = chosenM.Where(c => (c.server == "" && !creatureCollection.hiddenServers.Contains("n/a"))
|| (c.server != "" && !creatureCollection.hiddenServers.Contains(c.server))).ToList();
}

bool creaturesTagFilteredOut = (crCountF != chosenF.Count)
|| (crCountM != chosenM.Count);

Expand Down Expand Up @@ -951,5 +962,11 @@ public void SetLocalizations()
Loc.setToolTip(nudBPMutationLimit, tt);
Loc.setToolTip(cbBPTagExcludeDefault, tt);
}

private void cbServerFilterLibrary_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.UseServerFilterForBreedingPlan = cbServerFilterLibrary.Checked;
calculateBreedingScoresAndDisplayPairs();
}
}
}
10 changes: 9 additions & 1 deletion ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2651,9 +2651,15 @@ private void cbServerFilterAll_CheckedChanged(object sender, EventArgs e)
for (int i = 0; i < checkedListBoxFilterServers.Items.Count; i++)
{
checkedListBoxFilterServers.SetItemChecked(i, chck);
if (!chck) creatureCollection.hiddenServers.Add(checkedListBoxFilterServers.Items[i].ToString());
if (!chck)
{
string server = Regex.Match(checkedListBoxFilterServers.Items[i].ToString(), @"^(.+?)(?: \(\d+\))?$").Groups[1].Value;
creatureCollection.hiddenServers.Add(server);
}
}

breedingPlan1.breedingPlanNeedsUpdate = true; // needed for serverFilterOption

filterListAllowed = true;
filterLib();
}
Expand Down Expand Up @@ -2695,6 +2701,8 @@ private void checkedListBoxFilterServers_ItemCheck(object sender, ItemCheckEvent
creatureCollection.hiddenServers.Remove(server);
}

breedingPlan1.breedingPlanNeedsUpdate = true; // needed for serverFilterOption

recalculateTopStatsIfNeeded();
filterLib();
}
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.29.3.3")]
[assembly: AssemblyFileVersion("0.29.4.0")]
[assembly: NeutralResourcesLanguage("en")]

12 changes: 12 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.

3 changes: 3 additions & 0 deletions ARKBreedingStats/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,8 @@
<Setting Name="ImportTribeNameFilter" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="UseServerFilterForBreedingPlan" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
Loading

0 comments on commit a1d53cd

Please sign in to comment.