Changeset 207 for trunk/UCore.pas
- Timestamp:
- May 22, 2018, 9:43:29 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r206 r207 67 67 RegistryContext: TRegistryContext; 68 68 GameLoaded: Boolean; 69 FormNewTabIndex: Integer; 69 70 procedure LoadRecentExecute(Sender: TObject); 70 71 procedure StartNewGame; … … 75 76 procedure GameNewTurnExecute(Sender: TObject); 76 77 procedure AutoSave; 77 procedure LoadConfig;78 procedure SaveConfig;79 78 procedure CommandLineParams; 80 procedure ScaleDPI;81 79 procedure SelectClient; 82 80 procedure LoadGame(FileName: string); … … 96 94 LocalClients: TClients; 97 95 ServerList: TServerList; 96 procedure LoadConfig; 97 procedure SaveConfig; 98 98 procedure Spectate(Player: TPlayer); 99 99 procedure UpdateActions; 100 procedure ScaleDPI; 100 101 procedure Init; 101 102 procedure Done; … … 127 128 SPlayersNotInitialized = 'Not all players were initialized with start cell. Needed %d, initialized %d. Change map parameters to have more terrain cells.'; 128 129 SFileDialogFilter = 'xTactics games (.xtg)|*.xtg|All files|*.*'; 130 SMissingServerClientForPlayer = 'Server client for current player not found.'; 129 131 130 132 … … 190 192 ScaleDPI1.DPI := Point(XMLConfig1.GetValue('DPIX', 96), XMLConfig1.GetValue('DPIY', 96)); 191 193 ScaleDPI1.AutoDetect := XMLConfig1.GetValue('DPIAuto', True); 194 FormNewTabIndex := XMLConfig1.GetValue('FormNewTabIndex', 0); 192 195 end; 193 196 … … 203 206 XMLConfig1.SetValue('DPIY', ScaleDPI1.DPI.Y); 204 207 XMLConfig1.SetValue('DPIAuto', ScaleDPI1.AutoDetect); 208 XMLConfig1.SetValue('FormNewTabIndex', FormNewTabIndex); 205 209 end; 206 210 … … 297 301 try 298 302 FormNew.Load(Server); 303 FormNew.PageControl1.TabIndex := FormNewTabIndex; 299 304 if FormNew.ShowModal = mrOk then begin 300 305 FormNew.Save(Server); … … 303 308 GameLoaded := False; 304 309 end; 310 FormNewTabIndex := FormNew.PageControl1.TabIndex; 305 311 finally 306 312 FormNew.Free; … … 488 494 ServerClient := Server.Clients.SearchByPlayer(Game.CurrentPlayer); 489 495 if Assigned(ServerClient) then ServerClient.TurnStart 490 else raise Exception.Create( 'Server client for current player not found.');496 else raise Exception.Create(SMissingServerClientForPlayer); 491 497 end; 492 498 … … 573 579 if Game.Players.GetAliveCount = Game.Players.Count then Game.Running := True 574 580 else ShowMessage(Format(SPlayersNotInitialized, [Game.Players.Count, Game.Players.GetAliveCount])); 581 FormClient.AZoomAll.Execute; 575 582 RedrawClients; 576 583 UpdateOtherForms; … … 578 585 ServerClient := Server.Clients.SearchByPlayer(Game.CurrentPlayer); 579 586 if Assigned(ServerClient) then ServerClient.TurnStart 580 else raise Exception.Create( 'Server client for current player not found.');587 else raise Exception.Create(SMissingServerClientForPlayer); 581 588 end; 582 589 … … 616 623 GameSettings.Players[1].Name := SPlayer + ' 2'; 617 624 618 LoadConfig;619 625 GameSettings.LoadConfig(XMLConfig1, 'Game'); 620 626 Server.LoadConfig(XMLConfig1, 'Server'); … … 624 630 if not GameLoaded and ReopenLastFile and (LastOpenedList1.Items.Count > 0) then 625 631 LoadGame(LastOpenedList1.Items[0]); 626 ScaleDPI;627 632 FormClientActions; 628 633
Note:
See TracChangeset
for help on using the changeset viewer.