From 7d2ec43c8d0bc3fc433d740a42b9dc29840c1dfd Mon Sep 17 00:00:00 2001 From: AdAstra-LD Date: Fri, 29 Jan 2021 17:31:46 +0100 Subject: [PATCH] minor fixes --- DS_Map/Graphics/Program Icons/addIcon.png | Bin 233 -> 265 bytes DS_Map/Graphics/Program Icons/deleteIcon.png | Bin 169 -> 177 bytes DS_Map/Main Window.cs | 29 ++++++++++--------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/DS_Map/Graphics/Program Icons/addIcon.png b/DS_Map/Graphics/Program Icons/addIcon.png index 66ee59cfef7068f7e627e8a72ef80c2755aa9f8b..74aa94bdfd74228734d0a276f5f76e0a2551ae80 100644 GIT binary patch delta 200 zcmV;(05|{X0f_>TNq@os01m3B*4fpMeZM%#sI+B(S-)!WfmX-j0r3NXhDGNf4D+Y!BrM&gaO10 zSO72)5#;?ei8H{lP1_l8BCp`F_j|Tbx0000AyAuKa@)vxXSR6 n3SmI87bp(I(WFeN0SpWP4dV`JXQ9;)00000NkvXXu0mjfJWd+y delta 73 zcmdnUxRP;#C*NTP2EN0L$MaXDFfcIKO$=8usMeURbD&~^ 0) { - disableHandlers = true; - - /* Remove overworld object from list and the corresponding entry in the ListBox */ - int owNumber = overworldsListBox.SelectedIndex; - currentEventFile.overworlds.RemoveAt(owNumber); - overworldsListBox.Items.RemoveAt(owNumber); - - FillOverworldsBox(); // Update ListBox - disableHandlers = false; - - if (owNumber > 0) - overworldsListBox.SelectedIndex = owNumber - 1; + if (overworldsListBox.SelectedIndex < 0) { + return; } + + disableHandlers = true; + + /* Remove overworld object from list and the corresponding entry in the ListBox */ + int owNumber = overworldsListBox.SelectedIndex; + currentEventFile.overworlds.RemoveAt(owNumber); + overworldsListBox.Items.RemoveAt(owNumber); + + FillOverworldsBox(); // Update ListBox + disableHandlers = false; + + if (owNumber > 0) + overworldsListBox.SelectedIndex = owNumber - 1; + } #endregion