author | unc0rr |
Wed, 16 Nov 2011 20:42:45 +0300 | |
changeset 6387 | 3dcb839b5904 |
parent 6339 | 2a3925178178 |
child 6415 | af2047bb4f70 |
permissions | -rw-r--r-- |
4976 | 1 |
(* |
2 |
* Hedgewars, a free turn based strategy game |
|
3 |
* Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com> |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*) |
|
18 |
||
4413 | 19 |
{$INCLUDE "options.inc"} |
4976 | 20 |
|
4413 | 21 |
unit uCommandHandlers; |
22 |
||
23 |
interface |
|
24 |
||
25 |
procedure initModule; |
|
26 |
procedure freeModule; |
|
27 |
||
28 |
implementation |
|
5247 | 29 |
uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom, uCaptions; |
4413 | 30 |
|
4531
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
31 |
procedure chGenCmd(var s: shortstring); |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
32 |
begin |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
33 |
case s[1] of |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
34 |
'R': if ReadyTimeLeft > 1 then |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
35 |
begin |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
36 |
ReadyTimeLeft:= 1; |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
37 |
if not CurrentTeam^.ExtDriven then SendIPC('c'+s); |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
38 |
end |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
39 |
end |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
40 |
end; |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
41 |
|
4413 | 42 |
procedure chQuit(var s: shortstring); |
43 |
const prevGState: TGameState = gsConfirm; |
|
44 |
begin |
|
4751 | 45 |
s:= s; // avoid compiler hint |
5555
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
46 |
if (GameState = gsGame) or (GameState = gsChat) then |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
47 |
begin |
4413 | 48 |
prevGState:= GameState; |
5523 | 49 |
GameState:= gsConfirm; |
50 |
SDL_ShowCursor(1) |
|
5555
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
51 |
end else |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
52 |
if GameState = gsConfirm then |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
53 |
begin |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
54 |
GameState:= prevGState; |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
55 |
SDL_ShowCursor(ord(isPaused)) |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
56 |
end |
4413 | 57 |
end; |
58 |
||
4744
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
59 |
procedure chForceQuit(var s: shortstring); |
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
60 |
begin |
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
61 |
s:= s; // avoid compiler hint |
4751 | 62 |
GameState:= gsConfirm; |
63 |
ParseCommand('confirm', true); |
|
4413 | 64 |
end; |
65 |
||
66 |
procedure chConfirm(var s: shortstring); |
|
67 |
begin |
|
4751 | 68 |
s:= s; // avoid compiler hint |
69 |
if GameState = gsConfirm then |
|
4413 | 70 |
begin |
4751 | 71 |
SendIPC('Q'); |
72 |
GameState:= gsExit |
|
4413 | 73 |
end |
74 |
else |
|
75 |
ParseCommand('chat team', true); |
|
76 |
end; |
|
77 |
||
4751 | 78 |
procedure chHalt (var s: shortstring); |
4746
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
79 |
begin |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
80 |
s:= s; // avoid compiler hint |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
81 |
SendIPC('H'); |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
82 |
GameState:= gsExit |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
83 |
end; |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
84 |
|
4413 | 85 |
procedure chCheckProto(var s: shortstring); |
86 |
var i, c: LongInt; |
|
87 |
begin |
|
6001 | 88 |
if isDeveloperMode then |
89 |
begin |
|
90 |
val(s, i, c); |
|
91 |
if (c <> 0) or (i = 0) then exit; |
|
92 |
TryDo(i <= cNetProtoVersion, 'Protocol version mismatch: engine is too old (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true); |
|
93 |
TryDo(i >= cNetProtoVersion, 'Protocol version mismatch: engine is too new (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true); |
|
94 |
end |
|
4413 | 95 |
end; |
96 |
||
97 |
procedure chTeamLocal(var s: shortstring); |
|
98 |
begin |
|
99 |
s:= s; // avoid compiler hint |
|
100 |
if not isDeveloperMode then exit; |
|
101 |
if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/rdriven"', true); |
|
102 |
CurrentTeam^.ExtDriven:= true |
|
103 |
end; |
|
104 |
||
105 |
procedure chGrave(var s: shortstring); |
|
106 |
begin |
|
107 |
if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/grave"', true); |
|
108 |
if s[1]='"' then Delete(s, 1, 1); |
|
109 |
if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1); |
|
110 |
CurrentTeam^.GraveName:= s |
|
111 |
end; |
|
112 |
||
113 |
procedure chFort(var s: shortstring); |
|
114 |
begin |
|
115 |
if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/fort"', true); |
|
116 |
if s[1]='"' then Delete(s, 1, 1); |
|
117 |
if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1); |
|
118 |
CurrentTeam^.FortName:= s |
|
119 |
end; |
|
120 |
||
121 |
procedure chFlag(var s: shortstring); |
|
122 |
begin |
|
123 |
if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/flag"', true); |
|
124 |
if s[1]='"' then Delete(s, 1, 1); |
|
125 |
if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1); |
|
126 |
CurrentTeam^.flag:= s |
|
127 |
end; |
|
128 |
||
129 |
procedure chScript(var s: shortstring); |
|
130 |
begin |
|
131 |
if s[1]='"' then Delete(s, 1, 1); |
|
132 |
if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1); |
|
6254
e90fb60cb46d
Force a desync if there is a script name mismatch. This avoids playing until the game desyncs due to script differences.
nemo
parents:
6245
diff
changeset
|
133 |
cScriptName:= s; |
4413 | 134 |
ScriptLoad(s) |
135 |
end; |
|
136 |
||
137 |
procedure chSetHat(var s: shortstring); |
|
138 |
begin |
|
139 |
if (not isDeveloperMode) or (CurrentTeam = nil) then exit; |
|
140 |
with CurrentTeam^ do |
|
141 |
begin |
|
142 |
if not CurrentHedgehog^.King then |
|
143 |
if (s = '') or |
|
144 |
(((GameFlags and gfKing) <> 0) and (s = 'crown')) or |
|
145 |
((Length(s) > 39) and (Copy(s,1,8) = 'Reserved') and (Copy(s,9,32) <> PlayerHash)) then |
|
146 |
CurrentHedgehog^.Hat:= 'NoHat' |
|
147 |
else |
|
148 |
CurrentHedgehog^.Hat:= s |
|
149 |
end; |
|
150 |
end; |
|
151 |
||
152 |
procedure chCurU_p(var s: shortstring); |
|
153 |
begin |
|
154 |
s:= s; // avoid compiler hint |
|
155 |
CursorMovementY:= -1; |
|
156 |
end; |
|
157 |
||
158 |
procedure chCurU_m(var s: shortstring); |
|
159 |
begin |
|
160 |
s:= s; // avoid compiler hint |
|
161 |
CursorMovementY:= 0; |
|
162 |
end; |
|
163 |
||
164 |
procedure chCurD_p(var s: shortstring); |
|
165 |
begin |
|
166 |
s:= s; // avoid compiler hint |
|
167 |
CursorMovementY:= 1; |
|
168 |
end; |
|
169 |
||
170 |
procedure chCurD_m(var s: shortstring); |
|
171 |
begin |
|
172 |
s:= s; // avoid compiler hint |
|
173 |
CursorMovementY:= 0; |
|
174 |
end; |
|
175 |
||
176 |
procedure chCurL_p(var s: shortstring); |
|
177 |
begin |
|
178 |
s:= s; // avoid compiler hint |
|
179 |
CursorMovementX:= -1; |
|
180 |
end; |
|
181 |
||
182 |
procedure chCurL_m(var s: shortstring); |
|
183 |
begin |
|
184 |
s:= s; // avoid compiler hint |
|
185 |
CursorMovementX:= 0; |
|
186 |
end; |
|
187 |
||
188 |
procedure chCurR_p(var s: shortstring); |
|
189 |
begin |
|
190 |
s:= s; // avoid compiler hint |
|
191 |
CursorMovementX:= 1; |
|
192 |
end; |
|
193 |
||
194 |
procedure chCurR_m(var s: shortstring); |
|
195 |
begin |
|
196 |
s:= s; // avoid compiler hint |
|
197 |
CursorMovementX:= 0; |
|
198 |
end; |
|
199 |
||
200 |
procedure chLeft_p(var s: shortstring); |
|
201 |
begin |
|
202 |
s:= s; // avoid compiler hint |
|
203 |
if CheckNoTeamOrHH or isPaused then exit; |
|
204 |
if not CurrentTeam^.ExtDriven then SendIPC('L'); |
|
205 |
bShowFinger:= false; |
|
206 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
207 |
Message:= Message or (gmLeft and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
208 |
ScriptCall('onLeft'); |
4413 | 209 |
end; |
210 |
||
211 |
procedure chLeft_m(var s: shortstring); |
|
212 |
begin |
|
213 |
s:= s; // avoid compiler hint |
|
214 |
if CheckNoTeamOrHH then exit; |
|
215 |
if not CurrentTeam^.ExtDriven then SendIPC('l'); |
|
216 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
217 |
Message:= Message and not (gmLeft and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
218 |
ScriptCall('onLeftUp'); |
4413 | 219 |
end; |
220 |
||
221 |
procedure chRight_p(var s: shortstring); |
|
222 |
begin |
|
223 |
s:= s; // avoid compiler hint |
|
224 |
if CheckNoTeamOrHH or isPaused then exit; |
|
225 |
if not CurrentTeam^.ExtDriven then SendIPC('R'); |
|
226 |
bShowFinger:= false; |
|
227 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
228 |
Message:= Message or (gmRight and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
229 |
ScriptCall('onRight'); |
4413 | 230 |
end; |
231 |
||
232 |
procedure chRight_m(var s: shortstring); |
|
233 |
begin |
|
234 |
s:= s; // avoid compiler hint |
|
235 |
if CheckNoTeamOrHH then exit; |
|
236 |
if not CurrentTeam^.ExtDriven then SendIPC('r'); |
|
237 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
238 |
Message:= Message and not (gmRight and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
239 |
ScriptCall('onRightUp'); |
4413 | 240 |
end; |
241 |
||
242 |
procedure chUp_p(var s: shortstring); |
|
243 |
begin |
|
244 |
s:= s; // avoid compiler hint |
|
245 |
if CheckNoTeamOrHH or isPaused then exit; |
|
246 |
if not CurrentTeam^.ExtDriven then SendIPC('U'); |
|
247 |
bShowFinger:= false; |
|
248 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
249 |
Message:= Message or (gmUp and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
250 |
ScriptCall('onUp'); |
4413 | 251 |
end; |
252 |
||
253 |
procedure chUp_m(var s: shortstring); |
|
254 |
begin |
|
255 |
s:= s; // avoid compiler hint |
|
256 |
if CheckNoTeamOrHH then exit; |
|
257 |
if not CurrentTeam^.ExtDriven then SendIPC('u'); |
|
258 |
with CurrentHedgehog^.Gear^ do |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
259 |
Message:= Message and not (gmUp and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
260 |
ScriptCall('onUpUp'); |
4413 | 261 |
end; |
262 |
||
263 |
procedure chDown_p(var s: shortstring); |
|
264 |
begin |
|
265 |
s:= s; // avoid compiler hint |
|
266 |
if CheckNoTeamOrHH or isPaused then exit; |
|
267 |
if not CurrentTeam^.ExtDriven then SendIPC('D'); |
|
268 |
bShowFinger:= false; |
|
269 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
270 |
Message:= Message or (gmDown and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
271 |
ScriptCall('onDown'); |
4413 | 272 |
end; |
273 |
||
274 |
procedure chDown_m(var s: shortstring); |
|
275 |
begin |
|
276 |
s:= s; // avoid compiler hint |
|
277 |
if CheckNoTeamOrHH then exit; |
|
278 |
if not CurrentTeam^.ExtDriven then SendIPC('d'); |
|
279 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
280 |
Message:= Message and not (gmDown and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
281 |
ScriptCall('onDownUp'); |
4413 | 282 |
end; |
283 |
||
284 |
procedure chPrecise_p(var s: shortstring); |
|
285 |
begin |
|
286 |
s:= s; // avoid compiler hint |
|
287 |
if CheckNoTeamOrHH or isPaused then exit; |
|
288 |
if not CurrentTeam^.ExtDriven then SendIPC('Z'); |
|
289 |
bShowFinger:= false; |
|
290 |
with CurrentHedgehog^.Gear^ do |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
291 |
Message:= Message or (gmPrecise and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
292 |
ScriptCall('onPrecise'); |
4413 | 293 |
end; |
294 |
||
295 |
procedure chPrecise_m(var s: shortstring); |
|
296 |
begin |
|
297 |
s:= s; // avoid compiler hint |
|
298 |
if CheckNoTeamOrHH then exit; |
|
299 |
if not CurrentTeam^.ExtDriven then SendIPC('z'); |
|
300 |
with CurrentHedgehog^.Gear^ do |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
301 |
Message:= Message and not (gmPrecise and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
302 |
ScriptCall('onPreciseUp'); |
4413 | 303 |
end; |
304 |
||
305 |
procedure chLJump(var s: shortstring); |
|
306 |
begin |
|
307 |
s:= s; // avoid compiler hint |
|
308 |
if CheckNoTeamOrHH or isPaused then exit; |
|
309 |
if not CurrentTeam^.ExtDriven then SendIPC('j'); |
|
310 |
bShowFinger:= false; |
|
311 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
312 |
Message:= Message or (gmLJump and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
313 |
ScriptCall('onLJump'); |
4413 | 314 |
end; |
315 |
||
316 |
procedure chHJump(var s: shortstring); |
|
317 |
begin |
|
318 |
s:= s; // avoid compiler hint |
|
319 |
if CheckNoTeamOrHH or isPaused then exit; |
|
320 |
if not CurrentTeam^.ExtDriven then SendIPC('J'); |
|
321 |
bShowFinger:= false; |
|
322 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
323 |
Message:= Message or (gmHJump and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
324 |
ScriptCall('onHJump'); |
4413 | 325 |
end; |
326 |
||
327 |
procedure chAttack_p(var s: shortstring); |
|
328 |
begin |
|
329 |
s:= s; // avoid compiler hint |
|
330 |
if CheckNoTeamOrHH or isPaused then exit; |
|
331 |
bShowFinger:= false; |
|
332 |
with CurrentHedgehog^.Gear^ do |
|
333 |
begin |
|
4900 | 334 |
AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State)); |
4413 | 335 |
if ((State and gstHHDriven) <> 0) then |
336 |
begin |
|
337 |
FollowGear:= CurrentHedgehog^.Gear; |
|
338 |
if not CurrentTeam^.ExtDriven then SendIPC('A'); |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
339 |
Message:= Message or (gmAttack and InputMask); |
5247 | 340 |
ScriptCall('onAttack'); |
4413 | 341 |
end |
342 |
end |
|
343 |
end; |
|
344 |
||
345 |
procedure chAttack_m(var s: shortstring); |
|
346 |
begin |
|
347 |
s:= s; // avoid compiler hint |
|
348 |
if CheckNoTeamOrHH then exit; |
|
349 |
with CurrentHedgehog^.Gear^ do |
|
350 |
begin |
|
351 |
if not CurrentTeam^.ExtDriven and |
|
352 |
((Message and gmAttack) <> 0) then SendIPC('a'); |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
353 |
Message:= Message and not (gmAttack and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
354 |
ScriptCall('onAttackUp'); |
4413 | 355 |
end |
356 |
end; |
|
357 |
||
358 |
procedure chSwitch(var s: shortstring); |
|
359 |
begin |
|
360 |
s:= s; // avoid compiler hint |
|
361 |
if CheckNoTeamOrHH or isPaused then exit; |
|
362 |
if not CurrentTeam^.ExtDriven then SendIPC('S'); |
|
363 |
bShowFinger:= false; |
|
364 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
365 |
Message:= Message or (gmSwitch and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
366 |
ScriptCall('onSwitch'); |
4413 | 367 |
end; |
368 |
||
369 |
procedure chNextTurn(var s: shortstring); |
|
370 |
begin |
|
371 |
s:= s; // avoid compiler hint |
|
372 |
TryDo(AllInactive, '/nextturn called when not all gears are inactive', true); |
|
373 |
||
374 |
if not CurrentTeam^.ExtDriven then SendIPC('N'); |
|
375 |
AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks)); |
|
376 |
end; |
|
377 |
||
378 |
procedure chTimer(var s: shortstring); |
|
379 |
begin |
|
380 |
if (s[0] <> #1) or (s[1] < '1') or (s[1] > '5') or CheckNoTeamOrHH then exit; |
|
381 |
||
382 |
if not CurrentTeam^.ExtDriven then SendIPC(s); |
|
383 |
bShowFinger:= false; |
|
384 |
with CurrentHedgehog^.Gear^ do |
|
385 |
begin |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
386 |
Message:= Message or (gmTimer and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
387 |
MsgParam:= byte(s[1]) - ord('0'); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
388 |
ScriptCall('onTimer'); |
4413 | 389 |
end |
390 |
end; |
|
391 |
||
392 |
procedure chSlot(var s: shortstring); |
|
393 |
var slot: LongWord; |
|
394 |
begin |
|
395 |
if (s[0] <> #1) or CheckNoTeamOrHH then exit; |
|
396 |
slot:= byte(s[1]) - 49; |
|
397 |
if slot > cMaxSlotIndex then exit; |
|
398 |
if not CurrentTeam^.ExtDriven then SendIPC(char(byte(s[1]) + 79)); |
|
399 |
bShowFinger:= false; |
|
400 |
with CurrentHedgehog^.Gear^ do |
|
401 |
begin |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
402 |
Message:= Message or (gmSlot and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
403 |
MsgParam:= slot; |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
404 |
ScriptCall('onSlot'); |
4413 | 405 |
end |
406 |
end; |
|
407 |
||
408 |
procedure chSetWeapon(var s: shortstring); |
|
409 |
begin |
|
410 |
if (s[0] <> #1) or CheckNoTeamOrHH then exit; |
|
411 |
||
412 |
if TAmmoType(s[1]) > High(TAmmoType) then exit; |
|
413 |
||
414 |
if not CurrentTeam^.ExtDriven then SendIPC('w' + s); |
|
415 |
||
416 |
with CurrentHedgehog^.Gear^ do |
|
417 |
begin |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
418 |
Message:= Message or (gmWeapon and InputMask); |
4413 | 419 |
MsgParam:= byte(s[1]); |
5247 | 420 |
ScriptCall('onSetWeapon'); |
4413 | 421 |
end; |
422 |
end; |
|
423 |
||
424 |
procedure chTaunt(var s: shortstring); |
|
425 |
begin |
|
426 |
if (s[0] <> #1) or CheckNoTeamOrHH then exit; |
|
427 |
||
428 |
if TWave(s[1]) > High(TWave) then exit; |
|
429 |
||
430 |
if not CurrentTeam^.ExtDriven then SendIPC('t' + s); |
|
431 |
||
432 |
with CurrentHedgehog^.Gear^ do |
|
433 |
begin |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
434 |
Message:= Message or (gmAnimate and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
435 |
MsgParam:= byte(s[1]) ; |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
436 |
ScriptCall('onTaunt'); |
4413 | 437 |
end |
438 |
end; |
|
439 |
||
440 |
procedure chPut(var s: shortstring); |
|
441 |
begin |
|
442 |
s:= s; // avoid compiler hint |
|
443 |
doPut(0, 0, false); |
|
444 |
end; |
|
445 |
||
446 |
procedure chCapture(var s: shortstring); |
|
447 |
begin |
|
448 |
s:= s; // avoid compiler hint |
|
449 |
flagMakeCapture:= true |
|
450 |
end; |
|
451 |
||
452 |
procedure chSetMap(var s: shortstring); |
|
453 |
begin |
|
5679
505c6448069b
accidentally reverted this when reverting the rest of the override changes.
nemo
parents:
5555
diff
changeset
|
454 |
if isDeveloperMode then |
6088 | 455 |
begin |
6339 | 456 |
if s = '' then |
457 |
begin |
|
458 |
UserPathz[ptMapCurrent]:= s; |
|
459 |
Pathz[ptMapCurrent]:= s; |
|
460 |
end |
|
461 |
else |
|
462 |
begin |
|
463 |
UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s; |
|
464 |
Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s; |
|
465 |
end; |
|
6088 | 466 |
InitStepsFlags:= InitStepsFlags or cifMap |
467 |
end; |
|
468 |
||
6245 | 469 |
ScriptLoad('Maps/' + s + '/map.lua') |
4413 | 470 |
end; |
471 |
||
472 |
procedure chSetTheme(var s: shortstring); |
|
473 |
begin |
|
474 |
if isDeveloperMode then |
|
475 |
begin |
|
5238
46ddaf14509d
Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents:
5026
diff
changeset
|
476 |
UserPathz[ptCurrTheme]:= UserPathz[ptThemes] + '/' + s; |
4413 | 477 |
Pathz[ptCurrTheme]:= Pathz[ptThemes] + '/' + s; |
4611 | 478 |
Theme:= s; |
4413 | 479 |
InitStepsFlags:= InitStepsFlags or cifTheme |
480 |
end |
|
481 |
end; |
|
482 |
||
483 |
procedure chSetSeed(var s: shortstring); |
|
484 |
begin |
|
485 |
if isDeveloperMode then |
|
486 |
begin |
|
487 |
SetRandomSeed(s); |
|
488 |
cSeed:= s; |
|
489 |
InitStepsFlags:= InitStepsFlags or cifRandomize |
|
490 |
end |
|
491 |
end; |
|
492 |
||
493 |
procedure chAmmoMenu(var s: shortstring); |
|
494 |
begin |
|
495 |
s:= s; // avoid compiler hint |
|
496 |
if CheckNoTeamOrHH then |
|
497 |
bShowAmmoMenu:= true |
|
498 |
else |
|
499 |
begin |
|
500 |
with CurrentTeam^ do |
|
501 |
with Hedgehogs[CurrHedgehog] do |
|
502 |
begin |
|
503 |
bSelected:= false; |
|
504 |
||
505 |
if bShowAmmoMenu then bShowAmmoMenu:= false |
|
506 |
else if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) or |
|
507 |
((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) or |
|
508 |
((Gear^.State and gstHHDriven) = 0) then else bShowAmmoMenu:= true |
|
509 |
end; |
|
510 |
end |
|
511 |
end; |
|
512 |
||
513 |
procedure chVol_p(var s: shortstring); |
|
514 |
begin |
|
515 |
s:= s; // avoid compiler hint |
|
516 |
inc(cVolumeDelta, 3) |
|
517 |
end; |
|
518 |
||
519 |
procedure chVol_m(var s: shortstring); |
|
520 |
begin |
|
521 |
s:= s; // avoid compiler hint |
|
522 |
dec(cVolumeDelta, 3) |
|
523 |
end; |
|
524 |
||
525 |
procedure chFindhh(var s: shortstring); |
|
526 |
begin |
|
527 |
s:= s; // avoid compiler hint |
|
528 |
if CheckNoTeamOrHH or isPaused then exit; |
|
5247 | 529 |
|
530 |
if FollowGear <> nil then |
|
531 |
begin |
|
532 |
AddCaption('Auto Camera Off', $CCCCCC, capgrpVolume); |
|
533 |
autoCameraOn:= false |
|
534 |
end |
|
535 |
else begin |
|
536 |
AddCaption('Auto Camera On', $CCCCCC, capgrpVolume); |
|
537 |
bShowFinger:= true; |
|
6304
3036c242b19d
Set CurrentAmmoGear on piano (should fix notes again). Also disable focus on current hog if unplaced.
nemo
parents:
6254
diff
changeset
|
538 |
if not CurrentHedgehog^.Unplaced then FollowGear:= CurrentHedgehog^.Gear; |
5247 | 539 |
autoCameraOn:= true |
540 |
end |
|
4413 | 541 |
end; |
542 |
||
543 |
procedure chPause(var s: shortstring); |
|
544 |
begin |
|
545 |
s:= s; // avoid compiler hint |
|
546 |
if gameType <> gmtNet then |
|
547 |
isPaused:= not isPaused; |
|
5524
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
548 |
|
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
549 |
if isPaused then |
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
550 |
SDL_ShowCursor(1) |
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
551 |
else |
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
552 |
SDL_ShowCursor(ord(GameState = gsConfirm)) |
4413 | 553 |
end; |
554 |
||
555 |
procedure chRotateMask(var s: shortstring); |
|
556 |
begin |
|
557 |
s:= s; // avoid compiler hint |
|
558 |
if ((GameFlags and gfInvulnerable) = 0) then cTagsMask:= cTagsMasks[cTagsMask] else cTagsMask:= cTagsMasksNoHealth[cTagsMask]; |
|
559 |
end; |
|
560 |
||
561 |
procedure chSpeedup_p(var s: shortstring); |
|
562 |
begin |
|
563 |
s:= s; // avoid compiler hint |
|
564 |
isSpeed:= true |
|
565 |
end; |
|
566 |
||
567 |
procedure chSpeedup_m(var s: shortstring); |
|
568 |
begin |
|
569 |
s:= s; // avoid compiler hint |
|
570 |
isSpeed:= false |
|
571 |
end; |
|
572 |
||
573 |
procedure chZoomIn(var s: shortstring); |
|
574 |
begin |
|
575 |
s:= s; // avoid compiler hint |
|
576 |
if ZoomValue < cMinZoomLevel then |
|
577 |
ZoomValue:= ZoomValue + cZoomDelta; |
|
578 |
end; |
|
579 |
||
580 |
procedure chZoomOut(var s: shortstring); |
|
581 |
begin |
|
582 |
s:= s; // avoid compiler hint |
|
583 |
if ZoomValue > cMaxZoomLevel then |
|
584 |
ZoomValue:= ZoomValue - cZoomDelta; |
|
585 |
end; |
|
586 |
||
587 |
procedure chZoomReset(var s: shortstring); |
|
588 |
begin |
|
589 |
s:= s; // avoid compiler hint |
|
590 |
ZoomValue:= cDefaultZoomLevel; |
|
591 |
end; |
|
592 |
||
593 |
||
594 |
procedure initModule; |
|
595 |
begin |
|
4528
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
596 |
//////// Begin top sorted by freq analysis not including chatmsg |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
597 |
RegisterVariable('+right' , vtCommand, @chRight_p , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
598 |
RegisterVariable('-right' , vtCommand, @chRight_m , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
599 |
RegisterVariable('+up' , vtCommand, @chUp_p , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
600 |
RegisterVariable('-up' , vtCommand, @chUp_m , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
601 |
RegisterVariable('+left' , vtCommand, @chLeft_p , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
602 |
RegisterVariable('-left' , vtCommand, @chLeft_m , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
603 |
RegisterVariable('+attack' , vtCommand, @chAttack_p , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
604 |
RegisterVariable('+down' , vtCommand, @chDown_p , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
605 |
RegisterVariable('-down' , vtCommand, @chDown_m , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
606 |
RegisterVariable('hjump' , vtCommand, @chHJump , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
607 |
RegisterVariable('ljump' , vtCommand, @chLJump , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
608 |
RegisterVariable('nextturn', vtCommand, @chNextTurn , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
609 |
RegisterVariable('-attack' , vtCommand, @chAttack_m , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
610 |
RegisterVariable('slot' , vtCommand, @chSlot , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
611 |
RegisterVariable('setweap' , vtCommand, @chSetWeapon , false); |
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
612 |
//////// End top by freq analysis |
4531
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
613 |
RegisterVariable('gencmd' , vtCommand, @chGenCmd , false); |
4413 | 614 |
RegisterVariable('flag' , vtCommand, @chFlag , false); |
615 |
RegisterVariable('script' , vtCommand, @chScript , false); |
|
616 |
RegisterVariable('proto' , vtCommand, @chCheckProto , true ); |
|
617 |
RegisterVariable('spectate', vtBoolean, @fastUntilLag , false); |
|
618 |
RegisterVariable('capture' , vtCommand, @chCapture , true ); |
|
619 |
RegisterVariable('rotmask' , vtCommand, @chRotateMask , true ); |
|
620 |
RegisterVariable('rdriven' , vtCommand, @chTeamLocal , false); |
|
621 |
RegisterVariable('map' , vtCommand, @chSetMap , false); |
|
622 |
RegisterVariable('theme' , vtCommand, @chSetTheme , false); |
|
623 |
RegisterVariable('seed' , vtCommand, @chSetSeed , false); |
|
624 |
RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false); |
|
625 |
RegisterVariable('mapgen' , vtLongInt, @cMapGen , false); |
|
6313
12567f6f6f02
Make mazes filter use same variable as template filter
nemo
parents:
6304
diff
changeset
|
626 |
RegisterVariable('maze_size',vtLongInt, @cTemplateFilter, false); |
4413 | 627 |
RegisterVariable('delay' , vtLongInt, @cInactDelay , false); |
628 |
RegisterVariable('ready' , vtLongInt, @cReadyDelay , false); |
|
629 |
RegisterVariable('casefreq', vtLongInt, @cCaseFactor , false); |
|
630 |
RegisterVariable('healthprob', vtLongInt, @cHealthCaseProb, false); |
|
631 |
RegisterVariable('hcaseamount', vtLongInt, @cHealthCaseAmount, false); |
|
632 |
RegisterVariable('sd_turns', vtLongInt, @cSuddenDTurns , false); |
|
633 |
RegisterVariable('waterrise', vtLongInt, @cWaterRise , false); |
|
634 |
RegisterVariable('healthdec', vtLongInt, @cHealthDecrease, false); |
|
635 |
RegisterVariable('damagepct',vtLongInt, @cDamagePercent , false); |
|
636 |
RegisterVariable('ropepct' , vtLongInt, @cRopePercent , false); |
|
5026 | 637 |
RegisterVariable('getawaytime' , vtLongInt, @cGetAwayTime , false); |
4413 | 638 |
RegisterVariable('minedudpct',vtLongInt,@cMineDudPercent, false); |
639 |
RegisterVariable('minesnum', vtLongInt, @cLandMines , false); |
|
640 |
RegisterVariable('explosives',vtLongInt,@cExplosives , false); |
|
641 |
RegisterVariable('gmflags' , vtLongInt, @GameFlags , false); |
|
642 |
RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false); |
|
643 |
RegisterVariable('minestime',vtLongInt, @cMinesTime , false); |
|
644 |
RegisterVariable('fort' , vtCommand, @chFort , false); |
|
645 |
RegisterVariable('grave' , vtCommand, @chGrave , false); |
|
646 |
RegisterVariable('hat' , vtCommand, @chSetHat , false); |
|
647 |
RegisterVariable('quit' , vtCommand, @chQuit , true ); |
|
4744
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
648 |
RegisterVariable('forcequit', vtCommand, @chForceQuit , true ); |
4413 | 649 |
RegisterVariable('confirm' , vtCommand, @chConfirm , true ); |
4751 | 650 |
RegisterVariable('halt', vtCommand, @chHalt , true ); |
4413 | 651 |
RegisterVariable('+speedup', vtCommand, @chSpeedup_p , true ); |
652 |
RegisterVariable('-speedup', vtCommand, @chSpeedup_m , true ); |
|
653 |
RegisterVariable('zoomin' , vtCommand, @chZoomIn , true ); |
|
654 |
RegisterVariable('zoomout' , vtCommand, @chZoomOut , true ); |
|
655 |
RegisterVariable('zoomreset',vtCommand, @chZoomReset , true ); |
|
656 |
RegisterVariable('ammomenu', vtCommand, @chAmmoMenu , true); |
|
657 |
RegisterVariable('+precise', vtCommand, @chPrecise_p , false); |
|
658 |
RegisterVariable('-precise', vtCommand, @chPrecise_m , false); |
|
659 |
RegisterVariable('switch' , vtCommand, @chSwitch , false); |
|
660 |
RegisterVariable('timer' , vtCommand, @chTimer , false); |
|
661 |
RegisterVariable('taunt' , vtCommand, @chTaunt , false); |
|
662 |
RegisterVariable('put' , vtCommand, @chPut , false); |
|
663 |
RegisterVariable('+volup' , vtCommand, @chVol_p , true ); |
|
664 |
RegisterVariable('-volup' , vtCommand, @chVol_m , true ); |
|
665 |
RegisterVariable('+voldown', vtCommand, @chVol_m , true ); |
|
666 |
RegisterVariable('-voldown', vtCommand, @chVol_p , true ); |
|
667 |
RegisterVariable('findhh' , vtCommand, @chFindhh , true ); |
|
668 |
RegisterVariable('pause' , vtCommand, @chPause , true ); |
|
669 |
RegisterVariable('+cur_u' , vtCommand, @chCurU_p , true ); |
|
670 |
RegisterVariable('-cur_u' , vtCommand, @chCurU_m , true ); |
|
671 |
RegisterVariable('+cur_d' , vtCommand, @chCurD_p , true ); |
|
672 |
RegisterVariable('-cur_d' , vtCommand, @chCurD_m , true ); |
|
673 |
RegisterVariable('+cur_l' , vtCommand, @chCurL_p , true ); |
|
674 |
RegisterVariable('-cur_l' , vtCommand, @chCurL_m , true ); |
|
675 |
RegisterVariable('+cur_r' , vtCommand, @chCurR_p , true ); |
|
676 |
RegisterVariable('-cur_r' , vtCommand, @chCurR_m , true ); |
|
677 |
end; |
|
678 |
||
679 |
procedure freeModule; |
|
680 |
begin |
|
681 |
end; |
|
682 |
||
683 |
end. |