mod-transmog icon indicating copy to clipboard operation
mod-transmog copied to clipboard

Suggestion: Sort unlocked transmogs by name or quality (or both)

Open atrapalis opened this issue 2 years ago • 1 comments

Unlocked transmogs seem to be listed in a random/not predictable order in the gossip window. It would be nice to have items ordered in a predictable order, e.g. by name.

I have found a way to do this in code by changing the query in

transmog_scripts.cpp:

void OnAfterConfigLoad(bool reload) override
{
...
            QueryResult result = CharacterDatabase.Query("SELECT custom_unlocked_appearances.account_id, custom_unlocked_appearances.item_template_id, acore_world.item_template.name, acore_world.item_template.Quality FROM custom_unlocked_appearances INNER JOIN acore_world.item_template ON custom_unlocked_appearances.item_template_id=acore_world.item_template.entry ORDER BY acore_world.item_template.Quality DESC, acore_world.item_template.name ASC;");
...
}

This query would order transmogs by item quality first, and by item name second.

You would also have to remove the following std::sort call in

Transmogrification.cpp

bool Transmogrification::AddCollectedAppearance(uint32 accountId, uint32 itemId)
{
...
        std::sort(collectionCache[accountId].begin(), collectionCache[accountId].end());
...
}

This approach has some quirks (e.g. newly unlocked items are not ordered in the same way until a server restart) but I believe it makes it much easier to search through unlocked items.

atrapalis avatar Sep 20 '23 18:09 atrapalis

Hey, thanks for the suggestion, you could make a Pull Request to propose a change

Helias avatar Sep 20 '23 19:09 Helias