- Timestamp:
- May 22, 2018, 9:43:29 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormClient.pas
r206 r207 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 9 UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, UCommPin, 10 UGeometry, UGameClient, UGameProtocol ;10 UGeometry, UGameClient, UGameProtocol, UThreading; 11 11 12 12 const … … 231 231 FClient.OnTurnStart := DoTurnStart; 232 232 FClient.OnDestroy := DoClientDestroy; 233 FClient.View.DestRect := TRect.CreateBounds(TPoint.Create(0, 0), TPoint.Create(PaintBox1.Width, PaintBox1.Height)); 233 234 end; 234 235 Redraw; … … 243 244 begin 244 245 TurnActive := True; 245 UpdateInterface;246 Synchronize(UpdateInterface); 246 247 end; 247 248 -
trunk/Forms/UFormMain.pas
r206 r207 149 149 FormClient.ManualDock(PanelMain, nil, alClient); 150 150 FormClient.Align := alClient; 151 FormClient.Show;152 151 end; 153 152 … … 179 178 procedure TFormMain.FormShow(Sender: TObject); 180 179 begin 180 Core.LoadConfig; 181 Core.ScaleDPI; 182 Core.PersistentForm.Load(Self, True); 181 183 Core.Init; 182 184 LoadConfig(Core.XMLConfig1, 'FormMain'); 183 Core.PersistentForm.Load(Self, True);184 185 ReloadView; 186 FormClient.Show; 185 187 end; 186 188 -
trunk/Forms/UFormNew.pas
r199 r207 342 342 ReloadView; 343 343 //Height := Trunc(1.5 * Height); 344 PageControl1.TabIndex := 0;344 //PageControl1.TabIndex := 0; 345 345 end; 346 346 -
trunk/Languages/xtactics.cs.po
r206 r207 740 740 msgid "xTactics games (.xtg)|*.xtg|All files|*.*" 741 741 msgstr "xTactics hry (.xtg)|*.xtg|Všechny soubory|*.*" 742 743 #: ucore.smissingserverclientforplayer 744 msgid "Server client for current player not found." 745 msgstr "Chybí klient serveru pro aktuálního hráče" 742 746 743 747 #: ucore.splayersnotinitialized -
trunk/Languages/xtactics.po
r206 r207 724 724 #: ucore.sfiledialogfilter 725 725 msgid "xTactics games (.xtg)|*.xtg|All files|*.*" 726 msgstr "" 727 728 #: ucore.smissingserverclientforplayer 729 msgid "Server client for current player not found." 726 730 msgstr "" 727 731 -
trunk/Packages/Common/UPersistentForm.pas
r192 r207 19 19 FMinVisiblePart: Integer; 20 20 FRegistryContext: TRegistryContext; 21 FirstLoad: Boolean; 21 22 procedure LoadControl(Control: TControl); 22 23 procedure SaveControl(Control: TControl); … … 119 120 RootKey := RegistryContext.RootKey; 120 121 OpenKey(RegistryContext.Key + '\Forms\' + Form.Name, True); 122 FirstLoad := not ValueExists('WindowState'); 121 123 // Normal size 122 124 FormNormalSize.Left := ReadIntegerWithDefault('NormalLeft', FormNormalSize.Left); … … 227 229 228 230 if not EqualRect(FormNormalSize, FormRestoredSize) or 229 DefaultMaximizedthen begin231 (DefaultMaximized and FirstLoad) then begin 230 232 // Restore to maximized state 231 233 Form.WindowState := wsNormal; … … 263 265 FMinVisiblePart := 50; 264 266 FRegistryContext.RootKey := HKEY_CURRENT_USER; 267 FirstLoad := False; 265 268 end; 266 269 -
trunk/UCore.lfm
r206 r207 4 4 OldCreateOrder = False 5 5 Height = 676 6 HorizontalOffset = 2 757 VerticalOffset = 1906 HorizontalOffset = 262 7 VerticalOffset = 203 8 8 Width = 1048 9 9 PPI = 120 -
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.