author | unc0rr |
Thu, 26 Nov 2015 20:11:54 +0300 | |
branch | qmlfrontend |
changeset 11437 | 97e3e62ea5f9 |
parent 11436 | 80a9b14bb8d3 |
child 11438 | bca9afcc3a72 |
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 setSeed(seed: PChar); cdecl; |
11 |
function getSeed: PChar; cdecl; |
|
10456 | 12 |
procedure setTheme(themeName: PChar); cdecl; |
10612 | 13 |
procedure setScript(scriptName: PChar); cdecl; |
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
14 |
procedure setScheme(schemeName: PChar); cdecl; |
10888 | 15 |
procedure setAmmo(ammoName: PChar); cdecl; |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
16 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
17 |
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
|
18 |
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
|
19 |
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
|
20 |
|
11436 | 21 |
procedure netSetSeed(seed: shortstring); |
22 |
procedure netSetTheme(themeName: shortstring); |
|
23 |
procedure netSetScript(scriptName: shortstring); |
|
24 |
||
10406 | 25 |
implementation |
10951
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10892
diff
changeset
|
26 |
uses uFLIPC, hwengine, uFLUtils, uFLTeams, uFLData, uFLSChemes, uFLAmmo, uFLUICallback; |
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; |
10892 | 38 |
ammo: TAmmo; |
10432 | 39 |
mapgen: Longint; |
10426 | 40 |
gameType: TGameType; |
41 |
teams: array[0..7] of TTeam; |
|
42 |
arguments: array[0..Pred(MAXARGS)] of shortstring; |
|
43 |
argv: array[0..Pred(MAXARGS)] of PChar; |
|
44 |
argumentsNumber: Longword; |
|
45 |
end; |
|
46 |
PGameConfig = ^TGameConfig; |
|
47 |
||
10432 | 48 |
var |
49 |
currentConfig: TGameConfig; |
|
50 |
||
11436 | 51 |
function getScriptPath(scriptName: shortstring): shortstring; |
52 |
begin |
|
53 |
getScriptPath:= '/Scripts/Multiplayer/' + scriptName + '.lua' |
|
54 |
end; |
|
10430 | 55 |
|
10432 | 56 |
procedure sendConfig(config: PGameConfig); |
57 |
var i: Longword; |
|
58 |
begin |
|
59 |
with config^ do |
|
10430 | 60 |
begin |
10432 | 61 |
case gameType of |
62 |
gtPreview: begin |
|
11436 | 63 |
if script <> 'Normal' then |
64 |
ipcToEngine('escript ' + getScriptPath(script)); |
|
10432 | 65 |
ipcToEngine('eseed ' + seed); |
66 |
ipcToEngine('e$mapgen ' + intToStr(mapgen)); |
|
67 |
end; |
|
68 |
gtLocal: begin |
|
11436 | 69 |
if script <> 'Normal' then |
70 |
ipcToEngine('escript ' + getScriptPath(script)); |
|
10432 | 71 |
ipcToEngine('eseed ' + seed); |
72 |
ipcToEngine('e$mapgen ' + intToStr(mapgen)); |
|
10456 | 73 |
ipcToEngine('e$theme ' + theme); |
10612 | 74 |
|
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
75 |
sendSchemeConfig(scheme); |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
76 |
|
10432 | 77 |
i:= 0; |
78 |
while (i < 8) and (teams[i].hogsNumber > 0) do |
|
79 |
begin |
|
10892 | 80 |
sendAmmoConfig(config^.ammo); |
10432 | 81 |
ipcToEngine('eammstore'); |
82 |
sendTeamConfig(teams[i]); |
|
83 |
inc(i) |
|
84 |
end; |
|
85 |
end; |
|
86 |
end; |
|
87 |
||
88 |
ipcToEngine('!'); |
|
89 |
end; |
|
90 |
end; |
|
10426 | 91 |
|
92 |
procedure queueExecution; |
|
93 |
var pConfig: PGameConfig; |
|
94 |
i: Longword; |
|
95 |
begin |
|
96 |
new(pConfig); |
|
97 |
pConfig^:= currentConfig; |
|
98 |
||
99 |
with pConfig^ do |
|
100 |
for i:= 0 to Pred(MAXARGS) do |
|
101 |
begin |
|
102 |
if arguments[i][0] = #255 then |
|
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
103 |
arguments[i][255]:= #0 |
10426 | 104 |
else |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
105 |
arguments[i][byte(arguments[i][0]) + 1]:= #0; |
10426 | 106 |
argv[i]:= @arguments[i][1] |
107 |
end; |
|
108 |
||
109 |
RunEngine(pConfig^.argumentsNumber, @pConfig^.argv); |
|
10432 | 110 |
|
111 |
sendConfig(pConfig) |
|
10426 | 112 |
end; |
113 |
||
114 |
procedure resetGameConfig; cdecl; |
|
10450 | 115 |
var i: Longword; |
10406 | 116 |
begin |
10450 | 117 |
with currentConfig do |
118 |
begin |
|
11436 | 119 |
script:= 'Normal'; |
120 |
||
10450 | 121 |
for i:= 0 to 7 do |
122 |
teams[i].hogsNumber:= 0 |
|
123 |
end |
|
10406 | 124 |
end; |
125 |
||
10430 | 126 |
procedure setSeed(seed: PChar); cdecl; |
127 |
begin |
|
11436 | 128 |
sendUI(mtSeed, @seed[1], length(seed)); |
10430 | 129 |
currentConfig.seed:= seed |
130 |
end; |
|
131 |
||
132 |
function getSeed: PChar; cdecl; |
|
133 |
begin |
|
134 |
getSeed:= str2PChar(currentConfig.seed) |
|
135 |
end; |
|
136 |
||
10450 | 137 |
function getUnusedColor: Longword; |
10448 | 138 |
var i, c: Longword; |
139 |
fColorMatched: boolean; |
|
140 |
begin |
|
141 |
c:= 0; |
|
142 |
i:= 0; |
|
143 |
repeat |
|
144 |
repeat |
|
10450 | 145 |
fColorMatched:= (currentConfig.teams[i].hogsNumber > 0) and (currentConfig.teams[i].color = c); |
10448 | 146 |
inc(i) |
147 |
until (i >= 8) or (currentConfig.teams[i].hogsNumber = 0) or fColorMatched; |
|
148 |
||
149 |
if fColorMatched then |
|
150 |
begin |
|
151 |
i:= 0; |
|
152 |
inc(c) |
|
153 |
end; |
|
154 |
until not fColorMatched; |
|
155 |
||
10450 | 156 |
getUnusedColor:= c |
10448 | 157 |
end; |
158 |
||
10430 | 159 |
procedure runQuickGame; cdecl; |
10426 | 160 |
begin |
10432 | 161 |
with currentConfig do |
162 |
begin |
|
163 |
gameType:= gtLocal; |
|
164 |
arguments[0]:= ''; |
|
165 |
arguments[1]:= '--internal'; |
|
10448 | 166 |
arguments[2]:= '--nomusic'; |
10432 | 167 |
argumentsNumber:= 3; |
10426 | 168 |
|
10432 | 169 |
teams[0]:= createRandomTeam; |
10450 | 170 |
teams[0].color:= 0; |
10432 | 171 |
teams[1]:= createRandomTeam; |
10450 | 172 |
teams[1].color:= 1; |
11429 | 173 |
teams[1].botLevel:= 3; |
10432 | 174 |
|
175 |
queueExecution; |
|
176 |
end; |
|
10426 | 177 |
end; |
178 |
||
10448 | 179 |
|
10430 | 180 |
procedure getPreview; cdecl; |
10426 | 181 |
begin |
182 |
with currentConfig do |
|
183 |
begin |
|
184 |
gameType:= gtPreview; |
|
185 |
arguments[0]:= ''; |
|
186 |
arguments[1]:= '--internal'; |
|
187 |
arguments[2]:= '--landpreview'; |
|
188 |
argumentsNumber:= 3; |
|
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
189 |
|
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
190 |
queueExecution; |
10426 | 191 |
end; |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10426
diff
changeset
|
192 |
end; |
10426 | 193 |
|
10448 | 194 |
procedure runLocalGame; cdecl; |
195 |
begin |
|
196 |
with currentConfig do |
|
197 |
begin |
|
198 |
gameType:= gtLocal; |
|
199 |
arguments[0]:= ''; |
|
200 |
arguments[1]:= '--internal'; |
|
201 |
arguments[2]:= '--nomusic'; |
|
202 |
argumentsNumber:= 3; |
|
203 |
||
204 |
queueExecution; |
|
205 |
end; |
|
206 |
end; |
|
207 |
||
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
208 |
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
|
209 |
var msg: ansistring; |
10446 | 210 |
i, hn, hedgehogsNumber: Longword; |
211 |
team: PTeam; |
|
10450 | 212 |
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
|
213 |
begin |
10446 | 214 |
with currentConfig do |
215 |
begin |
|
216 |
hedgehogsNumber:= 0; |
|
217 |
i:= 0; |
|
218 |
||
219 |
while (i < 8) and (teams[i].hogsNumber > 0) do |
|
220 |
begin |
|
221 |
inc(i); |
|
222 |
inc(hedgehogsNumber, teams[i].hogsNumber) |
|
223 |
end; |
|
224 |
||
225 |
// no free space for a team or reached hogs number maximum |
|
226 |
if (i > 7) or (hedgehogsNumber >= 48) then exit; |
|
227 |
||
228 |
team:= teamByName(teamName); |
|
229 |
if team = nil then exit; |
|
230 |
||
10448 | 231 |
c:= getUnusedColor; |
232 |
||
10446 | 233 |
teams[i]:= team^; |
234 |
||
235 |
if i = 0 then hn:= 4 else hn:= teams[i - 1].hogsNumber; |
|
236 |
if hn > 48 - hedgehogsNumber then hn:= 48 - hedgehogsNumber; |
|
237 |
teams[i].hogsNumber:= hn; |
|
10448 | 238 |
|
239 |
teams[i].color:= c; |
|
10446 | 240 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
241 |
msg:= '0' + #10 + teamName; |
10951
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10892
diff
changeset
|
242 |
sendUI(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
|
243 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
244 |
msg:= teamName + #10 + colorsSet[teams[i].color]; |
10951
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10892
diff
changeset
|
245 |
sendUI(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
|
246 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
247 |
msg:= teamName; |
10951
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10892
diff
changeset
|
248 |
sendUI(mtRemoveTeam, @msg[1], length(msg)) |
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
249 |
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
|
250 |
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
|
251 |
|
10448 | 252 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
253 |
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
|
254 |
var msg: ansistring; |
10448 | 255 |
i: Longword; |
256 |
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
|
257 |
begin |
10448 | 258 |
with currentConfig do |
259 |
begin |
|
260 |
i:= 0; |
|
261 |
tn:= teamName; |
|
262 |
while (i < 8) and (teams[i].teamName <> tn) do |
|
263 |
inc(i); |
|
264 |
||
265 |
// team not found??? |
|
266 |
if (i > 7) then exit; |
|
267 |
||
268 |
while (i < 7) and (teams[i + 1].hogsNumber > 0) do |
|
269 |
begin |
|
270 |
teams[i]:= teams[i + 1]; |
|
271 |
inc(i) |
|
272 |
end; |
|
273 |
||
274 |
teams[i].hogsNumber:= 0 |
|
275 |
end; |
|
276 |
||
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
|
277 |
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
|
278 |
|
10951
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10892
diff
changeset
|
279 |
sendUI(mtRemovePlayingTeam, @msg[1], length(msg)); |
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10892
diff
changeset
|
280 |
sendUI(mtAddTeam, @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
|
281 |
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
|
282 |
|
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
283 |
|
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
284 |
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
|
285 |
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
|
286 |
tn: shortstring; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
287 |
msg: ansistring; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
288 |
begin |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
289 |
with currentConfig do |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
290 |
begin |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
291 |
i:= 0; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
292 |
tn:= teamName; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
293 |
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
|
294 |
inc(i); |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
295 |
// team not found??? |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
296 |
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
|
297 |
|
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
298 |
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
|
299 |
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
|
300 |
|
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
301 |
msg:= tn + #10 + colorsSet[teams[i].color]; |
10951
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10892
diff
changeset
|
302 |
sendUI(mtTeamColor, @msg[1], length(msg)) |
10452
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
303 |
end |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
304 |
end; |
03519fd9f98d
Show team color in teams list widget, also allow to change it on mouse click
unc0rr
parents:
10450
diff
changeset
|
305 |
|
10456 | 306 |
procedure setTheme(themeName: PChar); cdecl; |
307 |
begin |
|
308 |
currentConfig.theme:= themeName |
|
309 |
end; |
|
310 |
||
10612 | 311 |
procedure setScript(scriptName: PChar); cdecl; |
312 |
begin |
|
11436 | 313 |
currentConfig.script:= scriptName |
10612 | 314 |
end; |
315 |
||
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
316 |
procedure setScheme(schemeName: PChar); cdecl; |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
317 |
var scheme: PScheme; |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
318 |
begin |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
319 |
scheme:= schemeByName(schemeName); |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
320 |
|
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
321 |
if scheme <> nil then |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
322 |
currentConfig.scheme:= scheme^ |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
323 |
end; |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10612
diff
changeset
|
324 |
|
10888 | 325 |
procedure setAmmo(ammoName: PChar); cdecl; |
326 |
var ammo: PAmmo; |
|
327 |
begin |
|
328 |
ammo:= ammoByName(ammoName); |
|
329 |
||
330 |
if ammo <> nil then |
|
10892 | 331 |
currentConfig.ammo:= ammo^ |
10888 | 332 |
end; |
333 |
||
11436 | 334 |
procedure netSetSeed(seed: shortstring); |
335 |
begin |
|
336 |
if seed <> currentConfig.seed then |
|
337 |
begin |
|
338 |
currentConfig.seed:= seed; |
|
11437 | 339 |
sendUI(mtSeed, @seed[1], length(seed)); |
340 |
||
341 |
getPreview() |
|
11436 | 342 |
end |
343 |
end; |
|
344 |
||
345 |
procedure netSetTheme(themeName: shortstring); |
|
346 |
begin |
|
347 |
if themeName <> currentConfig.theme then |
|
348 |
begin |
|
349 |
currentConfig.theme:= themeName; |
|
350 |
sendUI(mtTheme, @themeName[1], length(themeName)) |
|
351 |
end |
|
352 |
end; |
|
353 |
||
354 |
procedure netSetScript(scriptName: shortstring); |
|
355 |
begin |
|
356 |
if scriptName <> currentConfig.script then |
|
357 |
begin |
|
358 |
currentConfig.script:= scriptName; |
|
359 |
sendUI(mtScript, @scriptName[1], length(scriptName)) |
|
360 |
end |
|
361 |
end; |
|
362 |
||
10406 | 363 |
end. |