diff --git a/CHANGELOG.md b/CHANGELOG.md index 551a7d9aa6..c6abd88bb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/apps/openmw/mwgui/journalwindow.cpp b/apps/openmw/mwgui/journalwindow.cpp index 21cf30b556..1319379e60 100644 --- a/apps/openmw/mwgui/journalwindow.cpp +++ b/apps/openmw/mwgui/journalwindow.cpp @@ -558,6 +558,7 @@ namespace mModel->visitQuestNames(!mAllQuests, add); + list->sort(); list->adjustSize(); if (mAllQuests) diff --git a/components/widgets/list.cpp b/components/widgets/list.cpp index 92cf237875..de1c160288 100644 --- a/components/widgets/list.cpp +++ b/components/widgets/list.cpp @@ -4,6 +4,8 @@ #include #include +#include + 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()); diff --git a/components/widgets/list.hpp b/components/widgets/list.hpp index a0df792696..b9e397f1a8 100644 --- a/components/widgets/list.hpp +++ b/components/widgets/list.hpp @@ -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);