-
Notifications
You must be signed in to change notification settings - Fork 5
/
frmOptionsForm.pas
192 lines (164 loc) · 5.36 KB
/
frmOptionsForm.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
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
unit frmOptionsForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls, wbInterface;
type
TfrmOptions = class(TForm)
pcOptions: TPageControl;
tsCleaning: TTabSheet;
btnOK: TButton;
btnCancel: TButton;
cbUDRSetXESP: TCheckBox;
cbUDRSetScale: TCheckBox;
cbUDRSetZ: TCheckBox;
edUDRSetScaleValue: TEdit;
edUDRSetZValue: TEdit;
cbUDRSetMSTT: TCheckBox;
edUDRSetMSTTValue: TEdit;
Label1: TLabel;
tsGeneral: TTabSheet;
cbIKnow: TCheckBox;
cbHideUnused: TCheckBox;
cbHideIgnored: TCheckBox;
cbHideNeverShow: TCheckBox;
cbLoadBSAs: TCheckBox;
cbSortFLST: TCheckBox;
tsUISettings: TTabSheet;
clbConflictThis: TColorBox;
Label3: TLabel;
cbConflictThis: TComboBox;
Label4: TLabel;
cbConflictAll: TComboBox;
clbConflictAll: TColorBox;
cbSimpleRecords: TCheckBox;
Label5: TLabel;
edColumnWidth: TEdit;
cbAutoSave: TCheckBox;
cbTrackAllEditorID: TCheckBox;
cbSortGroupRecord: TCheckBox;
cbShowFlagEnumValue: TCheckBox;
tsDoNotBuildRefs: TTabSheet;
lbDoNotBuildRef: TListBox;
Label2: TLabel;
btnDoNotBuildRefAdd: TButton;
btnDoNotBuildRefDel: TButton;
cbRemoveOffsetData: TCheckBox;
pnlFontRecords: TPanel;
pnlFontMessages: TPanel;
pnlFontViewer: TPanel;
cbActorTemplateHide: TCheckBox;
cbClampFormID: TCheckBox;
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure FormCreate(Sender: TObject);
procedure cbConflictThisChange(Sender: TObject);
procedure clbConflictThisChange(Sender: TObject);
procedure cbConflictAllChange(Sender: TObject);
procedure clbConflictAllChange(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure btnDoNotBuildRefAddClick(Sender: TObject);
procedure btnDoNotBuildRefDelClick(Sender: TObject);
procedure pnlFontRecordsClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
_Files: ^TDynFiles;
end;
var
frmOptions: TfrmOptions;
implementation
{$R *.dfm}
uses
FileSelectFrm, TypInfo;
var
wbColorConflictAllDefault: TConflictAllColors;
wbColorConflictThisDefault: TConflictThisColors;
procedure TfrmOptions.btnDoNotBuildRefAddClick(Sender: TObject);
var
i: integer;
sl: TStringList;
begin
with TfrmFileSelect.Create(Self) do try
sl := TStringList.Create;
sl.Sorted := True;
sl.Duplicates := dupIgnore;
sl.Assign(lbDoNotBuildRef.Items);
for i := Low(_Files^) to High(_Files^) do
if _Files^[i].IsEditable then
CheckListBox1.Items.Add(_Files^[i].FileName);
if ShowModal <> mrOK then
Exit;
for i := 0 to Pred(CheckListBox1.Count) do
if CheckListBox1.Checked[i] then
sl.Add(CheckListBox1.Items[i]);
lbDoNotBuildRef.Items.Assign(sl);
finally
FreeAndNil(sl);
Free;
end;
end;
procedure TfrmOptions.btnDoNotBuildRefDelClick(Sender: TObject);
var
i: integer;
begin
for i := Pred(lbDoNotBuildRef.Count) downto 0 do
if lbDoNotBuildRef.Selected[i] then
lbDoNotBuildRef.Items.Delete(i);
end;
procedure TfrmOptions.cbConflictAllChange(Sender: TObject);
begin
clbConflictAll.Selected := wbColorConflictAll[TConflictAll(cbConflictAll.Items.Objects[cbConflictAll.ItemIndex])];
end;
procedure TfrmOptions.cbConflictThisChange(Sender: TObject);
begin
clbConflictThis.Selected := wbColorConflictThis[TConflictThis(cbConflictThis.Items.Objects[cbConflictThis.ItemIndex])];
end;
procedure TfrmOptions.clbConflictAllChange(Sender: TObject);
begin
wbColorConflictAll[TConflictAll(cbConflictAll.Items.Objects[cbConflictAll.ItemIndex])] := clbConflictAll.Selected;
end;
procedure TfrmOptions.clbConflictThisChange(Sender: TObject);
begin
wbColorConflictThis[TConflictThis(cbConflictThis.Items.Objects[cbConflictThis.ItemIndex])] := clbConflictThis.Selected;
end;
procedure TfrmOptions.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if ModalResult <> mrOk then begin
wbColorConflictAll := wbColorConflictAllDefault;
wbColorConflictThis := wbColorConflictThisDefault;
end;
end;
procedure TfrmOptions.FormCreate(Sender: TObject);
var
ct: TConflictThis;
ca: TConflictAll;
begin
for ct := ctNotDefined to High(TConflictThis) do
cbConflictThis.Items.AddObject(Copy(GetEnumName(TypeInfo(TConflictThis), Integer(ct)), 3, 100), Pointer(ct));
cbConflictThis.ItemIndex := 0;
cbConflictThisChange(nil);
for ca := caNoConflict to High(TConflictAll) do
cbConflictAll.Items.AddObject(Copy(GetEnumName(TypeInfo(TConflictAll), Integer(ca)), 3, 100), Pointer(ca));
cbConflictAll.ItemIndex := 0;
cbConflictAllChange(nil);
wbColorConflictAllDefault := wbColorConflictAll;
wbColorConflictThisDefault := wbColorConflictThis;
end;
procedure TfrmOptions.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then
ModalResult := mrCancel;
end;
procedure TfrmOptions.pnlFontRecordsClick(Sender: TObject);
begin
with TFontDialog.Create(Self) do try
Font := TPanel(Sender).Font;
if Execute then
TPanel(Sender).Font := Font;
finally
Free;
end;
end;
end.