From 0803920486ff62cccd79374b9b68084b880f010c Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 21 Jan 2021 19:20:24 +0100 Subject: Add method to retrieve priority of mods in ModList. --- src/modlist.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/modlist.h') diff --git a/src/modlist.h b/src/modlist.h index 242d185f..68316613 100644 --- a/src/modlist.h +++ b/src/modlist.h @@ -335,6 +335,21 @@ signals: private: + // the priority of backups and overwrite for sorting (and display, although + // those are not displayed), these do not correspond to the actual priority + // in the mod list + // + static constexpr int BACKUP_PRIORITY = -1; + static constexpr int OVERWRITE_PRIORITY = std::numeric_limits::max(); + + // retrieve the priority of a mod for the purpose of display (i.e. sorting + // or grouping) + // + // this can be different from the priority in the profile (e.g. for backups + // or overwrite) + // + int modPriority(unsigned int index) const; + // retrieve the display name of a mod or convert from a user-provided // name to internal name // @@ -361,13 +376,6 @@ private: private: - // the priority of backups and overwrite for sorting (and display, although - // those are not displayed), these do not correspond to the actual priority - // in the mod list - // - static constexpr int BACKUP_PRIORITY = -1; - static constexpr int OVERWRITE_PRIORITY = std::numeric_limits::max(); - struct TModInfo { TModInfo(unsigned int index, ModInfo::Ptr modInfo) : modInfo(modInfo), nameOrder(index), priorityOrder(0), modIDOrder(0), categoryOrder(0) {} -- cgit v1.3.1