author | unc0rr |
Thu, 02 Apr 2015 21:09:56 +0300 | |
branch | qmlfrontend |
changeset 10886 | 99273b7afbff |
parent 10819 | 57e21f7621b0 |
child 10888 | a04e04aaf599 |
permissions | -rw-r--r-- |
10406 | 1 |
unit uFLGameConfig; |
2 |
interface |
|
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
3 |
uses uFLTypes; |
10406 | 4 |
|
10430 | 5 |
procedure resetGameConfig; cdecl; |
6 |
procedure runQuickGame; cdecl; |
|
10448 | 7 |
procedure runLocalGame; cdecl; |
10430 | 8 |
procedure getPreview; cdecl; |
10406 | 9 |
|
10430 | 10 |
procedure registerGUIMessagesCallback(p: pointer; f: TGUICallback); cdecl; |
11 |
||
12 |
procedure setSeed(seed: PChar); cdecl; |
|
13 |
function getSeed: PChar; cdecl; |
|
10456 | 14 |
procedure setTheme(themeName: PChar); cdecl; |
10612 | 15 |
procedure setScript(scriptName: PChar); cdecl; |
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
16 |
procedure setScheme(schemeName: PChar); cdecl; |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
17 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
18 |
procedure tryAddTeam(teamName: PChar); cdecl; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
19 |
procedure tryRemoveTeam(teamName: PChar); cdecl; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
20 |
procedure changeTeamColor(teamName: PChar; dir: LongInt); cdecl; |
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
21 |
|
10406 | 22 |
implementation |
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
23 |
uses uFLIPC, hwengine, uFLUtils, uFLTeams, uFLData, uFLSChemes; |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
24 |
|
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
25 |
var guiCallbackPointer: pointer; |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
26 |
guiCallbackFunction: TGUICallback; |
10406 | 27 |
|
10426 | 28 |
const |
29 |
MAXCONFIGS = 5; |
|
30 |
MAXARGS = 32; |
|
31 |
||
32 |
type |
|
33 |
TGameConfig = record |
|
34 |
seed: shortstring; |
|
35 |
theme: shortstring; |
|
36 |
script: shortstring; |
|
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
37 |
scheme: TScheme; |
10432 | 38 |
mapgen: Longint; |
10426 | 39 |
gameType: TGameType; |
40 |
teams: array[0..7] of TTeam; |
|
41 |
arguments: array[0..Pred(MAXARGS)] of shortstring; |
|
42 |
argv: array[0..Pred(MAXARGS)] of PChar; |
|
43 |
argumentsNumber: Longword; |
|
44 |
end; |
|
45 |
PGameConfig = ^TGameConfig; |
|
46 |
||
10432 | 47 |
var |
48 |
currentConfig: TGameConfig; |
|
49 |
||
10430 | 50 |
|
10432 | 51 |
procedure sendConfig(config: PGameConfig); |
52 |
var i: Longword; |
|
53 |
begin |
|
54 |
with config^ do |
|
10430 | 55 |
begin |
10432 | 56 |
case gameType of |
57 |
gtPreview: begin |
|
10612 | 58 |
if script <> '' then |
59 |
ipcToEngine('escript ' + script); |
|
10432 | 60 |
ipcToEngine('eseed ' + seed); |
61 |
ipcToEngine('e$mapgen ' + intToStr(mapgen)); |
|
62 |
end; |
|
63 |
gtLocal: begin |
|
10612 | 64 |
if script <> '' then |
65 |
ipcToEngine('escript ' + script); |
|
10432 | 66 |
ipcToEngine('eseed ' + seed); |
67 |
ipcToEngine('e$mapgen ' + intToStr(mapgen)); |
|
10456 | 68 |
ipcToEngine('e$theme ' + theme); |
10612 | 69 |
|
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
70 |
sendSchemeConfig(scheme); |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
71 |
|
10432 | 72 |
i:= 0; |
73 |
while (i < 8) and (teams[i].hogsNumber > 0) do |
|
74 |
begin |
|
75 |
ipcToEngine('eammloadt 93919294221991210322351110012000000002111001010111110001'); |
|
76 |
ipcToEngine('eammprob 04050405416006555465544647765766666661555101011154111111'); |
|
77 |
ipcToEngine('eammdelay 00000000000002055000000400070040000000002200000006000200'); |
|
78 |
ipcToEngine('eammreinf 13111103121111111231141111111111111112111111011111111111'); |
|
79 |
ipcToEngine('eammstore'); |
|
80 |
sendTeamConfig(teams[i]); |
|
81 |
inc(i) |
|
82 |
end; |
|
83 |
end; |
|
84 |
end; |
|
85 |
||
86 |
ipcToEngine('!'); |
|
87 |
end; |
|
88 |
end; |
|
10426 | 89 |
|
90 |
procedure queueExecution; |
|
91 |
var pConfig: PGameConfig; |
|
92 |
i: Longword; |
|
93 |
begin |
|
94 |
new(pConfig); |
|
95 |
pConfig^:= currentConfig; |
|
96 |
||
97 |
with pConfig^ do |
|
98 |
for i:= 0 to Pred(MAXARGS) do |
|
99 |
begin |
|
100 |
if arguments[i][0] = #255 then |
|
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
101 |
arguments[i][255]:= #0 |
10426 | 102 |
else |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
103 |
arguments[i][byte(arguments[i][0]) + 1]:= #0; |
10426 | 104 |
argv[i]:= @arguments[i][1] |
105 |
end; |
|
106 |
||
107 |
RunEngine(pConfig^.argumentsNumber, @pConfig^.argv); |
|
10432 | 108 |
|
109 |
sendConfig(pConfig) |
|
10426 | 110 |
end; |
111 |
||
112 |
procedure resetGameConfig; cdecl; |
|
10450 | 113 |
var i: Longword; |
10406 | 114 |
begin |
10450 | 115 |
with currentConfig do |
116 |
begin |
|
117 |
for i:= 0 to 7 do |
|
118 |
teams[i].hogsNumber:= 0 |
|
119 |
end |
|
10406 | 120 |
end; |
121 |
||
10430 | 122 |
procedure setSeed(seed: PChar); cdecl; |
123 |
begin |
|
124 |
currentConfig.seed:= seed |
|
125 |
end; |
|
126 |
||
10448 | 127 |
|
10430 | 128 |
function getSeed: PChar; cdecl; |
129 |
begin |
|
130 |
getSeed:= str2PChar(currentConfig.seed) |
|
131 |
end; |
|
132 |
||
10450 | 133 |
function getUnusedColor: Longword; |
10448 | 134 |
var i, c: Longword; |
135 |
fColorMatched: boolean; |
|
136 |
begin |
|
137 |
c:= 0; |
|
138 |
i:= 0; |
|
139 |
repeat |
|
140 |
repeat |
|
10450 | 141 |
fColorMatched:= (currentConfig.teams[i].hogsNumber > 0) and (currentConfig.teams[i].color = c); |
10448 | 142 |
inc(i) |
143 |
until (i >= 8) or (currentConfig.teams[i].hogsNumber = 0) or fColorMatched; |
|
144 |
||
145 |
if fColorMatched then |
|
146 |
begin |
|
147 |
i:= 0; |
|
148 |
inc(c) |
|
149 |
end; |
|
150 |
until not fColorMatched; |
|
151 |
||
10450 | 152 |
getUnusedColor:= c |
10448 | 153 |
end; |
154 |
||
10430 | 155 |
procedure runQuickGame; cdecl; |
10426 | 156 |
begin |
10432 | 157 |
with currentConfig do |
158 |
begin |
|
159 |
gameType:= gtLocal; |
|
160 |
arguments[0]:= ''; |
|
161 |
arguments[1]:= '--internal'; |
|
10448 | 162 |
arguments[2]:= '--nomusic'; |
10432 | 163 |
argumentsNumber:= 3; |
10426 | 164 |
|
10432 | 165 |
teams[0]:= createRandomTeam; |
10450 | 166 |
teams[0].color:= 0; |
10432 | 167 |
teams[1]:= createRandomTeam; |
10450 | 168 |
teams[1].color:= 1; |
10432 | 169 |
teams[1].botLevel:= 1; |
170 |
||
171 |
queueExecution; |
|
172 |
end; |
|
10426 | 173 |
end; |
174 |
||
10448 | 175 |
|
10430 | 176 |
procedure getPreview; cdecl; |
10426 | 177 |
begin |
178 |
with currentConfig do |
|
179 |
begin |
|
180 |
gameType:= gtPreview; |
|
181 |
arguments[0]:= ''; |
|
182 |
arguments[1]:= '--internal'; |
|
183 |
arguments[2]:= '--landpreview'; |
|
184 |
argumentsNumber:= 3; |
|
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
185 |
|
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
186 |
queueExecution; |
10426 | 187 |
end; |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
188 |
end; |
10426 | 189 |
|
10448 | 190 |
procedure runLocalGame; cdecl; |
191 |
begin |
|
192 |
with currentConfig do |
|
193 |
begin |
|
194 |
gameType:= gtLocal; |
|
195 |
arguments[0]:= ''; |
|
196 |
arguments[1]:= '--internal'; |
|
197 |
arguments[2]:= '--nomusic'; |
|
198 |
argumentsNumber:= 3; |
|
199 |
||
200 |
queueExecution; |
|
201 |
end; |
|
202 |
end; |
|
203 |
||
204 |
||
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
205 |
procedure engineMessageCallback(p: pointer; msg: PChar; len: Longword); |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
206 |
begin |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
207 |
if len = 128 * 256 then guiCallbackFunction(guiCallbackPointer, mtPreview, msg, len) |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
208 |
end; |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
209 |
|
10430 | 210 |
procedure registerGUIMessagesCallback(p: pointer; f: TGUICallback); cdecl; |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
211 |
begin |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
212 |
guiCallbackPointer:= p; |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
213 |
guiCallbackFunction:= f; |
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
214 |
|
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
215 |
registerIPCCallback(nil, @engineMessageCallback) |
10426 | 216 |
end; |
217 |
||
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
218 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
219 |
procedure tryAddTeam(teamName: PChar); cdecl; |
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
220 |
var msg: ansistring; |
10446 | 221 |
i, hn, hedgehogsNumber: Longword; |
222 |
team: PTeam; |
|
10450 | 223 |
c: Longword; |
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
224 |
begin |
10446 | 225 |
with currentConfig do |
226 |
begin |
|
227 |
hedgehogsNumber:= 0; |
|
228 |
i:= 0; |
|
229 |
||
230 |
while (i < 8) and (teams[i].hogsNumber > 0) do |
|
231 |
begin |
|
232 |
inc(i); |
|
233 |
inc(hedgehogsNumber, teams[i].hogsNumber) |
|
234 |
end; |
|
235 |
||
236 |
// no free space for a team or reached hogs number maximum |
|
237 |
if (i > 7) or (hedgehogsNumber >= 48) then exit; |
|
238 |
||
239 |
team:= teamByName(teamName); |
|
240 |
if team = nil then exit; |
|
241 |
||
10448 | 242 |
c:= getUnusedColor; |
243 |
||
10446 | 244 |
teams[i]:= team^; |
245 |
||
246 |
if i = 0 then hn:= 4 else hn:= teams[i - 1].hogsNumber; |
|
247 |
if hn > 48 - hedgehogsNumber then hn:= 48 - hedgehogsNumber; |
|
248 |
teams[i].hogsNumber:= hn; |
|
10448 | 249 |
|
250 |
teams[i].color:= c; |
|
10446 | 251 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
252 |
msg:= '0' + #10 + teamName; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
253 |
guiCallbackFunction(guiCallbackPointer, mtAddPlayingTeam, @msg[1], length(msg)); |
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
254 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
255 |
msg:= teamName + #10 + colorsSet[teams[i].color]; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
256 |
guiCallbackFunction(guiCallbackPointer, mtTeamColor, @msg[1], length(msg)); |
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
257 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
258 |
msg:= teamName; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
259 |
guiCallbackFunction(guiCallbackPointer, mtRemoveTeam, @msg[1], length(msg)) |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
260 |
end |
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
261 |
end; |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
262 |
|
10448 | 263 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
264 |
procedure tryRemoveTeam(teamName: PChar); cdecl; |
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
265 |
var msg: ansistring; |
10448 | 266 |
i: Longword; |
267 |
tn: shortstring; |
|
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
268 |
begin |
10448 | 269 |
with currentConfig do |
270 |
begin |
|
271 |
i:= 0; |
|
272 |
tn:= teamName; |
|
273 |
while (i < 8) and (teams[i].teamName <> tn) do |
|
274 |
inc(i); |
|
275 |
||
276 |
// team not found??? |
|
277 |
if (i > 7) then exit; |
|
278 |
||
279 |
while (i < 7) and (teams[i + 1].hogsNumber > 0) do |
|
280 |
begin |
|
281 |
teams[i]:= teams[i + 1]; |
|
282 |
inc(i) |
|
283 |
end; |
|
284 |
||
285 |
teams[i].hogsNumber:= 0 |
|
286 |
end; |
|
287 |
||
10444
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
288 |
msg:= teamName; |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
289 |
|
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
290 |
guiCallbackFunction(guiCallbackPointer, mtRemovePlayingTeam, @msg[1], length(msg)); |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
291 |
guiCallbackFunction(guiCallbackPointer, mtAddTeam, @msg[1], length(msg)) |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
292 |
end; |
47a6231f1fc1
Teams widget now allows to add and remove teams (basic implementation, no checks performed, no colors, no hedgehogs)
unc0rr
parents:
10432
diff
changeset
|
293 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
294 |
|
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
295 |
procedure changeTeamColor(teamName: PChar; dir: LongInt); cdecl; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
296 |
var i, dc: Longword; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
297 |
tn: shortstring; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
298 |
msg: ansistring; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
299 |
begin |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
300 |
with currentConfig do |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
301 |
begin |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
302 |
i:= 0; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
303 |
tn:= teamName; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
304 |
while (i < 8) and (teams[i].teamName <> tn) do |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
305 |
inc(i); |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
306 |
// team not found??? |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
307 |
if (i > 7) then exit; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
308 |
|
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
309 |
if dir >= 0 then dc:= 1 else dc:= 8; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
310 |
teams[i].color:= (teams[i].color + dc) mod 9; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
311 |
|
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
312 |
msg:= tn + #10 + colorsSet[teams[i].color]; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
313 |
guiCallbackFunction(guiCallbackPointer, mtTeamColor, @msg[1], length(msg)) |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
314 |
end |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
315 |
end; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
316 |
|
10456 | 317 |
procedure setTheme(themeName: PChar); cdecl; |
318 |
begin |
|
319 |
currentConfig.theme:= themeName |
|
320 |
end; |
|
321 |
||
10612 | 322 |
procedure setScript(scriptName: PChar); cdecl; |
323 |
begin |
|
324 |
if scriptName <> 'Normal' then |
|
325 |
currentConfig.script:= '/Scripts/Multiplayer/' + scriptName + '.lua' |
|
326 |
else |
|
327 |
currentConfig.script:= '' |
|
328 |
end; |
|
329 |
||
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
330 |
procedure setScheme(schemeName: PChar); cdecl; |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
331 |
var scheme: PScheme; |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
332 |
begin |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
333 |
scheme:= schemeByName(schemeName); |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
334 |
|
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
335 |
if scheme <> nil then |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
336 |
currentConfig.scheme:= scheme^ |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
337 |
end; |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
338 |
|
10406 | 339 |
end. |