Changeset 181 for trunk/UCore.pas
- Timestamp:
- Feb 9, 2018, 9:41:25 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r180 r181 16 16 TCore = class(TDataModule) 17 17 AAbout: TAction; 18 APlayersStats: TAction; 18 19 ANewSpectatorClient: TAction; 19 20 AShowUnitMoves: TAction; … … 49 50 procedure AHelpExecute(Sender: TObject); 50 51 procedure ANewSpectatorClientExecute(Sender: TObject); 52 procedure APlayersStatsExecute(Sender: TObject); 51 53 procedure ASettingsExecute(Sender: TObject); 52 54 procedure AShowChartsExecute(Sender: TObject); … … 78 80 procedure LoadGame(FileName: string); 79 81 procedure RedrawClients; 82 procedure UpdateOtherForms; 80 83 public 81 84 Game: TGame; … … 103 106 uses 104 107 UFormMove, UFormMain, UFormNew, UFormSettings, UFormAbout, UFormPlayer, 105 UFormHelp, UFormCharts, UFormUnitMoves ;108 UFormHelp, UFormCharts, UFormUnitMoves, UFormPlayersStats; 106 109 107 110 const … … 366 369 end; 367 370 371 procedure TCore.APlayersStatsExecute(Sender: TObject); 372 begin 373 if not Assigned(FormPlayersStats) then 374 FormPlayersStats := TFormPlayersStats.Create(nil); 375 FormPlayersStats.Show; 376 end; 377 368 378 procedure TCore.ASettingsExecute(Sender: TObject); 369 379 begin … … 383 393 procedure TCore.AShowChartsExecute(Sender: TObject); 384 394 begin 395 if not Assigned(FormCharts) then FormCharts := TFormCharts.Create(nil); 385 396 FormCharts.Show; 386 397 end; … … 388 399 procedure TCore.AShowUnitMovesExecute(Sender: TObject); 389 400 begin 401 if not Assigned(FormUnitMoves) then FormUnitMoves := TFormUnitMoves.Create(nil); 390 402 FormUnitMoves.Show; 391 403 end; … … 416 428 procedure TCore.DataModuleDestroy(Sender: TObject); 417 429 begin 430 if Assigned(FormPlayersStats) then FreeAndNil(FormPlayersStats); 431 if Assigned(FormUnitMoves) then FreeAndNil(FormUnitMoves); 432 if Assigned(FormCharts) then FreeAndNil(FormCharts); 418 433 FreeAndNil(FormClients); 419 434 FreeAndNil(StoredDimension); … … 446 461 FormClient.AZoomAll.Execute; 447 462 RedrawClients; 448 if FormCharts.Visible then FormCharts.Redraw; 449 if FormUnitMoves.Visible then FormUnitMoves.ReloadList; 463 UpdateOtherForms; 450 464 end; 451 465 … … 457 471 Form.Redraw; 458 472 FormClient.Redraw; 473 end; 474 475 procedure TCore.UpdateOtherForms; 476 begin 477 if Assigned(FormCharts) and FormCharts.Visible then FormCharts.Redraw; 478 if Assigned(FormUnitMoves) and FormUnitMoves.Visible then FormUnitMoves.ReloadList; 479 if Assigned(FormPlayersStats) and FormPlayersStats.Visible then FormPlayersStats.ReloadList; 459 480 end; 460 481 … … 468 489 else ShowMessage(Format(SPlayersNotInitialized, [Game.Players.Count, Game.Players.GetAliveCount])); 469 490 RedrawClients; 470 if FormCharts.Visible then FormCharts.Redraw; 471 if FormUnitMoves.Visible then FormUnitMoves.ReloadList; 491 UpdateOtherForms; 472 492 ProcessComputerTurns; 473 493 UpdateActions; … … 479 499 FormClient.Client := Game.CurrentPlayer.Client; 480 500 end; 481 if FormCharts.Visible then FormCharts.Redraw; 482 if FormUnitMoves.Visible then FormUnitMoves.ReloadList; 501 UpdateOtherForms; 483 502 end; 484 503 485 504 procedure TCore.DoMoveUpdated(UnitMove: TUnitMove); 486 505 begin 487 if FormUnitMoves.Visible then FormUnitMoves.ReloadList; 506 if Assigned(FormUnitMoves) and FormUnitMoves.Visible then 507 FormUnitMoves.ReloadList; 488 508 end; 489 509
Note:
See TracChangeset
for help on using the changeset viewer.