mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 08:47:14 +00:00
Simplify egg location set on version change
This commit is contained in:
parent
29579d7b22
commit
5374ca1db6
1 changed files with 6 additions and 2 deletions
|
@ -1248,7 +1248,7 @@ namespace PKHeX.WinForms.Controls
|
||||||
CB_EggLocation.DataSource = new BindingSource(eggList, null);
|
CB_EggLocation.DataSource = new BindingSource(eggList, null);
|
||||||
CB_EggLocation.DropDownWidth = GetWidth(eggList, CB_EggLocation.Font);
|
CB_EggLocation.DropDownWidth = GetWidth(eggList, CB_EggLocation.Font);
|
||||||
|
|
||||||
int GetWidth(IEnumerable<ComboItem> items, Font f) =>
|
static int GetWidth(IEnumerable<ComboItem> items, Font f) =>
|
||||||
items.Max(z => TextRenderer.MeasureText(z.Text, f).Width) +
|
items.Max(z => TextRenderer.MeasureText(z.Text, f).Width) +
|
||||||
SystemInformation.VerticalScrollBarWidth;
|
SystemInformation.VerticalScrollBarWidth;
|
||||||
|
|
||||||
|
@ -1256,8 +1256,12 @@ namespace PKHeX.WinForms.Controls
|
||||||
{
|
{
|
||||||
SetMarkings(); // Set/Remove the Nativity marking when gamegroup changes too
|
SetMarkings(); // Set/Remove the Nativity marking when gamegroup changes too
|
||||||
int metLoc = EncounterSuggestion.GetSuggestedTransferLocation(Entity);
|
int metLoc = EncounterSuggestion.GetSuggestedTransferLocation(Entity);
|
||||||
|
int eggLoc = CHK_AsEgg.Checked
|
||||||
|
? EncounterSuggestion.GetSuggestedEncounterEggLocationEgg(format, version)
|
||||||
|
: Locations.GetNoneLocation(version);
|
||||||
|
|
||||||
CB_MetLocation.SelectedValue = Math.Max(0, metLoc);
|
CB_MetLocation.SelectedValue = Math.Max(0, metLoc);
|
||||||
CB_EggLocation.SelectedIndex = CHK_AsEgg.Checked ? 1 : 0; // daycare : none
|
CB_EggLocation.SelectedValue = eggLoc;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue