Changeset 206 for trunk/UCore.pas
- Timestamp:
- May 21, 2018, 2:50:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r203 r206 17 17 TCore = class(TDataModule) 18 18 AAbout: TAction; 19 AShowKeyShortcuts: TAction; 19 20 AGameSave: TAction; 20 21 APlayersStats: TAction; … … 27 28 ApplicationInfo: TApplicationInfo; 28 29 ASettings: TAction; 29 ActionList 1: TActionList;30 ActionListMain: TActionList; 30 31 AExit: TAction; 31 32 AGameEnd: TAction; … … 55 56 procedure ASettingsExecute(Sender: TObject); 56 57 procedure AShowChartsExecute(Sender: TObject); 58 procedure AShowKeyShortcutsExecute(Sender: TObject); 57 59 procedure AShowUnitMovesExecute(Sender: TObject); 58 60 procedure CoolTranslator1Translate(Sender: TObject); … … 81 83 procedure RedrawClients; 82 84 procedure UpdateOtherForms; 85 procedure FormClientActions; 83 86 public 84 87 Game: TGame; … … 109 112 110 113 uses 111 UFormMain, UFormNew, UFormSettings, UFormAbout, UClientAI, 114 UFormMain, UFormNew, UFormSettings, UFormAbout, UClientAI, UFormKeyShortcuts, 112 115 UFormHelp, UFormCharts, UFormUnitMoves, UFormPlayersStats; 113 116 … … 373 376 end; 374 377 378 procedure TCore.AShowKeyShortcutsExecute(Sender: TObject); 379 begin 380 if not Assigned(FormKeyShortcuts) then FormKeyShortcuts := TFormKeyShortcuts.Create(nil); 381 FormKeyShortcuts.Show; 382 end; 383 375 384 procedure TCore.AShowUnitMovesExecute(Sender: TObject); 376 385 begin … … 382 391 begin 383 392 UGame.InitStrings; 393 CoolTranslator1.TranslateComponentRecursive(FormClient); 384 394 end; 385 395 … … 409 419 if Assigned(FormUnitMoves) then FreeAndNil(FormUnitMoves); 410 420 if Assigned(FormCharts) then FreeAndNil(FormCharts); 421 if Assigned(FormKeyShortcuts) then FreeAndNil(FormKeyShortcuts); 411 422 FreeAndNil(FormClients); 412 423 FreeAndNil(StoredDimension); … … 431 442 Player: TPlayer; 432 443 NewClient: TClient; 444 ServerClient: TServerClient; 433 445 begin 434 446 GameLoaded := True; … … 473 485 RedrawClients; 474 486 UpdateOtherForms; 487 UpdateActions; 488 ServerClient := Server.Clients.SearchByPlayer(Game.CurrentPlayer); 489 if Assigned(ServerClient) then ServerClient.TurnStart 490 else raise Exception.Create('Server client for current player not found.'); 475 491 end; 476 492 … … 489 505 if Assigned(FormUnitMoves) and FormUnitMoves.Visible then FormUnitMoves.ReloadList; 490 506 if Assigned(FormPlayersStats) and FormPlayersStats.Visible then FormPlayersStats.ReloadList; 507 end; 508 509 procedure TCore.FormClientActions; 510 var 511 Action: TAction; 512 I: Integer; 513 begin 514 for I := 0 to FormClient.ActionList1.ActionCount - 1 do begin 515 Action := TAction.Create(FormMain); 516 Action.Assign(TAction(FormClient.ActionList1.Actions[I])); 517 Action.ActionList := FormMain.ActionList1; 518 end; 491 519 end; 492 520 … … 597 625 LoadGame(LastOpenedList1.Items[0]); 598 626 ScaleDPI; 627 FormClientActions; 599 628 600 629 if Game.FileName = '' then StartNewGame;
Note:
See TracChangeset
for help on using the changeset viewer.