blob: db90aa4167871d59ea6070a7926c201fd31772bd (
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
|
#include "modinfoforeign.h"
#include "iplugingame.h"
#include "utility.h"
#include <QApplication>
using namespace MOBase;
using namespace MOShared;
QDateTime ModInfoForeign::creationTime() const
{
return m_CreationTime;
}
QString ModInfoForeign::absolutePath() const
{
// I ought to store this, it's used elsewhere
IPluginGame const* game = qApp->property("managed_game").value<IPluginGame*>();
return game->dataDirectory().absolutePath();
}
std::vector<ModInfo::EFlag> ModInfoForeign::getFlags() const
{
std::vector<ModInfo::EFlag> result = ModInfoWithConflictInfo::getFlags();
result.push_back(FLAG_FOREIGN);
if (m_PluginSelected) {
result.push_back(ModInfo::FLAG_PLUGIN_SELECTED);
}
return result;
}
int ModInfoForeign::getHighlight() const
{
return m_PluginSelected ? ModInfo::HIGHLIGHT_PLUGIN : ModInfo::HIGHLIGHT_NONE;
}
QString ModInfoForeign::getDescription() const
{
return tr("This pseudo mod represents content managed outside MO. It isn't modified "
"by MO.");
}
ModInfoForeign::ModInfoForeign(const QString& modName, const QString& referenceFile,
const QStringList& archives, ModInfo::EModType modType,
OrganizerCore& core)
: ModInfoWithConflictInfo(core), m_ReferenceFile(referenceFile),
m_Archives(archives), m_ModType(modType)
{
m_CreationTime = QFileInfo(referenceFile).birthTime();
switch (modType) {
case ModInfo::EModType::MOD_DLC:
m_Name = tr("DLC: ") + modName;
m_InternalName = QString("DLC: ") + modName;
break;
case ModInfo::EModType::MOD_CC:
m_Name = tr("Creation Club: ") + modName;
m_InternalName = QString("Creation Club: ") + modName;
break;
default:
m_Name = tr("Unmanaged: ") + modName;
m_InternalName = QString("Unmanaged: ") + modName;
}
}
|