1 | unit UCore;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, XMLConf, FileUtil, ActnList, Controls, Dialogs, Forms,
|
---|
9 | UGame, UApplicationInfo, UPersistentForm, UScaleDPI, UCoolTranslator,
|
---|
10 | URegistry, ULastOpenedList, Registry, Menus;
|
---|
11 |
|
---|
12 | type
|
---|
13 |
|
---|
14 | { TCore }
|
---|
15 |
|
---|
16 | TCore = class(TDataModule)
|
---|
17 | AAbout: TAction;
|
---|
18 | AShowUnitMoves: TAction;
|
---|
19 | AShowCharts: TAction;
|
---|
20 | AHelp: TAction;
|
---|
21 | AGameSave: TAction;
|
---|
22 | AGameLoad: TAction;
|
---|
23 | ApplicationInfo: TApplicationInfo;
|
---|
24 | ASettings: TAction;
|
---|
25 | ActionList1: TActionList;
|
---|
26 | AExit: TAction;
|
---|
27 | AGameEnd: TAction;
|
---|
28 | AGameEndTurn: TAction;
|
---|
29 | AGameNew: TAction;
|
---|
30 | AGameRestart: TAction;
|
---|
31 | CoolTranslator1: TCoolTranslator;
|
---|
32 | ImageListLarge: TImageList;
|
---|
33 | ImageListSmall: TImageList;
|
---|
34 | LastOpenedList1: TLastOpenedList;
|
---|
35 | OpenDialog1: TOpenDialog;
|
---|
36 | PersistentForm: TPersistentForm;
|
---|
37 | SaveDialog1: TSaveDialog;
|
---|
38 | ScaleDPI1: TScaleDPI;
|
---|
39 | XMLConfig1: TXMLConfig;
|
---|
40 | procedure AAboutExecute(Sender: TObject);
|
---|
41 | procedure AExitExecute(Sender: TObject);
|
---|
42 | procedure AGameEndExecute(Sender: TObject);
|
---|
43 | procedure AGameEndTurnExecute(Sender: TObject);
|
---|
44 | procedure AGameLoadExecute(Sender: TObject);
|
---|
45 | procedure AGameNewExecute(Sender: TObject);
|
---|
46 | procedure AGameRestartExecute(Sender: TObject);
|
---|
47 | procedure AGameSaveExecute(Sender: TObject);
|
---|
48 | procedure AHelpExecute(Sender: TObject);
|
---|
49 | procedure ASettingsExecute(Sender: TObject);
|
---|
50 | procedure AShowChartsExecute(Sender: TObject);
|
---|
51 | procedure AShowUnitMovesExecute(Sender: TObject);
|
---|
52 | procedure CoolTranslator1Translate(Sender: TObject);
|
---|
53 | procedure DataModuleCreate(Sender: TObject);
|
---|
54 | procedure DataModuleDestroy(Sender: TObject);
|
---|
55 | procedure LastOpenedList1Change(Sender: TObject);
|
---|
56 | private
|
---|
57 | FInitialized: Boolean;
|
---|
58 | StoredDimension: TControlDimension;
|
---|
59 | RegistryContext: TRegistryContext;
|
---|
60 | procedure LoadRecentExecute(Sender: TObject);
|
---|
61 | procedure ProcessComputerTurns;
|
---|
62 | procedure StartNewGame;
|
---|
63 | procedure DoPlayerChange(Sender: TObject);
|
---|
64 | procedure DoMoveUpdated(UnitMove: TUnitMove);
|
---|
65 | procedure DoOnMove(CellFrom, CellTo: TCell; var CountOnce,
|
---|
66 | CountRepeat: Integer; Update: Boolean; var Confirm: Boolean);
|
---|
67 | procedure DoOnWin(Player: TPlayer);
|
---|
68 | procedure Delay(Time: Integer);
|
---|
69 | procedure GameNewTurnExecute(Sender: TObject);
|
---|
70 | procedure AutoSave;
|
---|
71 | function GetPlayer: TPlayer;
|
---|
72 | procedure LoadConfig;
|
---|
73 | procedure SaveConfig;
|
---|
74 | procedure CommandLineParams;
|
---|
75 | procedure ScaleDPI;
|
---|
76 | procedure SelectClient;
|
---|
77 | procedure LoadGame(FileName: string);
|
---|
78 | public
|
---|
79 | Game: TGame;
|
---|
80 | UseSingleView: Boolean;
|
---|
81 | DevelMode: Boolean;
|
---|
82 | AnimationSpeed: Integer;
|
---|
83 | AutoSaveEnabled: Boolean;
|
---|
84 | CurrentClient: TClient;
|
---|
85 | procedure UpdateActions;
|
---|
86 | procedure Init;
|
---|
87 | property Initialized: Boolean read FInitialized;
|
---|
88 | end;
|
---|
89 |
|
---|
90 | var
|
---|
91 | Core: TCore;
|
---|
92 |
|
---|
93 |
|
---|
94 | implementation
|
---|
95 |
|
---|
96 | {$R *.lfm}
|
---|
97 |
|
---|
98 | uses
|
---|
99 | UFormMove, UFormMain, UFormNew, UFormSettings, UFormAbout, UFormPlayer,
|
---|
100 | UFormHelp, UFormCharts, UFormUnitMoves;
|
---|
101 |
|
---|
102 | const
|
---|
103 | DefaultRegKey = '\Software\Chronosoft\xTactics';
|
---|
104 |
|
---|
105 | resourcestring
|
---|
106 | SPlayerWins = 'Player %s wins';
|
---|
107 | SEndGame = 'End game?';
|
---|
108 | SEndGameQuestion = 'Do you want to end current game?';
|
---|
109 | SRestartGame = 'Restart game?';
|
---|
110 | SRestartGameQuestion = 'Do you want to restart current game?';
|
---|
111 | SPlayersNotInitialized = 'Not all players were initialized with start cell. Needed %d, initialized %d. Change map parameters to have more terrain cells.';
|
---|
112 |
|
---|
113 |
|
---|
114 | { TCore }
|
---|
115 |
|
---|
116 | procedure TCore.DoOnMove(CellFrom, CellTo: TCell; var CountOnce,
|
---|
117 | CountRepeat: Integer; Update: Boolean; var Confirm: Boolean);
|
---|
118 | var
|
---|
119 | I: Integer;
|
---|
120 | begin
|
---|
121 | if Update then FormMove.SpinEditOnce.MaxValue := CellFrom.GetAvialPower + CountOnce
|
---|
122 | else FormMove.SpinEditOnce.MaxValue := CellFrom.GetAvialPower;
|
---|
123 | FormMove.SpinEditOnce.Value := CountOnce;
|
---|
124 | FormMove.TrackBarOnce.Max := FormMove.SpinEditOnce.MaxValue;
|
---|
125 | FormMove.TrackBarOnce.Position := FormMove.SpinEditOnce.Value;
|
---|
126 | FormMove.SpinEditRepeat.MaxValue := Game.Map.MaxPower;
|
---|
127 | FormMove.SpinEditRepeat.Value := CountRepeat;
|
---|
128 | FormMove.TrackBarRepeat.Max := FormMove.SpinEditRepeat.MaxValue;
|
---|
129 | FormMove.TrackBarRepeat.Position := FormMove.SpinEditRepeat.Value;
|
---|
130 | FormMove.DefendCount := CellTo.Power;
|
---|
131 | // Attack count from other surrounding cells without current move if already exists
|
---|
132 | FormMove.AttackCount := 0;
|
---|
133 | for I := 0 to CellTo.MovesTo.Count - 1 do
|
---|
134 | if TUnitMove(CellTo.MovesTo[I]).CellFrom <> CellFrom then
|
---|
135 | FormMove.AttackCount := FormMove.AttackCount + TUnitMove(CellTo.MovesTo[I]).CountOnce;
|
---|
136 | FormMove.ShowWinProbability := CellTo.Player <> CellFrom.Player;
|
---|
137 |
|
---|
138 | if FormMove.ShowModal = mrOk then begin
|
---|
139 | CountOnce := FormMove.SpinEditOnce.Value;
|
---|
140 | CountRepeat := FormMove.SpinEditRepeat.Value;
|
---|
141 | Confirm := True;
|
---|
142 | end else Confirm := False;
|
---|
143 | end;
|
---|
144 |
|
---|
145 | procedure TCore.DoOnWin(Player: TPlayer);
|
---|
146 | begin
|
---|
147 | FormMain.Redraw;
|
---|
148 | ShowMessage(Format(SPlayerWins, [Player.Name]));
|
---|
149 | end;
|
---|
150 |
|
---|
151 | procedure TCore.Delay(Time: Integer);
|
---|
152 | const
|
---|
153 | Slice = 50; // ms
|
---|
154 | begin
|
---|
155 | while Time > 0 do begin
|
---|
156 | Application.ProcessMessages;
|
---|
157 | if Time > Slice then Sleep(Slice) else Sleep(Time);
|
---|
158 | Dec(Time, Slice);
|
---|
159 | end;
|
---|
160 | end;
|
---|
161 |
|
---|
162 | procedure TCore.GameNewTurnExecute(Sender: TObject);
|
---|
163 | begin
|
---|
164 | if AutoSaveEnabled then AutoSave;
|
---|
165 | end;
|
---|
166 |
|
---|
167 | procedure TCore.AutoSave;
|
---|
168 | var
|
---|
169 | OldFileName: string;
|
---|
170 | begin
|
---|
171 | OldFileName := Game.FileName;
|
---|
172 | Game.SaveToFile(GetAppConfigDir(False) + 'AutoSave.xtg');
|
---|
173 | Game.FileName := OldFileName;
|
---|
174 | end;
|
---|
175 |
|
---|
176 | function TCore.GetPlayer: TPlayer;
|
---|
177 | begin
|
---|
178 | Result := Game.CurrentPlayer;
|
---|
179 | end;
|
---|
180 |
|
---|
181 | procedure TCore.LoadConfig;
|
---|
182 | begin
|
---|
183 | RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey);
|
---|
184 | PersistentForm.RegistryContext := RegistryContext;
|
---|
185 | XMLConfig1.Filename := GetAppConfigDir(False) + 'Config.xml';
|
---|
186 |
|
---|
187 | LastOpenedList1.LoadFromXMLConfig(XMLConfig1, 'RecentFiles');
|
---|
188 | DevelMode := XMLConfig1.GetValue('DevelMode', false);
|
---|
189 | AnimationSpeed := XMLConfig1.GetValue('AnimationSpeed', 50);
|
---|
190 | AutoSaveEnabled := XMLConfig1.GetValue('AutoSave', True);
|
---|
191 | CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(String(XMLConfig1.GetValue('Language', '')));
|
---|
192 | ScaleDPI1.DPI := Point(XMLConfig1.GetValue('DPIX', 96), XMLConfig1.GetValue('DPIY', 96));
|
---|
193 | ScaleDPI1.AutoDetect := XMLConfig1.GetValue('DPIAuto', True);
|
---|
194 | end;
|
---|
195 |
|
---|
196 | procedure TCore.SaveConfig;
|
---|
197 | begin
|
---|
198 | XMLConfig1.SetValue('Language', WideString(CoolTranslator1.Language.Code));
|
---|
199 | LastOpenedList1.SaveToXMLConfig(XMLConfig1, 'RecentFiles');
|
---|
200 | XMLConfig1.SetValue('DevelMode', DevelMode);
|
---|
201 | XMLConfig1.SetValue('AnimationSpeed', AnimationSpeed);
|
---|
202 | XMLConfig1.SetValue('AutoSave', AutoSaveEnabled);
|
---|
203 | XMLConfig1.SetValue('DPIX', ScaleDPI1.DPI.X);
|
---|
204 | XMLConfig1.SetValue('DPIY', ScaleDPI1.DPI.Y);
|
---|
205 | XMLConfig1.SetValue('DPIAuto', ScaleDPI1.AutoDetect);
|
---|
206 | end;
|
---|
207 |
|
---|
208 | procedure TCore.CommandLineParams;
|
---|
209 | var
|
---|
210 | FileName: string;
|
---|
211 | begin
|
---|
212 | // Command line parameter handling
|
---|
213 | if (ParamCount > 0) then begin
|
---|
214 | FileName := UTF8Encode(ParamStr(1));
|
---|
215 | if FileExists(FileName) then LoadGame(FileName);
|
---|
216 | end;
|
---|
217 | end;
|
---|
218 |
|
---|
219 | procedure TCore.ScaleDPI;
|
---|
220 | var
|
---|
221 | I: Integer;
|
---|
222 | begin
|
---|
223 | {$ifdef DEBUG}
|
---|
224 | with Core.ScaleDPI1 do begin
|
---|
225 | //DesignDPI := Point(144, 144);
|
---|
226 | if (DesignDPI.X <> DPI.X) or (DesignDPI.Y <> DPI.Y) then begin
|
---|
227 | //ApplyToAll(DesignDPI);
|
---|
228 | FormNew.Show;
|
---|
229 | FormNew.Hide;
|
---|
230 | for I := 0 to Screen.FormCount - 1 do
|
---|
231 | if (Screen.Forms[I].WindowState = wsNormal) or
|
---|
232 | (Screen.Forms[I].WindowState = wsMinimized) then begin
|
---|
233 | StoreDimensions(Screen.Forms[I], StoredDimension);
|
---|
234 | ScaleDimensions(Screen.Forms[I], StoredDimension);
|
---|
235 | end;
|
---|
236 | ScaleImageList(Core.ImageListSmall, DesignDPI);
|
---|
237 | ScaleImageList(Core.ImageListLarge, DesignDPI);
|
---|
238 | end;
|
---|
239 | end;
|
---|
240 | {$endif}
|
---|
241 | end;
|
---|
242 |
|
---|
243 | procedure TCore.SelectClient;
|
---|
244 | var
|
---|
245 | FirstHuman: TPlayer;
|
---|
246 | begin
|
---|
247 | FirstHuman := Game.Players.GetFirstHuman;
|
---|
248 | if Assigned(FirstHuman) then CurrentClient := FirstHuman.Client
|
---|
249 | else CurrentClient := TClient(Game.Clients.First);
|
---|
250 | end;
|
---|
251 |
|
---|
252 | procedure TCore.UpdateActions;
|
---|
253 | begin
|
---|
254 | Core.AGameEndTurn.Enabled := Core.Game.Running;
|
---|
255 | Core.AGameEnd.Enabled := Core.Game.Running;
|
---|
256 | end;
|
---|
257 |
|
---|
258 | procedure TCore.AExitExecute(Sender: TObject);
|
---|
259 | begin
|
---|
260 | Game.Running := False;
|
---|
261 | Application.Terminate;
|
---|
262 | end;
|
---|
263 |
|
---|
264 | procedure TCore.AAboutExecute(Sender: TObject);
|
---|
265 | begin
|
---|
266 | FormAbout := TFormAbout.Create(Self);
|
---|
267 | try
|
---|
268 | FormAbout.ShowModal;
|
---|
269 | finally
|
---|
270 | FreeAndNil(FormAbout);
|
---|
271 | end;
|
---|
272 | end;
|
---|
273 |
|
---|
274 | procedure TCore.AGameEndExecute(Sender: TObject);
|
---|
275 | begin
|
---|
276 | if MessageDlg(SEndGame, SEndGameQuestion, mtConfirmation, mbYesNo, 0) = mrYes then begin
|
---|
277 | Game.Running := False;
|
---|
278 | FormMain.Redraw;
|
---|
279 | UpdateActions;
|
---|
280 | end;
|
---|
281 | end;
|
---|
282 |
|
---|
283 | procedure TCore.ProcessComputerTurns;
|
---|
284 | begin
|
---|
285 | while Game.Running and (Game.CurrentPlayer.Mode <> pmHuman) do begin
|
---|
286 | if Game.CurrentPlayer.Mode = pmComputer then begin
|
---|
287 | Game.CurrentPlayer.Computer.Process;
|
---|
288 | FormMain.Redraw;
|
---|
289 | Delay(Trunc((100 - AnimationSpeed) / 100 * 2000));
|
---|
290 | end;
|
---|
291 | Game.NextTurn;
|
---|
292 | FormMain.Redraw;
|
---|
293 | Application.ProcessMessages;
|
---|
294 | Sleep(1);
|
---|
295 | end;
|
---|
296 | end;
|
---|
297 |
|
---|
298 | procedure TCore.AGameEndTurnExecute(Sender: TObject);
|
---|
299 | begin
|
---|
300 | Game.NextTurn;
|
---|
301 | FormMain.Redraw;
|
---|
302 | ProcessComputerTurns;
|
---|
303 | UpdateActions;
|
---|
304 | end;
|
---|
305 |
|
---|
306 | procedure TCore.AGameLoadExecute(Sender: TObject);
|
---|
307 | begin
|
---|
308 | if (Game.FileName = '') and (LastOpenedList1.Items.Count > 0) then
|
---|
309 | OpenDialog1.FileName := LastOpenedList1.Items[0]
|
---|
310 | else OpenDialog1.FileName := Game.FileName;
|
---|
311 | if OpenDialog1.Execute then begin
|
---|
312 | LoadGame(OpenDialog1.FileName);
|
---|
313 | end;
|
---|
314 | end;
|
---|
315 |
|
---|
316 | procedure TCore.AGameNewExecute(Sender: TObject);
|
---|
317 | begin
|
---|
318 | FormNew.Load(Game);
|
---|
319 | if FormNew.ShowModal = mrOk then begin
|
---|
320 | FormNew.Save(Game);
|
---|
321 | StartNewGame;
|
---|
322 | end;
|
---|
323 | end;
|
---|
324 |
|
---|
325 | procedure TCore.AGameRestartExecute(Sender: TObject);
|
---|
326 | begin
|
---|
327 | if MessageDlg(SRestartGame, SRestartGameQuestion, mtConfirmation, mbYesNo, 0) = mrYes then begin
|
---|
328 | StartNewGame;
|
---|
329 | end;
|
---|
330 | end;
|
---|
331 |
|
---|
332 | procedure TCore.AGameSaveExecute(Sender: TObject);
|
---|
333 | begin
|
---|
334 | if (Game.FileName = '') and (LastOpenedList1.Items.Count > 0) then
|
---|
335 | SaveDialog1.FileName := ExtractFileDir(LastOpenedList1.Items[0])
|
---|
336 | else SaveDialog1.FileName := Game.FileName;
|
---|
337 | if SaveDialog1.Execute then begin
|
---|
338 | Game.SaveToFile(SaveDialog1.FileName);
|
---|
339 | LastOpenedList1.AddItem(SaveDialog1.FileName);
|
---|
340 | end;
|
---|
341 | end;
|
---|
342 |
|
---|
343 | procedure TCore.AHelpExecute(Sender: TObject);
|
---|
344 | begin
|
---|
345 | FormHelp := TFormHelp.Create(Self);
|
---|
346 | try
|
---|
347 | FormHelp.ShowModal;
|
---|
348 | finally
|
---|
349 | FreeAndNil(FormHelp);
|
---|
350 | end;
|
---|
351 | end;
|
---|
352 |
|
---|
353 | procedure TCore.ASettingsExecute(Sender: TObject);
|
---|
354 | begin
|
---|
355 | FormSettings := TFormSettings.Create(nil);
|
---|
356 | try
|
---|
357 | FormSettings.Load;
|
---|
358 | if FormSettings.ShowModal = mrOk then begin
|
---|
359 | FormSettings.Save;
|
---|
360 | Game.SaveConfig(XMLConfig1, 'Game');
|
---|
361 | end;
|
---|
362 | finally
|
---|
363 | FreeAndNil(FormSettings);
|
---|
364 | end;
|
---|
365 | end;
|
---|
366 |
|
---|
367 | procedure TCore.AShowChartsExecute(Sender: TObject);
|
---|
368 | begin
|
---|
369 | FormCharts.Show;
|
---|
370 | end;
|
---|
371 |
|
---|
372 | procedure TCore.AShowUnitMovesExecute(Sender: TObject);
|
---|
373 | begin
|
---|
374 | FormUnitMoves.Show;
|
---|
375 | end;
|
---|
376 |
|
---|
377 | procedure TCore.CoolTranslator1Translate(Sender: TObject);
|
---|
378 | begin
|
---|
379 | UGame.InitStrings;
|
---|
380 | FormNew.Translate;
|
---|
381 | FormPlayer.Translate;
|
---|
382 | end;
|
---|
383 |
|
---|
384 | procedure TCore.DataModuleCreate(Sender: TObject);
|
---|
385 | begin
|
---|
386 | Game := TGame.Create;
|
---|
387 | Game.OnMove := DoOnMove;
|
---|
388 | Game.OnMoveUpdated := DoMoveUpdated;
|
---|
389 | Game.OnWin := DoOnWin;
|
---|
390 | Game.OnNewTurn := GameNewTurnExecute;
|
---|
391 | Game.OnPlayerChange := DoPlayerChange;
|
---|
392 | StoredDimension := TControlDimension.Create;
|
---|
393 | XMLConfig1.Filename := GetAppConfigDir(False) + 'Config.xml';
|
---|
394 | ForceDirectories(GetAppConfigDir(False));
|
---|
395 | end;
|
---|
396 |
|
---|
397 | procedure TCore.DataModuleDestroy(Sender: TObject);
|
---|
398 | begin
|
---|
399 | StoredDimension.Free;;
|
---|
400 | Game.SaveConfig(XMLConfig1, 'Game');
|
---|
401 | SaveConfig;
|
---|
402 | FreeAndNil(Game);
|
---|
403 | end;
|
---|
404 |
|
---|
405 | procedure TCore.LastOpenedList1Change(Sender: TObject);
|
---|
406 | begin
|
---|
407 | LastOpenedList1.LoadToMenuItem(FormMain.MenuItemLoadRecent, LoadRecentExecute);
|
---|
408 | end;
|
---|
409 |
|
---|
410 | procedure TCore.LoadRecentExecute(Sender: TObject);
|
---|
411 | begin
|
---|
412 | LoadGame((Sender as TMenuItem).Caption);
|
---|
413 | end;
|
---|
414 |
|
---|
415 | procedure TCore.LoadGame(FileName: string);
|
---|
416 | begin
|
---|
417 | Game.LoadFromFile(FileName);
|
---|
418 | SelectClient;
|
---|
419 | LastOpenedList1.AddItem(FileName);
|
---|
420 | with Core.CurrentClient do
|
---|
421 | View.DestRect := Bounds(0, 0, FormMain.PaintBox1.Width, FormMain.PaintBox1.Height);
|
---|
422 | FormMain.AZoomAll.Execute;
|
---|
423 | FormMain.Redraw;
|
---|
424 | if FormCharts.Visible then FormCharts.Redraw;
|
---|
425 | if FormUnitMoves.Visible then FormUnitMoves.ReloadList;
|
---|
426 | end;
|
---|
427 |
|
---|
428 | procedure TCore.StartNewGame;
|
---|
429 | begin
|
---|
430 | Game.New;
|
---|
431 | SelectClient;
|
---|
432 | if Game.Players.GetAliveCount = Game.Players.Count then Game.Running := True
|
---|
433 | else ShowMessage(Format(SPlayersNotInitialized, [Game.Players.Count, Game.Players.GetAliveCount]));
|
---|
434 | FormMain.Redraw;
|
---|
435 | if FormCharts.Visible then FormCharts.Redraw;
|
---|
436 | if FormUnitMoves.Visible then FormUnitMoves.ReloadList;
|
---|
437 | ProcessComputerTurns;
|
---|
438 | UpdateActions;
|
---|
439 | end;
|
---|
440 |
|
---|
441 | procedure TCore.DoPlayerChange(Sender: TObject);
|
---|
442 | begin
|
---|
443 | if Assigned(Game.CurrentPlayer) and Assigned(Game.CurrentPlayer.Client) then
|
---|
444 | CurrentClient := Game.CurrentPlayer.Client;
|
---|
445 | if FormCharts.Visible then FormCharts.Redraw;
|
---|
446 | if FormUnitMoves.Visible then FormUnitMoves.ReloadList;
|
---|
447 | end;
|
---|
448 |
|
---|
449 | procedure TCore.DoMoveUpdated(UnitMove: TUnitMove);
|
---|
450 | begin
|
---|
451 | if FormUnitMoves.Visible then FormUnitMoves.ReloadList;
|
---|
452 | end;
|
---|
453 |
|
---|
454 | procedure TCore.Init;
|
---|
455 | begin
|
---|
456 | if not Core.Initialized then begin
|
---|
457 | {$IFDEF Linux}
|
---|
458 | // If installed in Linux system then use installation directory for po files
|
---|
459 | if Application.ExeName = '/usr/bin/xtactics' then
|
---|
460 | CoolTranslator1.POFilesFolder := '/usr/share/xtactics/languages';
|
---|
461 | {$ENDIF}
|
---|
462 | FInitialized := True;
|
---|
463 |
|
---|
464 | // Update translated default player names
|
---|
465 | TPlayer(Game.PlayersSetting[0]).Name := SPlayer + ' 1';
|
---|
466 | TPlayer(Game.PlayersSetting[1]).Name := SPlayer + ' 2';
|
---|
467 |
|
---|
468 | LoadConfig;
|
---|
469 | Game.LoadConfig(XMLConfig1, 'Game');
|
---|
470 |
|
---|
471 | CommandLineParams;
|
---|
472 | ScaleDPI;
|
---|
473 |
|
---|
474 | if Game.FileName = '' then StartNewGame;
|
---|
475 | end;
|
---|
476 | end;
|
---|
477 |
|
---|
478 | end.
|
---|
479 |
|
---|