-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplugin-types.html
More file actions
383 lines (362 loc) · 36.8 KB
/
plugin-types.html
File metadata and controls
383 lines (362 loc) · 36.8 KB
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Type of Plugins — MO2 Python Plugin API documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=4ae1632d" />
<link rel="shortcut icon" href="_static/mo2.ico"/>
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Writing Plugins" href="writing-plugins.html" />
<link rel="prev" title="Setting up the environment" href="setup-tools.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
MO2 Python Plugin API
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="setup-tools.html">Setting up the environment</a><ul>
<li class="toctree-l2"><a class="reference internal" href="setup-tools.html#required-tools">Required tools</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup-tools.html#preparation">Preparation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="setup-tools.html#get-the-mobase-stubs">1. Get the <code class="docutils literal notranslate"><span class="pre">mobase</span></code> stubs</a></li>
<li class="toctree-l3"><a class="reference internal" href="setup-tools.html#configure-visual-studio-code-for-mobase">2. Configure Visual Studio Code for <code class="docutils literal notranslate"><span class="pre">mobase</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="setup-tools.html#optional-configure-black-to-auto-format-your-source-files">3. [Optional] Configure <code class="docutils literal notranslate"><span class="pre">black</span></code> to auto-format your source files</a></li>
<li class="toctree-l3"><a class="reference internal" href="setup-tools.html#optional-automatically-reload-plugins-during-development">4. [Optional] Automatically reload plugins during development</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="setup-tools.html#testing-the-setup">Testing the setup</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Type of Plugins</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#installers">Installers</a></li>
<li class="toctree-l2"><a class="reference internal" href="#previewers">Previewers</a></li>
<li class="toctree-l2"><a class="reference internal" href="#mod-page">Mod Page</a></li>
<li class="toctree-l2"><a class="reference internal" href="#game">Game</a></li>
<li class="toctree-l2"><a class="reference internal" href="#tool">Tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="#proxies">Proxies</a></li>
<li class="toctree-l2"><a class="reference internal" href="#free-plugins"><em>Free Plugins</em></a></li>
<li class="toctree-l2"><a class="reference internal" href="#extension-interfaces">Extension Interfaces</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#diagnose">Diagnose</a></li>
<li class="toctree-l3"><a class="reference internal" href="#file-mappings">File Mappings</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="writing-plugins.html">Writing Plugins</a><ul>
<li class="toctree-l2"><a class="reference internal" href="writing-plugins.html#getting-started">Getting started</a><ul>
<li class="toctree-l3"><a class="reference internal" href="writing-plugins.html#single-file-plugins">Single file plugins</a></li>
<li class="toctree-l3"><a class="reference internal" href="writing-plugins.html#module-plugins">Module Plugins</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="writing-plugins.html#writing-the-plugin">Writing the plugin</a><ul>
<li class="toctree-l3"><a class="reference internal" href="writing-plugins.html#iplugin-interface"><code class="docutils literal notranslate"><span class="pre">IPlugin</span></code> interface</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="writing-plugins.html#examples">Examples</a><ul>
<li class="toctree-l3"><a class="reference internal" href="writing-plugins.html#tutorial-plugins">Tutorial Plugins</a></li>
<li class="toctree-l3"><a class="reference internal" href="writing-plugins.html#official-plugins">Official Plugins</a></li>
<li class="toctree-l3"><a class="reference internal" href="writing-plugins.html#unofficial-plugins">Unofficial Plugins</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="writing-plugins.html#internationalization">Internationalization</a><ul>
<li class="toctree-l3"><a class="reference internal" href="writing-plugins.html#adding-translation-code">Adding translation code</a></li>
<li class="toctree-l3"><a class="reference internal" href="writing-plugins.html#generating-qt-translation-files">Generating Qt translation files</a></li>
<li class="toctree-l3"><a class="reference internal" href="writing-plugins.html#translating">Translating</a></li>
<li class="toctree-l3"><a class="reference internal" href="writing-plugins.html#distributing-translations">Distributing translations</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a><ul>
<li class="toctree-l2"><a class="reference internal" href="faq.html#why-is-mo2-throwing-an-exception-when-i-try-to-create-a-type-inheriting-one-of-mo2-class">1. Why is MO2 throwing an exception when I try to create a type inheriting one of MO2 class?</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#how-can-i-be-sure-to-implement-all-the-required-methods-when-creating-a-plugin">2. How can I be sure to implement all the required methods when creating a plugin?</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#why-are-my-isinstance-x-qobject-and-isinstance-y-qwidget-not-working">3. Why are my <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">QObject)</span></code> and <code class="docutils literal notranslate"><span class="pre">isinstance(y,</span> <span class="pre">QWidget)</span></code> not working?</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="autoapi/index.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="autoapi/mobase/index.html">mobase</a><ul>
<li class="toctree-l3"><a class="reference internal" href="autoapi/mobase/index.html#submodules">Submodules</a><ul>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/widgets/index.html">mobase.widgets</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="autoapi/mobase/index.html#attributes">Attributes</a></li>
<li class="toctree-l3"><a class="reference internal" href="autoapi/mobase/index.html#classes">Classes</a></li>
<li class="toctree-l3"><a class="reference internal" href="autoapi/mobase/index.html#functions">Functions</a></li>
<li class="toctree-l3"><a class="reference internal" href="autoapi/mobase/index.html#package-contents">Package Contents</a><ul>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.BSAInvalidation"><code class="docutils literal notranslate"><span class="pre">BSAInvalidation</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.DataArchives"><code class="docutils literal notranslate"><span class="pre">DataArchives</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.EndorsedState"><code class="docutils literal notranslate"><span class="pre">EndorsedState</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ExecutableForcedLoadSetting"><code class="docutils literal notranslate"><span class="pre">ExecutableForcedLoadSetting</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ExecutableInfo"><code class="docutils literal notranslate"><span class="pre">ExecutableInfo</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.FileInfo"><code class="docutils literal notranslate"><span class="pre">FileInfo</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.FileTreeEntry"><code class="docutils literal notranslate"><span class="pre">FileTreeEntry</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.GameFeature"><code class="docutils literal notranslate"><span class="pre">GameFeature</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.GamePlugins"><code class="docutils literal notranslate"><span class="pre">GamePlugins</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.GuessQuality"><code class="docutils literal notranslate"><span class="pre">GuessQuality</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.GuessedString"><code class="docutils literal notranslate"><span class="pre">GuessedString</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IDownloadManager"><code class="docutils literal notranslate"><span class="pre">IDownloadManager</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IFileTree"><code class="docutils literal notranslate"><span class="pre">IFileTree</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IGameFeatures"><code class="docutils literal notranslate"><span class="pre">IGameFeatures</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IInstallationManager"><code class="docutils literal notranslate"><span class="pre">IInstallationManager</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IModInterface"><code class="docutils literal notranslate"><span class="pre">IModInterface</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IModList"><code class="docutils literal notranslate"><span class="pre">IModList</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IModRepositoryBridge"><code class="docutils literal notranslate"><span class="pre">IModRepositoryBridge</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IOrganizer"><code class="docutils literal notranslate"><span class="pre">IOrganizer</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPlugin"><code class="docutils literal notranslate"><span class="pre">IPlugin</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginDiagnose"><code class="docutils literal notranslate"><span class="pre">IPluginDiagnose</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginFileMapper"><code class="docutils literal notranslate"><span class="pre">IPluginFileMapper</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginGame"><code class="docutils literal notranslate"><span class="pre">IPluginGame</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginInstaller"><code class="docutils literal notranslate"><span class="pre">IPluginInstaller</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginInstallerCustom"><code class="docutils literal notranslate"><span class="pre">IPluginInstallerCustom</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginInstallerSimple"><code class="docutils literal notranslate"><span class="pre">IPluginInstallerSimple</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginList"><code class="docutils literal notranslate"><span class="pre">IPluginList</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginModPage"><code class="docutils literal notranslate"><span class="pre">IPluginModPage</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginPreview"><code class="docutils literal notranslate"><span class="pre">IPluginPreview</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginRequirement"><code class="docutils literal notranslate"><span class="pre">IPluginRequirement</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginTool"><code class="docutils literal notranslate"><span class="pre">IPluginTool</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.IProfile"><code class="docutils literal notranslate"><span class="pre">IProfile</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ISaveGame"><code class="docutils literal notranslate"><span class="pre">ISaveGame</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ISaveGameInfoWidget"><code class="docutils literal notranslate"><span class="pre">ISaveGameInfoWidget</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.InstallResult"><code class="docutils literal notranslate"><span class="pre">InstallResult</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.LoadOrderMechanism"><code class="docutils literal notranslate"><span class="pre">LoadOrderMechanism</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.LocalSavegames"><code class="docutils literal notranslate"><span class="pre">LocalSavegames</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.Mapping"><code class="docutils literal notranslate"><span class="pre">Mapping</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ModDataChecker"><code class="docutils literal notranslate"><span class="pre">ModDataChecker</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ModDataContent"><code class="docutils literal notranslate"><span class="pre">ModDataContent</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ModRepositoryFileInfo"><code class="docutils literal notranslate"><span class="pre">ModRepositoryFileInfo</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ModState"><code class="docutils literal notranslate"><span class="pre">ModState</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.PluginRequirementFactory"><code class="docutils literal notranslate"><span class="pre">PluginRequirementFactory</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.PluginSetting"><code class="docutils literal notranslate"><span class="pre">PluginSetting</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.PluginState"><code class="docutils literal notranslate"><span class="pre">PluginState</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ProfileSetting"><code class="docutils literal notranslate"><span class="pre">ProfileSetting</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ReleaseType"><code class="docutils literal notranslate"><span class="pre">ReleaseType</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.SaveGameInfo"><code class="docutils literal notranslate"><span class="pre">SaveGameInfo</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.ScriptExtender"><code class="docutils literal notranslate"><span class="pre">ScriptExtender</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.SortMechanism"><code class="docutils literal notranslate"><span class="pre">SortMechanism</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.TrackedState"><code class="docutils literal notranslate"><span class="pre">TrackedState</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.UnmanagedMods"><code class="docutils literal notranslate"><span class="pre">UnmanagedMods</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.VersionInfo"><code class="docutils literal notranslate"><span class="pre">VersionInfo</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.VersionScheme"><code class="docutils literal notranslate"><span class="pre">VersionScheme</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.getFileVersion"><code class="docutils literal notranslate"><span class="pre">getFileVersion()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.getIconForExecutable"><code class="docutils literal notranslate"><span class="pre">getIconForExecutable()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.getProductVersion"><code class="docutils literal notranslate"><span class="pre">getProductVersion()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.GameFeatureType"><code class="docutils literal notranslate"><span class="pre">GameFeatureType</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.INVALID_HANDLE_VALUE"><code class="docutils literal notranslate"><span class="pre">INVALID_HANDLE_VALUE</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.MoVariant"><code class="docutils literal notranslate"><span class="pre">MoVariant</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="autoapi/mobase/index.html#mobase.__version__"><code class="docutils literal notranslate"><span class="pre">__version__</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">MO2 Python Plugin API</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Type of Plugins</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/plugin-types.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="type-of-plugins">
<span id="id1"></span><h1>Type of Plugins<a class="headerlink" href="#type-of-plugins" title="Link to this heading"></a></h1>
<p>Plugins are passive, that is: they react to events emitted by the core application or extend
an existing functionality (like adding support for additional types of installers). Plugins
should integrate with Mod Organizers concepts. While you could write an INI editor that works with
the global INI files instead of the profile specific ones, what would be the point?</p>
<p>Depending on where/how the plugin integrates with MO you need to write a different type of plugin,
in practice this means you need to implement a different interface (inherit from a different base
plugin class from <code class="docutils literal notranslate"><span class="pre">mobase</span></code>). As mentioned above, plugins are passive: the plugin type decides how/when
MO makes requests to/invokes your plugin.
All plugins however gain access to MOs own plugin interface so all plugins get to make the same requests
to MO.</p>
<section id="installers">
<h2>Installers<a class="headerlink" href="#installers" title="Link to this heading"></a></h2>
<div class="line-block">
<div class="line"><strong>Interface:</strong> <a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginInstaller" title="mobase.IPluginInstaller"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginInstaller</span></code></a>, <a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginInstallerSimple" title="mobase.IPluginInstallerSimple"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginInstallerSimple</span></code></a>,
<a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginInstallerCustom" title="mobase.IPluginInstallerCustom"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginInstallerCustom</span></code></a></div>
<div class="line"><strong>Examples:</strong> <code class="docutils literal notranslate"><span class="pre">installer_bain</span></code>, <code class="docutils literal notranslate"><span class="pre">installer_bundle</span></code>, <code class="docutils literal notranslate"><span class="pre">installer_fomod</span></code>, <code class="docutils literal notranslate"><span class="pre">installer_ncc</span></code>, <code class="docutils literal notranslate"><span class="pre">installer_quick</span></code>, <code class="docutils literal notranslate"><span class="pre">installer_manual</span></code>.</div>
</div>
<p>An installer is invoked when the user tries to install a mod, either by double clicking in the download
view or through the “Install Mod..” button or “Reinstall mod” item from the mod lists context menu.
There are actually two ways to write an installer, <em>simple</em> or <em>complex</em>:</p>
<ul class="simple">
<li><p>With <em>simple</em> installers, MO does the unpacking of the file but this works only with standard archive formats.
The plugin can then select the files and folders that requires extraction, and where to extract them.</p></li>
<li><p><em>Complex</em> installers are more flexible but require a bit more work.</p></li>
</ul>
</section>
<section id="previewers">
<h2>Previewers<a class="headerlink" href="#previewers" title="Link to this heading"></a></h2>
<div class="line-block">
<div class="line"><strong>Interfaces:</strong> <a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginPreview" title="mobase.IPluginPreview"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginPreview</span></code></a></div>
<div class="line"><strong>Examples:</strong> <code class="docutils literal notranslate"><span class="pre">preview_base</span></code></div>
</div>
<p>These plugins add support for previewing files in the data pane.
Right now all image formats supported by Qt are implemented (including <cite>.dds</cite>) but no audio files and
no 3d mesh formats.</p>
</section>
<section id="mod-page">
<h2>Mod Page<a class="headerlink" href="#mod-page" title="Link to this heading"></a></h2>
<p><em>WIP</em></p>
<div class="line-block">
<div class="line"><strong>Interfaces:</strong> <a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginModPage" title="mobase.IPluginModPage"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginModPage</span></code></a></div>
<div class="line"><strong>Examples:</strong> <code class="docutils literal notranslate"><span class="pre">page_tesalliance</span></code></div>
</div>
<p>Mod Page plugins implement interfaces to modding communities where mods can be downloaded, checked
for updates and so on.
This interface is not finished and some of the bits that are do not actually get used. The goal is
that the whole Nexus integration can be implemented through this interface and can then be removed
from the core application. This is a task for the distant future, unless someone wants to volunteer.</p>
</section>
<section id="game">
<h2>Game<a class="headerlink" href="#game" title="Link to this heading"></a></h2>
<div class="line-block">
<div class="line"><strong>Interfaces:</strong> <a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginGame" title="mobase.IPluginGame"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginGame</span></code></a></div>
<div class="line"><strong>Examples:</strong> <code class="docutils literal notranslate"><span class="pre">game_oblivion</span></code>, <code class="docutils literal notranslate"><span class="pre">game_fallout3</span></code>, <code class="docutils literal notranslate"><span class="pre">game_falloutnv</span></code>, <code class="docutils literal notranslate"><span class="pre">game_skyrim</span></code>, …</div>
</div>
<p>These plugins (shall eventually) implement all the game specific features and further game plugins are
able to add support for further games.
The plugin is also responsible to help MO determine if (and where) the game is installed in the first place.
Since supporting a game properly requires extensions in many places of the UI.
To allow this without creating one huge plugin interface that involves every aspect of MO,
game plugins can register only the features they need to MO2 using <a class="reference internal" href="autoapi/mobase/index.html#mobase.IGameFeatures.registerFeature" title="mobase.IGameFeatures.registerFeature"><code class="xref py py-meth docutils literal notranslate"><span class="pre">registerFeature</span></code></a></p>
<p>As an example for a game feature take BSA invalidation: If the game requires BSA invalidation it will implement
this feature.
Wherever the core can support BSA invalidation it will query whether the current game has this feature and if so
query the implementation on specifics (like “How should the invalidation BSA be called” and “what’s the right bsa version”).
Of course, the goal is for feature interfaces to be as generic as possible without limiting usefulness.</p>
<p><strong>Note:</strong> The <a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginGame" title="mobase.IPluginGame"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginGame</span></code></a> interface is complex, and mostly designed for Gamebryo games. If you plan
on writting a game plugin for another type of games, you might be interested by a simpler interface and might
want to check out the <a class="reference external" href="https://github.com/ModOrganizer2/modorganizer-basic_games">Basic Games</a> meta-plugin.</p>
</section>
<section id="tool">
<h2>Tool<a class="headerlink" href="#tool" title="Link to this heading"></a></h2>
<div class="line-block">
<div class="line"><strong>Interfaces:</strong> <a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginTool" title="mobase.IPluginTool"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginTool</span></code></a></div>
<div class="line"><strong>Examples:</strong> <code class="docutils literal notranslate"><span class="pre">tool_configurator</span></code>, <code class="docutils literal notranslate"><span class="pre">tool_inieditor</span></code>, <code class="docutils literal notranslate"><span class="pre">fnistool</span></code></div>
</div>
<p>This is the simplest of plugin interfaces. Such plugins simply place an icon inside the tools submenu and get
invoked when the user clicks it. They are expected to have a user interface of some sort.
These are almost like independent applications except they can access all Mod Organizer interfaces like querying
and modifying the current profile, mod list, load order, use MO to install mods and so on.
A tool plugin can (and should!) integrate its UI as a window inside MO and thus doesn’t have to initialize a
windows application itself.</p>
</section>
<section id="proxies">
<h2>Proxies<a class="headerlink" href="#proxies" title="Link to this heading"></a></h2>
<div class="line-block">
<div class="line"><strong>Interfaces:</strong> <code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginProxy</span></code></div>
<div class="line"><strong>Examples:</strong> <code class="docutils literal notranslate"><span class="pre">plugin_python</span></code></div>
</div>
<p>Proxy Plugins expose the plugin api to foreign languages. This is what allows you to write plugins using python
in the first place.
The python proxy is easily the most complicated plugin and requires constant updating so if you’re considering
writing a Haskell plugin because that is your programming language of choice, I am fairly certain learning python
is easier than writing the haskell proxy. Just saying.
And no, you can not write a proxy for a third language in Python, do not be silly.</p>
</section>
<section id="free-plugins">
<h2><em>Free Plugins</em><a class="headerlink" href="#free-plugins" title="Link to this heading"></a></h2>
<div class="line-block">
<div class="line"><strong>Interfaces:</strong> <a class="reference internal" href="autoapi/mobase/index.html#mobase.IPlugin" title="mobase.IPlugin"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPlugin</span></code></a></div>
<div class="line"><strong>Examples:</strong> <code class="docutils literal notranslate"><span class="pre">check_fnis</span></code>, <code class="docutils literal notranslate"><span class="pre">bsa_extractor</span></code>, <code class="docutils literal notranslate"><span class="pre">diagnose_basic</span></code>, <code class="docutils literal notranslate"><span class="pre">tool_inibakery</span></code></div>
</div>
<p>“Free” plugins implement none of the interfaces and thus initially do not integrate with MO at all.
They are initialized by MO and get access to the MO interface.
This makes sense if you only want to implement one of the extension interfaces (see below) or register handlers
for events.</p>
</section>
<section id="extension-interfaces">
<h2>Extension Interfaces<a class="headerlink" href="#extension-interfaces" title="Link to this heading"></a></h2>
<p>In Python, these interfaces are similar to other plugin types, but in C++, those do not inherit <code class="docutils literal notranslate"><span class="pre">IPlugin</span></code> so
that plugins can implement one or more of these interfaces, in addition to a normal plugin type.</p>
<section id="diagnose">
<h3>Diagnose<a class="headerlink" href="#diagnose" title="Link to this heading"></a></h3>
<div class="line-block">
<div class="line"><strong>Interfaces:</strong> <a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginDiagnose" title="mobase.IPluginDiagnose"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginDiagnose</span></code></a></div>
<div class="line"><strong>Examples:</strong> <code class="docutils literal notranslate"><span class="pre">diagnose_basic</span></code>, <code class="docutils literal notranslate"><span class="pre">installer_ncc</span></code>, <code class="docutils literal notranslate"><span class="pre">plugin_python</span></code>, <code class="docutils literal notranslate"><span class="pre">script_extender_plugin_checker</span></code></div>
</div>
<p>This interface lets the plugin report issues that are then listed in the “Problems” icon in the main window.
If possible the plugin can also provide an automatic or guided fix to the problem.
The <code class="docutils literal notranslate"><span class="pre">diagnose_basic</span></code> plugin does nothing but analyze the MO installation and report problems it discovers (like
<em>“There are files in your overwrite directory.”</em>) but usually a plugin will want to report issues relevant for its
own operation.
For instance, <code class="docutils literal notranslate"><span class="pre">installer_ncc</span></code> requires a specific version of .NET and will report a problem if it is not installed.
This should always be the prefered way to communicate problems the user has to fix but should never be used for problems
he cannot fix (i.e. <em>“This plugin does not work with this game.”</em>).
An empty problem list should always be achievable.</p>
</section>
<section id="file-mappings">
<h3>File Mappings<a class="headerlink" href="#file-mappings" title="Link to this heading"></a></h3>
<div class="line-block">
<div class="line"><strong>Interfaces:</strong> <a class="reference internal" href="autoapi/mobase/index.html#mobase.IPluginFileMapper" title="mobase.IPluginFileMapper"><code class="xref py py-class docutils literal notranslate"><span class="pre">IPluginFileMapper</span></code></a></div>
<div class="line"><strong>Examples:</strong> <code class="docutils literal notranslate"><span class="pre">tool_inibakery</span></code>, <code class="docutils literal notranslate"><span class="pre">game_gamebryo</span></code></div>
</div>
<p>This interface allows plugins to add virtual file (or directory) links to the virtual file system in addition to the
mod files.
Profile-local save games, ini-files and load-orders are all implemented this way in MO2.</p>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="setup-tools.html" class="btn btn-neutral float-left" title="Setting up the environment" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="writing-plugins.html" class="btn btn-neutral float-right" title="Writing Plugins" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2023, Holt59.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>