Skip to content

Commit cf68ce4

Browse files
Initial commit
0 parents  commit cf68ce4

File tree

4 files changed

+3895
-0
lines changed

4 files changed

+3895
-0
lines changed

index.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* global ngapp, xelib, fh */
2+
const signaturesToProcess = [
3+
"ALCH", "AMMO", "BOOK", "INGR", "MISC", "SCRL", "SLGM",
4+
"SPEL", "WEAP"
5+
];
6+
7+
let buildProcessBlock = function(signature) {
8+
return {
9+
load: () => { return { signature: signature }; },
10+
patch: function(record, helpers, settings, locals) {
11+
let editorId = xelib.GetValue(record, "EDID");
12+
let recordRules = locals.rules[signature];
13+
if (recordRules.hasOwnProperty(editorId)) {
14+
if (!xelib.HasElement(record, "FULL")) return;
15+
xelib.SetValue(record, "FULL", recordRules[editorId]);
16+
helpers.logMessage(`Adding ${xelib.LongName(record)}`);
17+
}
18+
}
19+
}
20+
};
21+
22+
registerPatcher({
23+
info: info,
24+
gameModes: [xelib.gmTES5, xelib.gmSSE],
25+
settings: {
26+
label: "SORT Settings",
27+
templateUrl: `${patcherUrl}/partials/settings.html`,
28+
defaultSettings: {
29+
patchFileName: "SORT.esp"
30+
}
31+
},
32+
execute: {
33+
initialize: function(patch, helpers, settings, locals) {
34+
locals.rules = fh.loadJsonFile(`${patcherPath}/rules.json`);
35+
},
36+
process: signaturesToProcess.map(buildProcessBlock)
37+
}
38+
});

module.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"id": "SORT",
3+
"name": "Scripted Overrides that Rename Things",
4+
"author": "EQLIBRIIM",
5+
"version": "1.6.0",
6+
"released": "11/17/2017",
7+
"updated": "6/11/2019",
8+
"description": "A brand spanking new sorting mod to soothe your sorting needs!",
9+
"requires": ["unifiedPatchingFramework"],
10+
"moduleLoader": "UPF",
11+
"canHotLoad": true
12+
}

partials/settings.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>SORT Settings</h1>
2+
<ignore-plugins patcher-id="SORT"></ignore-plugins>

0 commit comments

Comments
 (0)