-
Notifications
You must be signed in to change notification settings - Fork 2
/
Export FormKey.pas
38 lines (32 loc) · 1005 Bytes
/
Export FormKey.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
{
Exports 6-digit FormIDs and filenames, to be used as FormKey strings in Mutagen
}
unit userscript;
uses praUtil;
// Called before processing
// You can remove it if script doesn't require initialization code
function Initialize: integer;
begin
Result := 0;
end;
// called for every record selected in xEdit
function Process(e: IInterface): integer;
var
rec: IInterface;
srcFile: IInterface;
theFormId: cardinal;
begin
Result := 0;
rec := MasterOrSelf(e);
srcFile := GetFile(e);
theFormId := getLocalFormId(srcFile, FormID(rec));
// comment this out if you don't want those messages
AddMessage(IntToHex(theFormId, 6)+':'+GetFileName(srcFile));
end;
// Called after processing
// You can remove it if script doesn't require finalization code
function Finalize: integer;
begin
Result := 0;
end;
end.