-
Notifications
You must be signed in to change notification settings - Fork 1
/
DM_FixBashSmashPatch.pas
111 lines (92 loc) · 2.07 KB
/
DM_FixBashSmashPatch.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
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
unit DM_FixBashSmashPatch;
{
Hotkey: Shift+F5
Not inteneded to be used by the general public.
}
interface
uses
xEditApi;
implementation
procedure Separate;
begin
AddMessage(#13#10#13#10);
end;
function Initialize: Integer;
begin
Separate;
end;
function Finalize: Integer;
begin
Separate;
end;
function Process(e: IInterface): Integer;
var
s: string;
begin
if Signature(e) = 'AMMO' then
AddMessage('Ammo')
else if Signature(e) = 'ARMA' then
PrArma(e)
else if Signature(e) = 'NPC_' then
PrNpc(e)
else if Signature(e) = 'PERK' then
PrPerk(e)
else if Signature(e) = 'RACE' then
PrRace(e)
end;
// Gets the second to last file name of the latest override
function SecondToLastOvFileName(e: IInterface): string;
var
ov: IInterface;
n: Integer;
begin
e := MasterOrSelf(e);
n := OverrideCount(e);
if n < 2 then begin
Result := '';
Exit;
end;
ov := OverrideByIndex(e, n - 2);
Result := GetFileName(GetFile(ov));
end;
procedure PrArma(e: IInterface);
var
lastF: string;
begin
lastF := SecondToLastOvFileName(e);
if (lastF = 'BD Armor and clothes replacer.esp') or (lastF = 'HIMBO.esp') then begin
AddMessage('Removed last override of ' + GetElementEditValues(e, 'EDID'));
Remove(WinningOverride(e));
end;
end;
procedure PrNpc(e: IInterface);
var
lastF: string;
begin
lastF := SecondToLastOvFileName(e);
if (lastF = 'TKAA.esp') then begin
AddMessage('Removed last override of ' + GetElementEditValues(e, 'FULL'));
Remove(WinningOverride(e));
end;
end;
procedure PrPerk(e: IInterface);
var
lastF: string;
begin
lastF := SecondToLastOvFileName(e);
if (lastF = 'Ordinator - Perks of Skyrim.esp') then begin
AddMessage('Removed last override of ' + GetElementEditValues(e, 'FULL'));
Remove(WinningOverride(e));
end;
end;
procedure PrRace(e: IInterface);
var
lastF: string;
begin
lastF := SecondToLastOvFileName(e);
if (lastF = 'BeautifulVampires.esp') then begin
AddMessage('Removed last override of ' + GetElementEditValues(e, 'FULL'));
Remove(WinningOverride(e));
end;
end;
end.