From 74dd6012d1656204650a66f76f5db75609d8d00a Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Sun, 11 Sep 2016 18:57:12 -0700 Subject: [PATCH] Hide Tab_Other smarter Hide it if daycare isn't documented. Also, fix drag&drop cursor feedback for non-box slots. Previously, initiating a d&d on a party slot would reset the drag cursor to the default (arrow + square) instead of keeping the sprite-cursor. GiveFeedback -> UseDefaultCursors = false :) --- PKHeX/MainWindow/Main.cs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/PKHeX/MainWindow/Main.cs b/PKHeX/MainWindow/Main.cs index 3233222d7..a8a3f4f83 100644 --- a/PKHeX/MainWindow/Main.cs +++ b/PKHeX/MainWindow/Main.cs @@ -76,7 +76,7 @@ namespace PKHeX new ToolTip().SetToolTip(dragout, "PKM QuickSave"); // Box Drag & Drop - foreach (PictureBox pb in PAN_Box.Controls) + foreach (PictureBox pb in SlotPictureBoxes) { pb.AllowDrop = true; // The PictureBoxes have their own drag&drop event handlers (pbBoxSlot) pb.GiveFeedback += (sender, e) => { e.UseDefaultCursors = false; }; @@ -831,24 +831,29 @@ namespace PKHeX } setPKXBoxes(); // Reload all of the PKX Windows + bool WindowTranslationRequired = false; + // Hide content if not present in game. GB_SUBE.Visible = SAV.HasSUBE; PB_Locked.Visible = SAV.HasBattleBox && SAV.BattleBoxLocked; if (!SAV.HasBox && tabBoxMulti.TabPages.Contains(Tab_Box)) - { tabBoxMulti.TabPages.Remove(Tab_Box); - tabBoxMulti.TabPages.Remove(Tab_Other); - } else if (SAV.HasBox && !tabBoxMulti.TabPages.Contains(Tab_Box)) { tabBoxMulti.TabPages.Insert(0, Tab_Box); - tabBoxMulti.TabPages.Insert(2, Tab_Other); - // force update -- re-added tab may be untranslated - Util.TranslateInterface(this, curlanguage); + WindowTranslationRequired = true; } Menu_LoadBoxes.Enabled = Menu_DumpBoxes.Enabled = Menu_Report.Enabled = Menu_Modify.Enabled = B_SaveBoxBin.Enabled = SAV.HasBox; + if (!SAV.HasDaycare && tabBoxMulti.TabPages.Contains(Tab_Other)) + tabBoxMulti.TabPages.Remove(Tab_Other); + else if (SAV.HasDaycare && !tabBoxMulti.TabPages.Contains(Tab_Other)) + { + tabBoxMulti.TabPages.Insert(tabBoxMulti.TabPages.IndexOf(Tab_PartyBattle) + 1, Tab_Other); + WindowTranslationRequired = true; + } + if (path != null) // Actual save file { PAN_BattleBox.Visible = L_BattleBox.Visible = L_ReadOnlyPBB.Visible = SAV.HasBattleBox; @@ -1028,8 +1033,7 @@ namespace PKHeX else if (SAV.Generation != 1 && !tabMain.TabPages.Contains(Tab_Met)) { tabMain.TabPages.Insert(1, Tab_Met); - // force update -- re-added tab may be untranslated - Util.TranslateInterface(this, curlanguage); + WindowTranslationRequired = true; } // Common HaX Interface @@ -1052,6 +1056,9 @@ namespace PKHeX // Refresh PK#->PK6 conversion info PKMConverter.updateConfig(SAV.SubRegion, SAV.Country, SAV.ConsoleRegion, SAV.OT, SAV.Gender); + if (WindowTranslationRequired) // force update -- re-added controls may be untranslated + Util.TranslateInterface(this, curlanguage); + // Indicate audibly the save is loaded SystemSounds.Beep.Play(); }