Skip to content

Commit

Permalink
Category editor preserves index, if possible, when switching categories.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrohrer committed Jul 3, 2020
1 parent 770e56e commit c6cf7a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions documentation/changeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Version 346 ???

--Object editor preserves use vanish when inserting an object.

--Category editor preserves index, if possible, when switching categories.



Server Fixes
Expand Down
13 changes: 12 additions & 1 deletion gameSource/EditorCategoryPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,18 @@ void EditorCategoryPage::actionPerformed( GUIComponent *inTarget ) {
}
else {
mCurrentCategory = parentID;
mSelectionIndex = 0;

if( mCurrentCategory != -1 ) {
int newMax =
getCategory( mCurrentCategory )->objectIDSet.size() - 1;

if( newMax < mSelectionIndex ) {
mSelectionIndex = 0;
}
}
else {
mSelectionIndex = 0;
}
}
updateCheckbox();
}
Expand Down

0 comments on commit c6cf7a9

Please sign in to comment.