blob: e17bd66e40343fcf89030921232a121cfeeca9d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
#ifndef MODDATACONTENT_H
#define MODDATACONTENT_H
#include <algorithm>
#include <memory>
#include <vector>
#include <QString>
namespace MOBase {
class IFileTree;
};
/**
* The ModDataContent feature is used (when available) to indicate to users the content
* of mods in the "Content" column.
*
* The feature exposes a list of possible content types, each associated with an ID, a name
* and an icon. The icon is the path to either:
* - A Qt resource or;
* - A file on the disk.
*
* In order to facilitate the implementation, MO2 already provides a set of icons that can
* be used. Those icons are all under :/MO/gui/content (e.g. :/MO/gui/content/plugin or :/MO/gui/content/music).
*
* The list of available icons is:
* - plugin: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/jigsaw-piece.png
* - skyproc: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/hand-of-god.png
* - texture: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/empty-chessboard.png
* - music: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/double-quaver.png
* - sound: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/lyre.png
* - interface: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/usable.png
* - skse: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/checkbox-tree.png
* - script: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/tinker.png
* - mesh: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/breastplate.png
* - string: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/conversation.png
* - bsa: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/locked-chest.png
* - menu: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/config.png
* - inifile: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/feather-and-scroll.png
* - modgroup: https://github.com/ModOrganizer2/modorganizer/blob/master/src/resources/contents/xedit.png
*/
class ModDataContent {
public:
struct Content {
/**
* @param id ID of this content.
* @param name Name of this content.
* @param icon Path to the icon for this content. Can be either a path
* to an image on the disk, or to a resource. Can be an empty string if filterOnly
* is true.
* @param filterOnly Indicates if the content should only be show in the filter
* criteria and not in the actual Content column.
*/
Content(int id, QString name, QString icon, bool filterOnly = false) :
m_Id{ id }, m_Name{ name }, m_Icon{ icon }, m_FilterOnly{ filterOnly } { }
/**
* @return the ID of this content.
*/
int id() const { return m_Id; }
/**
* @return the name of this content.
*/
QString name() const { return m_Name; }
/**
* @return the path to the icon of this content (can be a Qt resource path).
*/
QString icon() const { return m_Icon; }
/**
* @return true if this content is only meant to be used as a filter criteria.
*/
bool isOnlyForFilter() const { return m_FilterOnly; }
private:
int m_Id;
QString m_Name;
QString m_Icon;
bool m_FilterOnly;
};
/**
* @return the list of all possible contents for the corresponding game.
*/
virtual std::vector<Content> getAllContents() const = 0;
/**
* @brief Retrieve the list of contents in the given tree.
*
* @param fileTree The tree corresponding to the mod to retrieve contents for.
*
* @return the IDs of the content in the given tree.
*/
virtual std::vector<int> getContentsFor(std::shared_ptr<const MOBase::IFileTree> fileTree) const = 0;
public:
/**
*
*/
virtual ~ModDataContent() { }
};
#endif
|