1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 07:15:34 +00:00

Sort quests in journal by name (bug 7054)

This commit is contained in:
Andrei Kortunov 2023-01-06 22:13:03 +04:00
parent c9d57788fb
commit 9630246cae
4 changed files with 11 additions and 0 deletions

View file

@ -28,6 +28,7 @@
Bug #7034: Misc items defined in one content file are not treated as keys if another content file uses them as such
Bug #7042: Weapon follow animations that immediately follow the hit animations cause multiple hits
Bug #7044: Changing a class' services does not affect autocalculated NPCs
Bug #7054: Quests aren't sorted by name
Bug #7084: Resurrecting an actor doesn't take into account base record changes
Bug #7088: Deleting last save game of last character doesn't clear character name/details
Feature #6447: Add LOD support to Object Paging

View file

@ -558,6 +558,7 @@ namespace
mModel->visitQuestNames(!mAllQuests, add);
list->sort();
list->adjustSize();
if (mAllQuests)

View file

@ -4,6 +4,8 @@
#include <MyGUI_Gui.h>
#include <MyGUI_ImageBox.h>
#include <components/misc/strings/algorithm.hpp>
namespace Gui
{
@ -124,6 +126,12 @@ namespace Gui
return mItems[at];
}
void MWList::sort()
{
// A special case for separators is not needed for now
std::sort(mItems.begin(), mItems.end(), Misc::StringUtils::ciLess);
}
void MWList::removeItem(const std::string& name)
{
assert(std::find(mItems.begin(), mItems.end(), name) != mItems.end());

View file

@ -35,6 +35,7 @@ namespace Gui
*/
void adjustSize();
void sort();
void addItem(std::string_view name);
void addSeparator(); ///< add a seperator between the current and the next item.
void removeItem(const std::string& name);