mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-26 12:56:42 -05:00
performance tweak
only do the flicker hack if the combobox is actually visible delay form appearing until initial files are loaded
This commit is contained in:
@@ -176,7 +176,6 @@ public Main()
|
||||
CB_MainLanguage.SelectedIndex = languageID;
|
||||
|
||||
InitializeFields();
|
||||
formInitialized = true;
|
||||
|
||||
#endregion
|
||||
#region Load Initial File(s)
|
||||
@@ -220,7 +219,7 @@ public Main()
|
||||
if (pkmArg != null)
|
||||
openQuick(pkmArg, force: true);
|
||||
|
||||
// Splash Screen closes on its own.
|
||||
formInitialized = true; // Splash Screen closes on its own.
|
||||
BringToFront();
|
||||
WindowState = FormWindowState.Minimized;
|
||||
Show();
|
||||
@@ -3038,13 +3037,14 @@ private void updateLegality(LegalityAnalysis la = null, bool skipMoveRepop = fal
|
||||
fieldsLoaded = false;
|
||||
var cb = new[] {CB_Move1, CB_Move2, CB_Move3, CB_Move4};
|
||||
var moves = Legality.AllSuggestedMovesAndRelearn;
|
||||
var moveList = GameInfo.MoveDataSource.OrderByDescending(m => moves.Contains(m.Value)).ToList();
|
||||
var moveList = GameInfo.MoveDataSource.OrderByDescending(m => moves.Contains(m.Value)).ToArray();
|
||||
foreach (ComboBox c in cb)
|
||||
{
|
||||
var index = WinFormsUtil.getIndex(c);
|
||||
c.DataSource = new BindingSource(moveList, null);
|
||||
c.SelectedValue = index;
|
||||
c.SelectionLength = 0; // flicker hack
|
||||
if (c.Visible)
|
||||
c.SelectionLength = 0; // flicker hack
|
||||
}
|
||||
fieldsLoaded |= tmp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user