author | sheepluva |
Mon, 31 Oct 2011 21:04:18 +0100 | |
changeset 6258 | ba9defb98a70 |
parent 6254 | e90fb60cb46d |
child 6304 | 3036c242b19d |
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 |
456 |
UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s; |
|
457 |
Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s; |
|
458 |
InitStepsFlags:= InitStepsFlags or cifMap |
|
459 |
end; |
|
460 |
||
6245 | 461 |
ScriptLoad('Maps/' + s + '/map.lua') |
4413 | 462 |
end; |
463 |
||
464 |
procedure chSetTheme(var s: shortstring); |
|
465 |
begin |
|
466 |
if isDeveloperMode then |
|
467 |
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
|
468 |
UserPathz[ptCurrTheme]:= UserPathz[ptThemes] + '/' + s; |
4413 | 469 |
Pathz[ptCurrTheme]:= Pathz[ptThemes] + '/' + s; |
4611 | 470 |
Theme:= s; |
4413 | 471 |
InitStepsFlags:= InitStepsFlags or cifTheme |
472 |
end |
|
473 |
end; |
|
474 |
||
475 |
procedure chSetSeed(var s: shortstring); |
|
476 |
begin |
|
477 |
if isDeveloperMode then |
|
478 |
begin |
|
479 |
SetRandomSeed(s); |
|
480 |
cSeed:= s; |
|
481 |
InitStepsFlags:= InitStepsFlags or cifRandomize |
|
482 |
end |
|
483 |
end; |
|
484 |
||
485 |
procedure chAmmoMenu(var s: shortstring); |
|
486 |
begin |
|
487 |
s:= s; // avoid compiler hint |
|
488 |
if CheckNoTeamOrHH then |
|
489 |
bShowAmmoMenu:= true |
|
490 |
else |
|
491 |
begin |
|
492 |
with CurrentTeam^ do |
|
493 |
with Hedgehogs[CurrHedgehog] do |
|
494 |
begin |
|
495 |
bSelected:= false; |
|
496 |
||
497 |
if bShowAmmoMenu then bShowAmmoMenu:= false |
|
498 |
else if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) or |
|
499 |
((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) or |
|
500 |
((Gear^.State and gstHHDriven) = 0) then else bShowAmmoMenu:= true |
|
501 |
end; |
|
502 |
end |
|
503 |
end; |
|
504 |
||
505 |
procedure chVol_p(var s: shortstring); |
|
506 |
begin |
|
507 |
s:= s; // avoid compiler hint |
|
508 |
inc(cVolumeDelta, 3) |
|
509 |
end; |
|
510 |
||
511 |
procedure chVol_m(var s: shortstring); |
|
512 |
begin |
|
513 |
s:= s; // avoid compiler hint |
|
514 |
dec(cVolumeDelta, 3) |
|
515 |
end; |
|
516 |
||
517 |
procedure chFindhh(var s: shortstring); |
|
518 |
begin |
|
519 |
s:= s; // avoid compiler hint |
|
520 |
if CheckNoTeamOrHH or isPaused then exit; |
|
5247 | 521 |
|
522 |
if FollowGear <> nil then |
|
523 |
begin |
|
524 |
AddCaption('Auto Camera Off', $CCCCCC, capgrpVolume); |
|
525 |
autoCameraOn:= false |
|
526 |
end |
|
527 |
else begin |
|
528 |
AddCaption('Auto Camera On', $CCCCCC, capgrpVolume); |
|
529 |
bShowFinger:= true; |
|
530 |
FollowGear:= CurrentHedgehog^.Gear; |
|
531 |
autoCameraOn:= true |
|
532 |
end |
|
4413 | 533 |
end; |
534 |
||
535 |
procedure chPause(var s: shortstring); |
|
536 |
begin |
|
537 |
s:= s; // avoid compiler hint |
|
538 |
if gameType <> gmtNet then |
|
539 |
isPaused:= not isPaused; |
|
5524
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
540 |
|
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
541 |
if isPaused then |
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
542 |
SDL_ShowCursor(1) |
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
543 |
else |
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
544 |
SDL_ShowCursor(ord(GameState = gsConfirm)) |
4413 | 545 |
end; |
546 |
||
547 |
procedure chRotateMask(var s: shortstring); |
|
548 |
begin |
|
549 |
s:= s; // avoid compiler hint |
|
550 |
if ((GameFlags and gfInvulnerable) = 0) then cTagsMask:= cTagsMasks[cTagsMask] else cTagsMask:= cTagsMasksNoHealth[cTagsMask]; |
|
551 |
end; |
|
552 |
||
553 |
procedure chSpeedup_p(var s: shortstring); |
|
554 |
begin |
|
555 |
s:= s; // avoid compiler hint |
|
556 |
isSpeed:= true |
|
557 |
end; |
|
558 |
||
559 |
procedure chSpeedup_m(var s: shortstring); |
|
560 |
begin |
|
561 |
s:= s; // avoid compiler hint |
|
562 |
isSpeed:= false |
|
563 |
end; |
|
564 |
||
565 |
procedure chZoomIn(var s: shortstring); |
|
566 |
begin |
|
567 |
s:= s; // avoid compiler hint |
|
568 |
if ZoomValue < cMinZoomLevel then |
|
569 |
ZoomValue:= ZoomValue + cZoomDelta; |
|
570 |
end; |
|
571 |
||
572 |
procedure chZoomOut(var s: shortstring); |
|
573 |
begin |
|
574 |
s:= s; // avoid compiler hint |
|
575 |
if ZoomValue > cMaxZoomLevel then |
|
576 |
ZoomValue:= ZoomValue - cZoomDelta; |
|
577 |
end; |
|
578 |
||
579 |
procedure chZoomReset(var s: shortstring); |
|
580 |
begin |
|
581 |
s:= s; // avoid compiler hint |
|
582 |
ZoomValue:= cDefaultZoomLevel; |
|
583 |
end; |
|
584 |
||
585 |
||
586 |
procedure initModule; |
|
587 |
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
|
588 |
//////// 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
|
589 |
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
|
590 |
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
|
591 |
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
|
592 |
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
|
593 |
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
|
594 |
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
|
595 |
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
|
596 |
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
|
597 |
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
|
598 |
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
|
599 |
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
|
600 |
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
|
601 |
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
|
602 |
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
|
603 |
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
|
604 |
//////// End top by freq analysis |
4531
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
605 |
RegisterVariable('gencmd' , vtCommand, @chGenCmd , false); |
4413 | 606 |
RegisterVariable('flag' , vtCommand, @chFlag , false); |
607 |
RegisterVariable('script' , vtCommand, @chScript , false); |
|
608 |
RegisterVariable('proto' , vtCommand, @chCheckProto , true ); |
|
609 |
RegisterVariable('spectate', vtBoolean, @fastUntilLag , false); |
|
610 |
RegisterVariable('capture' , vtCommand, @chCapture , true ); |
|
611 |
RegisterVariable('rotmask' , vtCommand, @chRotateMask , true ); |
|
612 |
RegisterVariable('rdriven' , vtCommand, @chTeamLocal , false); |
|
613 |
RegisterVariable('map' , vtCommand, @chSetMap , false); |
|
614 |
RegisterVariable('theme' , vtCommand, @chSetTheme , false); |
|
615 |
RegisterVariable('seed' , vtCommand, @chSetSeed , false); |
|
616 |
RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false); |
|
617 |
RegisterVariable('mapgen' , vtLongInt, @cMapGen , false); |
|
618 |
RegisterVariable('maze_size',vtLongInt, @cMazeSize , false); |
|
619 |
RegisterVariable('delay' , vtLongInt, @cInactDelay , false); |
|
620 |
RegisterVariable('ready' , vtLongInt, @cReadyDelay , false); |
|
621 |
RegisterVariable('casefreq', vtLongInt, @cCaseFactor , false); |
|
622 |
RegisterVariable('healthprob', vtLongInt, @cHealthCaseProb, false); |
|
623 |
RegisterVariable('hcaseamount', vtLongInt, @cHealthCaseAmount, false); |
|
624 |
RegisterVariable('sd_turns', vtLongInt, @cSuddenDTurns , false); |
|
625 |
RegisterVariable('waterrise', vtLongInt, @cWaterRise , false); |
|
626 |
RegisterVariable('healthdec', vtLongInt, @cHealthDecrease, false); |
|
627 |
RegisterVariable('damagepct',vtLongInt, @cDamagePercent , false); |
|
628 |
RegisterVariable('ropepct' , vtLongInt, @cRopePercent , false); |
|
5026 | 629 |
RegisterVariable('getawaytime' , vtLongInt, @cGetAwayTime , false); |
4413 | 630 |
RegisterVariable('minedudpct',vtLongInt,@cMineDudPercent, false); |
631 |
RegisterVariable('minesnum', vtLongInt, @cLandMines , false); |
|
632 |
RegisterVariable('explosives',vtLongInt,@cExplosives , false); |
|
633 |
RegisterVariable('gmflags' , vtLongInt, @GameFlags , false); |
|
634 |
RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false); |
|
635 |
RegisterVariable('minestime',vtLongInt, @cMinesTime , false); |
|
636 |
RegisterVariable('fort' , vtCommand, @chFort , false); |
|
637 |
RegisterVariable('grave' , vtCommand, @chGrave , false); |
|
638 |
RegisterVariable('hat' , vtCommand, @chSetHat , false); |
|
639 |
RegisterVariable('quit' , vtCommand, @chQuit , true ); |
|
4744
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
640 |
RegisterVariable('forcequit', vtCommand, @chForceQuit , true ); |
4413 | 641 |
RegisterVariable('confirm' , vtCommand, @chConfirm , true ); |
4751 | 642 |
RegisterVariable('halt', vtCommand, @chHalt , true ); |
4413 | 643 |
RegisterVariable('+speedup', vtCommand, @chSpeedup_p , true ); |
644 |
RegisterVariable('-speedup', vtCommand, @chSpeedup_m , true ); |
|
645 |
RegisterVariable('zoomin' , vtCommand, @chZoomIn , true ); |
|
646 |
RegisterVariable('zoomout' , vtCommand, @chZoomOut , true ); |
|
647 |
RegisterVariable('zoomreset',vtCommand, @chZoomReset , true ); |
|
648 |
RegisterVariable('ammomenu', vtCommand, @chAmmoMenu , true); |
|
649 |
RegisterVariable('+precise', vtCommand, @chPrecise_p , false); |
|
650 |
RegisterVariable('-precise', vtCommand, @chPrecise_m , false); |
|
651 |
RegisterVariable('switch' , vtCommand, @chSwitch , false); |
|
652 |
RegisterVariable('timer' , vtCommand, @chTimer , false); |
|
653 |
RegisterVariable('taunt' , vtCommand, @chTaunt , false); |
|
654 |
RegisterVariable('put' , vtCommand, @chPut , false); |
|
655 |
RegisterVariable('+volup' , vtCommand, @chVol_p , true ); |
|
656 |
RegisterVariable('-volup' , vtCommand, @chVol_m , true ); |
|
657 |
RegisterVariable('+voldown', vtCommand, @chVol_m , true ); |
|
658 |
RegisterVariable('-voldown', vtCommand, @chVol_p , true ); |
|
659 |
RegisterVariable('findhh' , vtCommand, @chFindhh , true ); |
|
660 |
RegisterVariable('pause' , vtCommand, @chPause , true ); |
|
661 |
RegisterVariable('+cur_u' , vtCommand, @chCurU_p , true ); |
|
662 |
RegisterVariable('-cur_u' , vtCommand, @chCurU_m , true ); |
|
663 |
RegisterVariable('+cur_d' , vtCommand, @chCurD_p , true ); |
|
664 |
RegisterVariable('-cur_d' , vtCommand, @chCurD_m , true ); |
|
665 |
RegisterVariable('+cur_l' , vtCommand, @chCurL_p , true ); |
|
666 |
RegisterVariable('-cur_l' , vtCommand, @chCurL_m , true ); |
|
667 |
RegisterVariable('+cur_r' , vtCommand, @chCurR_p , true ); |
|
668 |
RegisterVariable('-cur_r' , vtCommand, @chCurR_m , true ); |
|
669 |
end; |
|
670 |
||
671 |
procedure freeModule; |
|
672 |
begin |
|
673 |
end; |
|
674 |
||
675 |
end. |