264 AddProgress(); |
264 AddProgress(); |
265 |
265 |
266 ControllerInit(); // has to happen before InitKbdKeyTable to map keys |
266 ControllerInit(); // has to happen before InitKbdKeyTable to map keys |
267 InitKbdKeyTable(); |
267 InitKbdKeyTable(); |
268 |
268 |
269 if recordFileName = '' then |
|
270 InitIPC; |
|
271 WriteLnToConsole(msgGettingConfig); |
|
272 |
|
273 LoadLocale(Pathz[ptLocale] + '/en.txt'); // Do an initial load with english |
269 LoadLocale(Pathz[ptLocale] + '/en.txt'); // Do an initial load with english |
274 if cLocaleFName <> 'en.txt' then |
270 if cLocaleFName <> 'en.txt' then |
275 begin |
271 begin |
276 // Try two letter locale first before trying specific locale overrides |
272 // Try two letter locale first before trying specific locale overrides |
277 if (Length(cLocaleFName) > 6) and (Copy(cLocaleFName,1,2)+'.txt' <> 'en.txt') then |
273 if (Length(cLocaleFName) > 6) and (Copy(cLocaleFName,1,2)+'.txt' <> 'en.txt') then |
278 LoadLocale(Pathz[ptLocale] + '/' + Copy(cLocaleFName,1,2)+'.txt'); |
274 LoadLocale(Pathz[ptLocale] + '/' + Copy(cLocaleFName,1,2)+'.txt'); |
279 LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName); |
275 LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName); |
280 end; |
276 end; |
281 |
277 |
|
278 WriteLnToConsole(msgGettingConfig); |
282 if recordFileName = '' then |
279 if recordFileName = '' then |
283 SendIPCAndWaitReply('C') // ask for game config |
280 begin |
|
281 InitIPC; |
|
282 SendIPCAndWaitReply('C'); // ask for game config |
|
283 end |
284 else |
284 else |
|
285 begin |
285 LoadRecordFromFile(recordFileName); |
286 LoadRecordFromFile(recordFileName); |
|
287 {$IFDEF IPHONEOS} |
|
288 replayBegan(); |
|
289 {$ENDIF} |
|
290 end; |
286 |
291 |
287 ScriptOnGameInit; |
292 ScriptOnGameInit; |
288 |
293 |
289 s:= 'eproto ' + inttostr(cNetProtoVersion); |
294 s:= 'eproto ' + inttostr(cNetProtoVersion); |
290 SendIPCRaw(@s[0], Length(s) + 1); // send proto version |
295 SendIPCRaw(@s[0], Length(s) + 1); // send proto version |