- Timestamp:
- Sep 9, 2018, 11:45:45 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormClient.pas
r223 r227 302 302 ToolBar1.Visible := AToolBarVisible.Checked; 303 303 StatusBar1.Visible := AStatusBarVisible.Checked; 304 AGameEndTurn.Enabled := Assigned(Client .ControlPlayer) and304 AGameEndTurn.Enabled := Assigned(Client) and Assigned(Client.ControlPlayer) and 305 305 Client.ControlPlayer.IsAlive and TurnActive; 306 ASurrender.Enabled := Assigned(Client .ControlPlayer) and306 ASurrender.Enabled := Assigned(Client) and Assigned(Client.ControlPlayer) and 307 307 Client.ControlPlayer.IsAlive; 308 308 end; -
trunk/Forms/UFormMain.lfm
r222 r227 9 9 DesignTimePPI = 144 10 10 Menu = MainMenu1 11 OnActivate = FormActivate 11 12 OnClose = FormClose 12 13 OnCreate = FormCreate -
trunk/Forms/UFormMain.pas
r221 r227 69 69 procedure AToolBarBigIconsExecute(Sender: TObject); 70 70 procedure AToolBarVisibleExecute(Sender: TObject); 71 procedure FormActivate(Sender: TObject); 71 72 procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 72 73 procedure FormShow(Sender: TObject); … … 77 78 procedure Timer1Timer(Sender: TObject); 78 79 private 80 FormActivated: Boolean; 81 procedure ApplicationStart(Ptr: IntPtr); 79 82 public 80 83 procedure LoadConfig(Config: TXmlConfig; Path: string); … … 173 176 end; 174 177 178 procedure TFormMain.FormActivate(Sender: TObject); 179 begin 180 if not FormActivated then begin 181 FormActivated := True; 182 end; 183 end; 184 175 185 procedure TFormMain.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState 176 186 ); … … 191 201 begin 192 202 FormClient.Free; 203 end; 204 205 procedure TFormMain.ApplicationStart(Ptr: IntPtr); 206 begin 207 Core.ReopenGameOnInit; 193 208 end; 194 209 … … 202 217 ReloadView; 203 218 FormClient.Show; 219 Application.QueueAsyncCall(ApplicationStart, 0); 204 220 end; 205 221 -
trunk/UCore.pas
r226 r227 94 94 LocalClients: TClients; 95 95 ServerList: TServerList; 96 procedure ReopenGameOnInit; 96 97 procedure LoadConfig; 97 98 procedure SaveConfig; … … 490 491 SelectClient; 491 492 LastOpenedList1.AddItem(FileName); 492 FormClient.AZoomAll.Execute;493 493 UpdateOtherForms; 494 494 UpdateInterface; … … 496 496 if Assigned(ServerClient) then ServerClient.TurnStart 497 497 else raise Exception.Create(SMissingServerClientForPlayer); 498 FormClient.AZoomAll.Execute; 498 499 end; 499 500 … … 515 516 Action.Assign(TAction(FormClient.ActionList1.Actions[I])); 516 517 Action.ActionList := FormMain.ActionList1; 518 end; 519 end; 520 521 procedure TCore.ReopenGameOnInit; 522 begin 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; 517 531 end; 518 532 end; … … 626 640 ServerList.LoadConfig(XmlConfig1, 'ServerList'); 627 641 628 CommandLineParams;629 if not GameLoaded and ReopenLastFile and (LastOpenedList1.Items.Count > 0) and630 FileExists(LastOpenedList1.Items[0]) then631 LoadGame(LastOpenedList1.Items[0]);632 642 FormClientActions; 633 634 if Game.FileName = '' then begin635 Game.Assign(GameSettings);636 StartNewGame;637 end;638 643 end; 639 644 end;
Note:
See TracChangeset
for help on using the changeset viewer.