summaryrefslogtreecommitdiff
path: root/src/modinfo.h
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2015-03-09 12:34:34 +0100
committerTannin <devnull@localhost>2015-03-09 12:34:34 +0100
commit7a1ae9b0f1560c9eda32e032796fbb3fd56ff236 (patch)
treedea71435ac1042cb008fcd9f7b1ec57e6ea91227 /src/modinfo.h
parentd45ebf134819e1559718681becca9c4139fb7151 (diff)
parentdb2954e8eb41da715b9e7d79a72e225797401413 (diff)
Merge with branch1.2
Diffstat (limited to 'src/modinfo.h')
-rw-r--r--src/modinfo.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/modinfo.h b/src/modinfo.h
index 4534841d..33e6ec96 100644
--- a/src/modinfo.h
+++ b/src/modinfo.h
@@ -72,6 +72,7 @@ public:
CONTENT_PLUGIN,
CONTENT_TEXTURE,
CONTENT_MESH,
+ CONTENT_BSA,
CONTENT_INTERFACE,
CONTENT_MUSIC,
CONTENT_SOUND,
@@ -81,6 +82,8 @@ public:
CONTENT_STRING
};
+ static const int NUM_CONTENT_TYPES = CONTENT_STRING + 1;
+
enum EHighlight {
HIGHLIGHT_NONE = 0,
HIGHLIGHT_INVALID = 1,
@@ -182,6 +185,13 @@ public:
*/
static ModInfo::Ptr createFromPlugin(const QString &espName, const QStringList &bsaNames, MOShared::DirectoryEntry **directoryStructure);
+ /**
+ * @brief retieve a name for one of the CONTENT_ enums
+ * @param contentType the content value
+ * @return a display string
+ */
+ static QString getContentTypeName(int contentType);
+
virtual bool isRegular() const { return false; }
virtual bool isEmpty() const { return false; }
@@ -328,6 +338,13 @@ public:
virtual QString name() const = 0;
/**
+ * @brief getter for an internal name. This is usually the same as the regular name, but with special mod types it might be
+ * this is used to distinguish between mods that have the same visible name
+ * @return internal mod name
+ */
+ virtual QString internalName() const { return name(); }
+
+ /**
* @brief getter for the mod path
*
* @return the (absolute) path to the mod
@@ -410,6 +427,13 @@ public:
bool hasFlag(EFlag flag) const;
/**
+ * @brief test if the mods contains the specified content
+ * @param content the content to test
+ * @return true if the content is there, false otherwise
+ */
+ bool hasContent(ModInfo::EContent content) const;
+
+ /**
* @return an indicator if and how this mod should be highlighted by the UI
*/
virtual int getHighlight() const { return HIGHLIGHT_NONE; }
@@ -513,6 +537,21 @@ public:
*/
virtual void saveMeta() {}
+ /**
+ * @return retrieve list of mods (as mod index) that are overwritten by this one. Updates may be delayed
+ */
+ virtual std::set<unsigned int> getModOverwrite() { return std::set<unsigned int>(); }
+
+ /**
+ * @return list of mods (as mod index) that overwrite this one. Updates may be delayed
+ */
+ virtual std::set<unsigned int> getModOverwritten() { return std::set<unsigned int>(); }
+
+ /**
+ * @brief update conflict information
+ */
+ virtual void doConflictCheck() const {}
+
signals:
/**
@@ -566,6 +605,13 @@ public:
* @brief clear all caches held for this mod
*/
virtual void clearCaches();
+
+ virtual std::set<unsigned int> getModOverwrite() { return m_OverwriteList; }
+
+ virtual std::set<unsigned int> getModOverwritten() { return m_OverwrittenList; }
+
+ virtual void doConflictCheck() const;
+
private:
enum EConflictType {
@@ -595,6 +641,9 @@ private:
mutable EConflictType m_CurrentConflictState;
mutable QTime m_LastConflictCheck;
+ mutable std::set<unsigned int> m_OverwriteList; // indices of mods overritten by this mod
+ mutable std::set<unsigned int> m_OverwrittenList; // indices of mods overwriting this mod
+
};
@@ -918,6 +967,9 @@ private:
NexusBridge m_NexusBridge;
+ mutable std::vector<ModInfo::EContent> m_CachedContent;
+ mutable QTime m_LastContentCheck;
+
};
@@ -1039,6 +1091,7 @@ public:
virtual void endorse(bool) {}
virtual bool isEmpty() const { return false; }
virtual QString name() const;
+ virtual QString internalName() const { return name(); }
virtual QString notes() const { return ""; }
virtual QDateTime creationTime() const;
virtual QString absolutePath() const;