3 {$INCLUDE ../shared/a_modes.inc}
8 LCLIntf
, LCLType
, LMessages
, SysUtils
, Variants
, Classes
, Graphics
,
9 Controls
, Forms
, Dialogs
, StdCtrls
, ExtCtrls
, utils
;
12 TSelectMapForm
= class (TForm
)
18 procedure GetMaps(FileName
: String);
19 procedure FormActivate(Sender
: TObject
);
20 procedure lbMapListClick(Sender
: TObject
);
21 procedure bCancelClick(Sender
: TObject
);
24 { Private declarations }
26 { Public declarations }
30 SelectMapForm
: TSelectMapForm
;
35 BinEditor
, MAPREADER
, WADEDITOR
, WADSTRUCT
, MAPSTRUCT
;
39 procedure TSelectMapForm
.FormActivate(Sender
: TObject
);
41 bOK
.Enabled
:= (lbMapList
.ItemIndex
<> -1);
45 procedure TSelectMapForm
.lbMapListClick(Sender
: TObject
);
47 if lbMapList
.ItemIndex
<> -1 then
51 procedure TSelectMapForm
.bCancelClick(Sender
: TObject
);
56 procedure TSelectMapForm
.GetMaps(FileName
: String);
63 Sign
: Array [0..2] of Char;
66 lbMapList
.Items
.Clear();
68 WAD
:= TWADEditor_1
.Create();
69 if not WAD
.ReadFile(FileName
) then
75 ResList
:= WAD
.GetResourcesList('');
77 if ResList
<> nil then
78 for a
:= 0 to High(ResList
) do
80 if not WAD
.GetResource('', ResList
[a
], Data
, Len
) then
83 CopyMemory(@Sign
[0], Data
, 3);
86 if Sign
= MAP_SIGNATURE
then
87 lbMapList
.Items
.Add(win2utf(ResList
[a
]));