Changeset 211 for trunk/UCore.pas


Ignore:
Timestamp:
May 23, 2018, 8:53:58 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Each client form is redrawn by itself, not by Core.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r207 r211  
    7070    procedure LoadRecentExecute(Sender: TObject);
    7171    procedure StartNewGame;
     72    procedure LoadGame(FileName: string);
    7273    procedure DoPlayerChange(Sender: TObject);
    7374    procedure DoMoveUpdated(UnitMove: TUnitMove);
     
    7879    procedure CommandLineParams;
    7980    procedure SelectClient;
    80     procedure LoadGame(FileName: string);
    81     procedure RedrawClients;
    8281    procedure UpdateOtherForms;
    8382    procedure FormClientActions;
     
    139138  I: Integer;
    140139begin
    141   RedrawClients;
     140  Server.GameEnd;
    142141  if Assigned(Player) then
    143142    ShowMessage(Format(SPlayerWins, [Player.Name]))
     
    276275  if MessageDlg(SEndGame, SEndGameQuestion, mtConfirmation, mbYesNo, 0) = mrYes then begin
    277276    Game.Running := False;
    278     RedrawClients;
     277    Server.GameEnd;
    279278    UpdateActions;
    280279  end;
     
    489488      TPoint.Create(FormClient.PaintBox1.Width, FormClient.PaintBox1.Height));
    490489  FormClient.AZoomAll.Execute;
    491   RedrawClients;
    492490  UpdateOtherForms;
    493491  UpdateActions;
     
    495493  if Assigned(ServerClient) then ServerClient.TurnStart
    496494    else raise Exception.Create(SMissingServerClientForPlayer);
    497 end;
    498 
    499 procedure TCore.RedrawClients;
    500 var
    501   Form: TFormClient;
    502 begin
    503   for Form in FormClients do
    504     Form.Redraw;
    505   FormClient.Redraw;
    506495end;
    507496
     
    579568  if Game.Players.GetAliveCount = Game.Players.Count then Game.Running := True
    580569    else ShowMessage(Format(SPlayersNotInitialized, [Game.Players.Count, Game.Players.GetAliveCount]));
    581   FormClient.AZoomAll.Execute;
    582   RedrawClients;
    583570  UpdateOtherForms;
    584571  UpdateActions;
     
    594581begin
    595582  if Assigned(Game.CurrentPlayer) then begin
    596     PlayerClient := LocalClients.SearchPlayer(Game.CurrentPlayer);
    597     if Assigned(PlayerClient) then FormClient.Client := PlayerClient;
     583    if Game.CurrentPlayer.Mode = pmHuman then begin
     584      PlayerClient := LocalClients.SearchPlayer(Game.CurrentPlayer);
     585      if Assigned(PlayerClient) then FormClient.Client := PlayerClient;
     586    end;
    598587
    599588    ServerClient := Server.Clients.SearchByPlayer(Game.CurrentPlayer);
Note: See TracChangeset for help on using the changeset viewer.