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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
#include "gamemorrowind.h"
#include "morrowindbsainvalidation.h"
#include "morrowinddataarchives.h"
#include "morrowindgameplugins.h"
#include "morrowindlocalsavegames.h"
#include "morrowindmoddatachecker.h"
#include "morrowindmoddatacontent.h"
#include "morrowindsavegame.h"
#include "morrowindsavegameinfo.h"
#include "executableinfo.h"
#include "pluginsetting.h"
#include "steamutility.h"
#include <gamebryounmanagedmods.h>
#include <QCoreApplication>
#include <QDebug>
#include <QFileInfo>
#include <QtDebug>
#include <exception>
#include <memory>
#include <stdexcept>
#include <string>
#include <vector>
using namespace MOBase;
GameMorrowind::GameMorrowind() {}
bool GameMorrowind::init(IOrganizer* moInfo)
{
if (!GameGamebryo::init(moInfo)) {
return false;
}
auto dataArchives = std::make_shared<MorrowindDataArchives>(this);
registerFeature(dataArchives);
registerFeature(std::make_shared<MorrowindBSAInvalidation>(dataArchives.get(), this));
registerFeature(std::make_shared<MorrowindSaveGameInfo>(this));
registerFeature(std::make_shared<MorrowindLocalSavegames>(this));
registerFeature(std::make_shared<MorrowindModDataChecker>(this));
registerFeature(
std::make_shared<MorrowindModDataContent>(m_Organizer->gameFeatures()));
registerFeature(std::make_shared<MorrowindGamePlugins>(moInfo));
registerFeature(std::make_shared<GamebryoUnmangedMods>(this));
return true;
}
QString GameMorrowind::gameName() const
{
return "Morrowind";
}
QString GameMorrowind::getLauncherName() const
{
return "Morrowind Launcher.exe";
}
QDir GameMorrowind::dataDirectory() const
{
return gameDirectory().absoluteFilePath("Data Files");
}
QDir GameMorrowind::savesDirectory() const
{
return QDir(gameDirectory().absoluteFilePath("Saves"));
}
QDir GameMorrowind::documentsDirectory() const
{
return gameDirectory();
}
QList<ExecutableInfo> GameMorrowind::executables() const
{
return QList<ExecutableInfo>()
<< ExecutableInfo("MWSE (Launcher Method)",
findInGameFolder("MWSE Launcher.exe"))
<< ExecutableInfo("Morrowind", findInGameFolder(binaryName()))
<< ExecutableInfo("Morrowind Launcher", findInGameFolder(getLauncherName()))
<< ExecutableInfo("MGE XE", findInGameFolder("MGEXEgui.exe"))
<< ExecutableInfo("LOOT", QFileInfo(getLootPath()))
.withArgument("--game=\"Morrowind\"");
}
QList<ExecutableForcedLoadSetting> GameMorrowind::executableForcedLoads() const
{
return QList<ExecutableForcedLoadSetting>();
}
QString GameMorrowind::name() const
{
return "Morrowind Support Plugin";
}
QString GameMorrowind::localizedName() const
{
return tr("Morrowind Support Plugin");
}
QString GameMorrowind::author() const
{
return "Schilduin & MO2 Team";
}
QString GameMorrowind::description() const
{
return tr("Adds support for the game Morrowind.\n"
"Splash by %1")
.arg("AnyOldName3");
}
MOBase::VersionInfo GameMorrowind::version() const
{
return VersionInfo(1, 5, 1, VersionInfo::RELEASE_FINAL);
}
QList<PluginSetting> GameMorrowind::settings() const
{
return QList<PluginSetting>();
}
void GameMorrowind::initializeProfile(const QDir& path, ProfileSettings settings) const
{
if (settings.testFlag(IPluginGame::MODS)) {
copyToProfile(localAppFolder() + "/Morrowind", path, "plugins.txt");
}
if (settings.testFlag(IPluginGame::CONFIGURATION)) {
copyToProfile(gameDirectory().absolutePath(), path, "Morrowind.ini");
}
}
QString GameMorrowind::savegameExtension() const
{
return "ess";
}
QString GameMorrowind::savegameSEExtension() const
{
return "mwse";
}
std::shared_ptr<const GamebryoSaveGame>
GameMorrowind::makeSaveGame(QString filePath) const
{
return std::make_shared<const MorrowindSaveGame>(filePath, this);
}
QString GameMorrowind::steamAPPId() const
{
return "22320";
}
QStringList GameMorrowind::primaryPlugins() const
{
return {"morrowind.esm"};
}
QString GameMorrowind::binaryName() const
{
return "Morrowind.exe";
}
QString GameMorrowind::gameShortName() const
{
return "Morrowind";
}
QString GameMorrowind::gameNexusName() const
{
return "Morrowind";
}
QStringList GameMorrowind::iniFiles() const
{
return {"Morrowind.ini"};
}
QStringList GameMorrowind::DLCPlugins() const
{
return {"Tribunal.esm", "Bloodmoon.esm"};
}
MOBase::IPluginGame::SortMechanism GameMorrowind::sortMechanism() const
{
return SortMechanism::LOOT;
}
int GameMorrowind::nexusModOrganizerID() const
{
return 1334;
}
int GameMorrowind::nexusGameID() const
{
return 100;
}
QString GameMorrowind::identifyGamePath() const
{
QString path = GameGamebryo::identifyGamePath();
if (path.isEmpty()) {
// Resolve by Steam app id first (handles non-standard install directory names).
path = parseSteamLocation(steamAPPId(), "");
}
if (path.isEmpty()) {
path = MOBase::findSteamGame("Morrowind", "Data Files/Morrowind.esm");
}
return path;
}
|