Changeset 231 for trunk/UCore.pas
- Timestamp:
- Sep 19, 2018, 2:05:52 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r227 r231 8 8 Classes, SysUtils, XMLConf, FileUtil, ActnList, Controls, Dialogs, Forms, 9 9 UGame, UApplicationInfo, UPersistentForm, UScaleDPI, UCoolTranslator, 10 URegistry, ULastOpenedList, Registry, Menus, UFormClient, 10 URegistry, ULastOpenedList, Registry, Menus, UFormClient, UPlayer, 11 11 UGameServer, UGameClient, fgl, UServerList; 12 12 … … 115 115 uses 116 116 UFormMain, UFormNew, UFormSettings, UFormAbout, UClientAI, UFormKeyShortcuts, 117 UFormHelp, UFormCharts, UFormUnitMoves, UFormPlayersStats ;117 UFormHelp, UFormCharts, UFormUnitMoves, UFormPlayersStats, UClientGUI; 118 118 119 119 const … … 248 248 begin 249 249 FirstHuman := Game.Players.GetFirstHuman; 250 if Assigned(FirstHuman) then FormClient.Client := LocalClients.SearchPlayer(FirstHuman) 251 else FormClient.Client := TClient(LocalClients.First); 250 if Assigned(FirstHuman) then FormClient.Client := TClientGUI(LocalClients.SearchPlayer(FirstHuman)) 251 else begin 252 FormClient.Client := TClientGUI(LocalClients.New(SSpectator)); 253 FormClient.Client.LocalServer := Server; 254 FormClient.Client.ConnectType := ctLocal; 255 FormClient.Client.Active := True; 256 FormClient.AZoomAll.Execute; 257 end; 252 258 end; 253 259 … … 469 475 NewClient := LocalClients.New(Name); 470 476 NewClient.ControlPlayer := Player; 471 NewClient.View.Clear;472 NewClient.View.Zoom := 1;477 TClientGUI(NewClient).View.Clear; 478 TClientGUI(NewClient).View.Zoom := 1; 473 479 NewClient.LocalServer := Server; 474 480 NewClient.ConnectType := ctLocal; 475 481 NewClient.Active := True; 476 482 if Assigned(NewClient.ControlPlayer.StartCell) then 477 NewClient.View.CenterPlayerCity(NewClient.ControlPlayer)478 else NewClient.View.CenterMap;483 TClientGUI(NewClient).View.CenterPlayerCity(NewClient.ControlPlayer) 484 else TClientGUI(NewClient).View.CenterMap; 479 485 end else 480 486 if Mode = pmComputer then begin 481 487 NewClient := TComputer.Create; 482 NewClient.Game := Game;488 NewClient.Game := TGame(Game); 483 489 NewClient.Name := Name; 484 490 LocalClients.Add(NewClient); … … 537 543 begin 538 544 Form := TFormClient.Create(nil); 539 Form.Client := LocalClients.New(SSpectator);545 Form.Client := TClientGUI(LocalClients.New(SSpectator)); 540 546 Form.Client.LocalServer := Server; 541 547 Form.Client.ConnectType := ctLocal; … … 566 572 NewClient := LocalClients.New(Name); 567 573 NewClient.ControlPlayer := Player; 568 NewClient.View.Clear;569 NewClient.View.Zoom := 1;574 TClientGUI(NewClient).View.Clear; 575 TClientGUI(NewClient).View.Zoom := 1; 570 576 NewClient.LocalServer := Server; 571 577 NewClient.ConnectType := ctLocal; 572 578 NewClient.Active := True; 573 579 if Assigned(NewClient.ControlPlayer.StartCell) then 574 NewClient.View.CenterPlayerCity(NewClient.ControlPlayer)575 else NewClient.View.CenterMap;580 TClientGUI(NewClient).View.CenterPlayerCity(NewClient.ControlPlayer) 581 else TClientGUI(NewClient).View.CenterMap; 576 582 end else 577 583 if Mode = pmComputer then begin 578 584 NewClient := TComputer.Create; 579 NewClient.Game := Game;585 NewClient.Game := TGame(Game); 580 586 NewClient.Name := Name; 581 587 LocalClients.Add(NewClient); … … 607 613 if Game.CurrentPlayer.Mode = pmHuman then begin 608 614 PlayerClient := LocalClients.SearchPlayer(Game.CurrentPlayer); 609 if Assigned(PlayerClient) then FormClient.Client := PlayerClient;615 if Assigned(PlayerClient) then FormClient.Client := TClientGUI(PlayerClient); 610 616 end; 611 617
Note:
See TracChangeset
for help on using the changeset viewer.