Changeset 195 for trunk/UCore.pas
- Timestamp:
- May 15, 2018, 4:30:54 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r193 r195 63 63 StoredDimension: TControlDimension; 64 64 RegistryContext: TRegistryContext; 65 GameLoaded: Boolean; 65 66 procedure LoadRecentExecute(Sender: TObject); 66 67 procedure ProcessComputerTurns; … … 87 88 AnimationSpeed: Integer; 88 89 AutoSaveEnabled: Boolean; 90 ReopenLastFile: Boolean; 89 91 FormClients: TFPGObjectList<TFormClient>; 90 92 Clients: TClients; … … 163 165 AnimationSpeed := XMLConfig1.GetValue('AnimationSpeed', 50); 164 166 AutoSaveEnabled := XMLConfig1.GetValue('AutoSave', True); 167 ReopenLastFile := XMLConfig1.GetValue('ReopenLastFile', True); 165 168 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(String(XMLConfig1.GetValue('Language', ''))); 166 169 ScaleDPI1.DPI := Point(XMLConfig1.GetValue('DPIX', 96), XMLConfig1.GetValue('DPIY', 96)); … … 175 178 XMLConfig1.SetValue('AnimationSpeed', AnimationSpeed); 176 179 XMLConfig1.SetValue('AutoSave', AutoSaveEnabled); 180 XMLConfig1.SetValue('ReopenLastFile', ReopenLastFile); 177 181 XMLConfig1.SetValue('DPIX', ScaleDPI1.DPI.X); 178 182 XMLConfig1.SetValue('DPIY', ScaleDPI1.DPI.Y); … … 186 190 // Command line parameter handling 187 191 if (ParamCount > 0) then begin 188 FileName := UTF8Encode(ParamStr(1));192 FileName := ParamStr(1); 189 193 if FileExists(FileName) then LoadGame(FileName); 190 194 end; … … 294 298 FormNew.Save(Server); 295 299 StartNewGame; 300 GameLoaded := False; 296 301 end; 297 302 finally … … 419 424 NewClient: TClient; 420 425 begin 426 GameLoaded := True; 427 421 428 Game.LoadFromFile(FileName); 422 429 Server.InitClients; … … 541 548 542 549 CommandLineParams; 550 if not GameLoaded and ReopenLastFile and (LastOpenedList1.Items.Count > 0) then 551 LoadGame(LastOpenedList1.Items[0]); 543 552 ScaleDPI; 544 553
Note:
See TracChangeset
for help on using the changeset viewer.