function ReadGumpData GumpType Cardinal var GumpSerial Cardinal var Gu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function ReadGumpData(GumpType: Cardinal; var GumpSerial: Cardinal; var
GumpIndex: Word): Boolean;
var
SubIndex: Word;
SubCount: Word;
begin
SubCount := GetGumpsCount();
if (SubCount > 0) then
begin
for SubIndex := 0 to (SubCount - 1) do
begin
if (GetGumpID(SubIndex) = GumpType) then
begin
GumpSerial := GetGumpSerial(SubIndex);
GumpIndex := SubIndex;
Result := True;
exit;
end;
end;
end;
GumpSerial := $0;
GumpIndex := $FFFF;
Result := False;
end;