-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathExportTabularLSCR.pas
53 lines (42 loc) · 1.55 KB
/
ExportTabularLSCR.pas
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
unit ExportTabularLSCR;
uses ExportCore,
ExportTabularCore;
var ExportTabularLSCR_outputLines: TStringList;
function initialize(): Integer;
begin
ExportTabularLSCR_outputLines := TStringList.create();
ExportTabularLSCR_outputLines.add(
'"File"' // Name of the originating ESM
+ ', "Form ID"' // Form ID
+ ', "Editor ID"' // Editor ID
+ ', "Description"' // (English) flavor text
+ ', "Background image"' // Path to file displayed in background
+ ', "Foreground model"' // Link to 'STAT' record displayed in foreground
);
end;
function canProcess(el: IInterface): Boolean;
begin
result := signature(el) = 'LSCR';
end;
function process(LSCR: IInterface): Integer;
begin
if not canProcess(LSCR) then begin
addWarning(name(LSCR) + ' is not an LSCR. Entry was ignored.');
exit;
end;
ExportTabularLSCR_outputLines.add(
escapeCsvString(getFileName(getFile(LSCR))) + ', '
+ escapeCsvString(stringFormID(LSCR)) + ', '
+ escapeCsvString(getEditValue(elementBySignature(LSCR, 'EDID'))) + ', '
+ escapeCsvString(getEditValue(elementBySignature(LSCR, 'DESC'))) + ', '
+ escapeCsvString(getEditValue(elementBySignature(LSCR, 'BNAM'))) + ', '
+ escapeCsvString(getEditValue(elementBySignature(LSCR, 'NNAM')))
);
end;
function finalize(): Integer;
begin
createDir('dumps/');
ExportTabularLSCR_outputLines.saveToFile('dumps/LSCR.csv');
ExportTabularLSCR_outputLines.free();
end;
end.