3 {$INCLUDE ../shared/a_modes.inc}
8 LCLIntf
, LCLType
, LMessages
, Messages
, SysUtils
, Variants
, Classes
, Graphics
, Controls
, Forms
,
9 Dialogs
, StdCtrls
, ExtCtrls
, g_basic
;
12 TMapCheckForm
= class (TForm
)
14 lbErrorList
: TListBox
;
15 mErrorDescription
: TMemo
;
19 procedure bCloseClick(Sender
: TObject
);
20 procedure bCheckMapClick(Sender
: TObject
);
21 procedure lbErrorListClick(Sender
: TObject
);
24 { Private declarations }
26 { Public declarations }
30 MapCheckForm
: TMapCheckForm
;
31 ErrorsNum
: Array of Byte;
36 f_main
, g_map
, MAPDEF
, g_language
;
40 procedure TMapCheckForm
.bCloseClick(Sender
: TObject
);
45 procedure TMapCheckForm
.bCheckMapClick(Sender
: TObject
);
53 mErrorDescription
.Clear();
56 // Проверяем пересечение точек появления с картой:
58 for a
:= 0 to High(gAreas
) do
60 if gAreas
[a
].AreaType
in [AREA_PLAYERPOINT1
, AREA_PLAYERPOINT2
,
61 AREA_DMPOINT
, AREA_REDTEAMPOINT
,
62 AREA_BLUETEAMPOINT
] then
66 if gPanels
<> nil then
67 for b
:= 0 to High(gPanels
) do
68 if gPanels
[b
].PanelType
= PANEL_CLOSEDOOR
then
69 if ObjectCollide(OBJECT_AREA
, a
,
70 gPanels
[b
].X
, gPanels
[b
].Y
,
71 gPanels
[b
].Width
, gPanels
[b
].Height
) then
77 if c
or ObjectCollideLevel(a
, OBJECT_AREA
, 0, 0) then
79 lbErrorList
.Items
.Add(Format(_lc
[I_TEST_AREA_WALL_STR
], [a
, X
, Y
]));
80 SetLength(ErrorsNum
, Length(ErrorsNum
)+1);
81 ErrorsNum
[High(ErrorsNum
)] := 1;
86 // Проверяем пересечение монстров с картой:
87 if gMonsters
<> nil then
88 for a
:= 0 to High(gMonsters
) do
89 if gMonsters
[a
].MonsterType
<> MONSTER_NONE
then
94 if gPanels
<> nil then
95 for b
:= 0 to High(gPanels
) do
96 if gPanels
[b
].PanelType
= PANEL_CLOSEDOOR
then
97 if ObjectCollide(OBJECT_MONSTER
, a
,
98 gPanels
[b
].X
, gPanels
[b
].Y
,
99 gPanels
[b
].Width
, gPanels
[b
].Height
) then
105 if c
or ObjectCollideLevel(a
, OBJECT_MONSTER
, 0, 0) then
107 lbErrorList
.Items
.Add(Format(_lc
[I_TEST_MONSTER_WALL_STR
], [a
, X
, Y
]));
108 SetLength(ErrorsNum
, Length(ErrorsNum
)+1);
109 ErrorsNum
[High(ErrorsNum
)] := 5;
118 if gAreas
<> nil then
119 for a
:= 0 to High(gAreas
) do
120 case gAreas
[a
].AreaType
of
121 AREA_PLAYERPOINT1
: Inc(b
);
122 AREA_PLAYERPOINT2
: Inc(bb
);
123 AREA_DMPOINT
, AREA_REDTEAMPOINT
,
124 AREA_BLUETEAMPOINT
: Inc(bbb
);
129 lbErrorList
.Items
.Add(_lc
[I_TEST_SPAWNS_1
]);
130 SetLength(ErrorsNum
, Length(ErrorsNum
)+1);
131 ErrorsNum
[High(ErrorsNum
)] := 2;
136 lbErrorList
.Items
.Add(_lc
[I_TEST_SPAWNS_2
]);
137 SetLength(ErrorsNum
, Length(ErrorsNum
)+1);
138 ErrorsNum
[High(ErrorsNum
)] := 3;
143 lbErrorList
.Items
.Add(_lc
[I_TEST_NO_DM
]);
144 SetLength(ErrorsNum
, Length(ErrorsNum
)+1);
145 ErrorsNum
[High(ErrorsNum
)] := 4;
149 procedure TMapCheckForm
.lbErrorListClick(Sender
: TObject
);
151 if lbErrorList
.ItemIndex
<> -1 then
152 case ErrorsNum
[lbErrorList
.ItemIndex
] of
153 1: mErrorDescription
.Text := _lc
[I_TEST_AREA_WALL
];
154 2, 3: mErrorDescription
.Text := _lc
[I_TEST_SPAWNS
];
155 4: mErrorDescription
.Text := _lc
[I_TEST_NO_DM_EX
];
156 5: mErrorDescription
.Text := _lc
[I_TEST_MONSTER_WALL
];