Changeset 205


Ignore:
Timestamp:
May 20, 2018, 11:19:57 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Show correctly units move dialog after new game is created.
  • Fixed: Missing hints in client form toolbar.
  • Fixed: Recalculate players stats after game was loaded from file.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.pas

    r203 r205  
    8282    procedure DoMove(CellFrom, CellTo: TCell; var CountOnce,
    8383      CountRepeat: Integer; Update: Boolean; var Confirm: Boolean);
     84    procedure SetToolbarHints;
     85    procedure DoClientDestroy(Sender: TObject);
    8486  public
    8587    procedure LoadConfig(Config: TXmlConfig; Path: string);
     
    104106
    105107{ TFormClient }
     108
     109procedure TFormClient.SetToolbarHints;
     110var
     111  I: Integer;
     112begin
     113  for I := 0 to ToolBar1.ButtonCount - 1 do begin
     114    ToolBar1.Buttons[I].ShowHint := True;
     115    ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
     116  end;
     117end;
     118
     119procedure TFormClient.DoClientDestroy(Sender: TObject);
     120begin
     121  Client := nil;
     122end;
    106123
    107124procedure TFormClient.DoMove(CellFrom, CellTo: TCell; var CountOnce,
     
    213230    FClient.OnChange := DoClientChange;
    214231    FClient.OnMove := DoMove;
    215     FClient.OnTurnStart := DoTurnStart();
     232    FClient.OnTurnStart := DoTurnStart;
     233    FClient.OnDestroy := DoClientDestroy;
    216234  end;
    217235  Redraw;
     
    375393procedure TFormClient.FormShow(Sender: TObject);
    376394begin
     395  SetToolbarHints;
    377396  LoadConfig(Core.XMLConfig1, 'FormClient');
    378397  Core.PersistentForm.Load(Self);
  • trunk/UGame.pas

    r204 r205  
    30573057        Players[I].PlayerMap.CheckVisibility;
    30583058      end;
     3059      Map.ComputePlayerStats;
    30593060      Running := ReadBoolean(RootNode, 'Running', True);
    30603061    end;
  • trunk/UGameClient.pas

    r203 r205  
    2020    FControlPlayer: TPlayer;
    2121    FOnChange: TNotifyEvent;
     22    FOnDestroy: TNotifyEvent;
    2223    FOnReceive: TCommandEvent;
    2324    FOnMove: TMoveEvent;
     
    4849    property Game: TGame read FGame write SetGame;
    4950    property Form: TForm read FForm write SetForm;
     51    property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
    5052    property OnMove: TMoveEvent read FOnMove write SetOnMove;
    5153    property OnReceive: TCommandEvent read FOnReceive write FOnReceive;
     
    193195destructor TClient.Destroy;
    194196begin
     197  Form := nil;
    195198  ControlPlayer := nil;
    196199  FreeAndNil(View);
Note: See TracChangeset for help on using the changeset viewer.