Changeset 227 for trunk/Forms


Ignore:
Timestamp:
Sep 9, 2018, 11:45:45 AM (6 years ago)
Author:
chronos
Message:
  • Fixed: Load and start new game after main form is shown so cells can be correctly zoomed to be visible all.
Location:
trunk/Forms
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.pas

    r223 r227  
    302302  ToolBar1.Visible := AToolBarVisible.Checked;
    303303  StatusBar1.Visible := AStatusBarVisible.Checked;
    304   AGameEndTurn.Enabled := Assigned(Client.ControlPlayer) and
     304  AGameEndTurn.Enabled := Assigned(Client) and Assigned(Client.ControlPlayer) and
    305305    Client.ControlPlayer.IsAlive and TurnActive;
    306   ASurrender.Enabled := Assigned(Client.ControlPlayer) and
     306  ASurrender.Enabled := Assigned(Client) and Assigned(Client.ControlPlayer) and
    307307    Client.ControlPlayer.IsAlive;
    308308end;
  • trunk/Forms/UFormMain.lfm

    r222 r227  
    99  DesignTimePPI = 144
    1010  Menu = MainMenu1
     11  OnActivate = FormActivate
    1112  OnClose = FormClose
    1213  OnCreate = FormCreate
  • trunk/Forms/UFormMain.pas

    r221 r227  
    6969    procedure AToolBarBigIconsExecute(Sender: TObject);
    7070    procedure AToolBarVisibleExecute(Sender: TObject);
     71    procedure FormActivate(Sender: TObject);
    7172    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    7273    procedure FormShow(Sender: TObject);
     
    7778    procedure Timer1Timer(Sender: TObject);
    7879  private
     80    FormActivated: Boolean;
     81    procedure ApplicationStart(Ptr: IntPtr);
    7982  public
    8083    procedure LoadConfig(Config: TXmlConfig; Path: string);
     
    173176end;
    174177
     178procedure TFormMain.FormActivate(Sender: TObject);
     179begin
     180  if not FormActivated then begin
     181    FormActivated := True;
     182  end;
     183end;
     184
    175185procedure TFormMain.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState
    176186  );
     
    191201begin
    192202  FormClient.Free;
     203end;
     204
     205procedure TFormMain.ApplicationStart(Ptr: IntPtr);
     206begin
     207  Core.ReopenGameOnInit;
    193208end;
    194209
     
    202217  ReloadView;
    203218  FormClient.Show;
     219  Application.QueueAsyncCall(ApplicationStart, 0);
    204220end;
    205221
Note: See TracChangeset for help on using the changeset viewer.