Changeset 227 for trunk/UCore.pas


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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r226 r227  
    9494    LocalClients: TClients;
    9595    ServerList: TServerList;
     96    procedure ReopenGameOnInit;
    9697    procedure LoadConfig;
    9798    procedure SaveConfig;
     
    490491  SelectClient;
    491492  LastOpenedList1.AddItem(FileName);
    492   FormClient.AZoomAll.Execute;
    493493  UpdateOtherForms;
    494494  UpdateInterface;
     
    496496  if Assigned(ServerClient) then ServerClient.TurnStart
    497497    else raise Exception.Create(SMissingServerClientForPlayer);
     498  FormClient.AZoomAll.Execute;
    498499end;
    499500
     
    515516    Action.Assign(TAction(FormClient.ActionList1.Actions[I]));
    516517    Action.ActionList := FormMain.ActionList1;
     518  end;
     519end;
     520
     521procedure TCore.ReopenGameOnInit;
     522begin
     523  CommandLineParams;
     524  if not GameLoaded and ReopenLastFile and (LastOpenedList1.Items.Count > 0) and
     525    FileExists(LastOpenedList1.Items[0]) then
     526    LoadGame(LastOpenedList1.Items[0]);
     527
     528  if Game.FileName = '' then begin
     529    Game.Assign(GameSettings);
     530    StartNewGame;
    517531  end;
    518532end;
     
    626640    ServerList.LoadConfig(XmlConfig1, 'ServerList');
    627641
    628     CommandLineParams;
    629     if not GameLoaded and ReopenLastFile and (LastOpenedList1.Items.Count > 0) and
    630       FileExists(LastOpenedList1.Items[0]) then
    631       LoadGame(LastOpenedList1.Items[0]);
    632642    FormClientActions;
    633 
    634     if Game.FileName = '' then begin
    635       Game.Assign(GameSettings);
    636       StartNewGame;
    637     end;
    638643  end;
    639644end;
Note: See TracChangeset for help on using the changeset viewer.