Changeset 126 for trunk/UCore.pas
- Timestamp:
- Jun 17, 2017, 2:54:50 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r125 r126 52 52 StoredDimension: TControlDimension; 53 53 RegistryContext: TRegistryContext; 54 procedure StartNewGame; 54 55 procedure DoPlayerChange(Sender: TObject); 55 56 procedure DoOnMove(CellFrom, CellTo: TCell; var CountOnce, … … 285 286 if Game.CurrentPlayer.Mode = pmComputer then begin 286 287 Computer := TComputer.Create; 287 Computer.Game := Game; 288 Computer.Process; 289 Computer.Free; 288 try 289 Computer.Game := Game; 290 Computer.Process; 291 finally 292 Computer.Free; 293 end; 290 294 FormMain.Redraw; 291 295 Delay(Trunc((100 - AnimationSpeed) / 100 * 2000)); … … 320 324 if FormNew.ShowModal = mrOk then begin 321 325 FormNew.Save(Game); 322 Game.New; 323 SelectClient; 324 Game.Running := True; 325 FormMain.AZoomAll.Execute; 326 UpdateActions; 326 StartNewGame; 327 327 end; 328 328 end; … … 331 331 begin 332 332 if MessageDlg(SRestartGame, SRestartGameQuestion, mtConfirmation, mbYesNo, 0) = mrYes then begin 333 Game.New; 334 Game.Running := True; 335 FormMain.AZoomAll.Execute; 336 FormMain.Redraw; 337 UpdateActions; 333 StartNewGame; 338 334 end; 339 335 end; … … 396 392 end; 397 393 394 procedure TCore.StartNewGame; 395 begin 396 Game.New; 397 SelectClient; 398 Game.Running := True; 399 FormMain.Redraw; 400 UpdateActions; 401 end; 402 398 403 procedure TCore.DoPlayerChange(Sender: TObject); 399 404 begin … … 413 418 FInitialized := True; 414 419 LoadConfig; 415 for I := 0 to Game.Clients.Count - 1 do416 TClient(Game.Clients[I]).View.DestRect := Rect(0, 0, FormMain.PaintBox1.Width,417 FormMain.PaintBox1.Height);418 420 Game.LoadConfig(XMLConfig1, 'Game'); 419 421 … … 421 423 ScaleDPI; 422 424 423 if Game.FileName = '' then begin 424 Game.New; 425 SelectClient; 426 Game.Running := True; 427 FormMain.AZoomAll.Execute; 428 end; 425 if Game.FileName = '' then StartNewGame; 429 426 end; 430 427
Note:
See TracChangeset
for help on using the changeset viewer.