mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Properly move items in the map rotation list
This commit is contained in:
parent
afb08e0ea9
commit
edb52a8448
1 changed files with 4 additions and 4 deletions
|
@ -421,10 +421,10 @@ void UIRotationMoveItemUpButton::Released(Event *ev)
|
|||
list = static_cast<UIListBox *>(uWinMan.FindWidget("Rotation List"));
|
||||
item = list->getCurrentItem();
|
||||
|
||||
if (item < list->getNumItems() && list->getNumItems() > 1) {
|
||||
str text = list->getItemText(item + 1);
|
||||
if (item > 1 && list->getNumItems() > 1) {
|
||||
str text = list->getItemText(item - 1);
|
||||
|
||||
list->DeleteItem(list->getCurrentItem() - 1);
|
||||
list->DeleteItem(item - 1);
|
||||
list->InsertItem(text, item);
|
||||
list->setCurrentItem(item - 1);
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ void UIRotationMoveItemDownButton::Released(Event *ev)
|
|||
if (item < list->getNumItems() && list->getNumItems() > 1) {
|
||||
str text = list->getItemText(item + 1);
|
||||
|
||||
list->DeleteItem(list->getCurrentItem() + 1);
|
||||
list->DeleteItem(item + 1);
|
||||
list->InsertItem(text, item);
|
||||
list->setCurrentItem(item + 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue