Changeset 203 for trunk/Forms
- Timestamp:
- May 18, 2018, 12:54:37 AM (7 years ago)
- Location:
- trunk/Forms
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormClient.lfm
r202 r203 1 1 object FormClient: TFormClient 2 Left = 4182 Left = 662 3 3 Height = 621 4 Top = 2534 Top = 413 5 5 Width = 775 6 6 Caption = 'Client' 7 7 ClientHeight = 621 8 8 ClientWidth = 775 9 DesignTimePPI = 1 209 DesignTimePPI = 144 10 10 OnClose = FormClose 11 11 OnCreate = FormCreate … … 17 17 object StatusBar1: TStatusBar 18 18 Left = 0 19 Height = 2820 Top = 59 319 Height = 30 20 Top = 591 21 21 Width = 775 22 22 Panels = < … … 34 34 object ToolBar1: TToolBar 35 35 Left = 0 36 Height = 59 336 Height = 591 37 37 Top = 0 38 38 Width = 32 … … 75 75 object PaintBox1: TPaintBox 76 76 Left = 32 77 Height = 59 377 Height = 591 78 78 Top = 0 79 79 Width = 743 … … 132 132 ImageIndex = 0 133 133 OnExecute = AGameEndTurnExecute 134 ShortCut = 16468 134 135 end 135 136 end -
trunk/Forms/UFormClient.pas
r202 r203 76 76 LastTimerTime: TDateTime; 77 77 TimerPeriod: TDateTime; 78 TurnActive: Boolean; 78 79 procedure SetClient(AValue: TClient); 79 80 procedure DoClientChange(Sender: TObject); 80 procedure DoOnMove(CellFrom, CellTo: TCell; var CountOnce, 81 procedure DoTurnStart(Sender: TObject); 82 procedure DoMove(CellFrom, CellTo: TCell; var CountOnce, 81 83 CountRepeat: Integer; Update: Boolean; var Confirm: Boolean); 82 84 public 83 85 procedure LoadConfig(Config: TXmlConfig; Path: string); 84 86 procedure SaveConfig(Config: TXmlConfig; Path: string); 85 procedure ReloadView;87 procedure UpdateInterface; 86 88 procedure Redraw; 87 89 property Client: TClient read FClient write SetClient; … … 103 105 { TFormClient } 104 106 105 procedure TFormClient.Do OnMove(CellFrom, CellTo: TCell; var CountOnce,107 procedure TFormClient.DoMove(CellFrom, CellTo: TCell; var CountOnce, 106 108 CountRepeat: Integer; Update: Boolean; var Confirm: Boolean); 107 109 var … … 210 212 FClient.Form := Self; 211 213 FClient.OnChange := DoClientChange; 212 FClient.OnMove := DoOnMove; 214 FClient.OnMove := DoMove; 215 FClient.OnTurnStart := DoTurnStart(); 213 216 end; 214 217 Redraw; … … 218 221 begin 219 222 Redraw; 223 end; 224 225 procedure TFormClient.DoTurnStart(Sender: TObject); 226 begin 227 TurnActive := True; 228 UpdateInterface; 220 229 end; 221 230 … … 238 247 end; 239 248 240 procedure TFormClient. ReloadView;249 procedure TFormClient.UpdateInterface; 241 250 begin 242 251 if AToolBarBigIcons.Checked then begin … … 255 264 ToolBar1.Visible := AToolBarVisible.Checked; 256 265 StatusBar1.Visible := AStatusBarVisible.Checked; 266 AGameEndTurn.Enabled := TurnActive; 257 267 end; 258 268 … … 295 305 begin 296 306 AToolBarBigIcons.Checked := not AToolBarBigIcons.Checked; 297 ReloadView;307 UpdateInterface; 298 308 end; 299 309 … … 301 311 begin 302 312 AStatusBarVisible.Checked := not AStatusBarVisible.Checked; 303 ReloadView;313 UpdateInterface; 304 314 end; 305 315 306 316 procedure TFormClient.AGameEndTurnExecute(Sender: TObject); 307 var 308 P: TGameProtocolClient; 309 P2: TCommPin; 310 begin 311 P := Client.Protocol; 312 P2 := P.Pin; 317 begin 318 TurnActive := False; 313 319 Client.Protocol.TurnEnd; 320 UpdateInterface; 314 321 end; 315 322 … … 317 324 begin 318 325 AToolBarVisible.Checked := not AToolBarVisible.Checked; 319 ReloadView;326 UpdateInterface; 320 327 end; 321 328 … … 370 377 LoadConfig(Core.XMLConfig1, 'FormClient'); 371 378 Core.PersistentForm.Load(Self); 372 ReloadView;379 UpdateInterface; 373 380 Redraw; 374 381 end; -
trunk/Forms/UFormMain.lfm
r181 r203 1 1 object FormMain: TFormMain 2 Left = 4472 Left = 801 3 3 Height = 621 4 Top = 3 034 Top = 352 5 5 Width = 775 6 6 Caption = 'xTactics' 7 ClientHeight = 5 967 ClientHeight = 587 8 8 ClientWidth = 775 9 DesignTimePPI = 1 209 DesignTimePPI = 144 10 10 Menu = MainMenu1 11 11 OnClose = FormClose … … 13 13 OnDestroy = FormDestroy 14 14 OnShow = FormShow 15 LCLVersion = '1.8. 0.6'15 LCLVersion = '1.8.2.0' 16 16 WindowState = wsMaximized 17 17 object ToolBar1: TToolBar … … 77 77 object PanelMain: TPanel 78 78 Left = 0 79 Height = 5 5679 Height = 547 80 80 Top = 40 81 81 Width = 775 … … 92 92 object MenuItem2: TMenuItem 93 93 Action = Core.AGameNew 94 Caption = 'New...' 94 95 end 95 96 object MenuItem3: TMenuItem … … 99 100 Action = Core.AGameRestart 100 101 end 101 object MenuItem4: TMenuItem102 Action = Core.AGameEndTurn103 end104 102 object MenuItem14: TMenuItem 105 103 Action = Core.AGameLoad … … 110 108 object MenuItem15: TMenuItem 111 109 Action = Core.AGameSave 110 ShortCut = 16467 111 end 112 object MenuItem29: TMenuItem 113 Action = Core.AGameSaveAs 114 Caption = 'Save as' 115 ShortCut = 24659 112 116 end 113 117 object MenuItem5: TMenuItem -
trunk/Forms/UFormMain.pas
r196 r203 43 43 MenuItem27: TMenuItem; 44 44 MenuItem28: TMenuItem; 45 MenuItem29: TMenuItem; 45 46 MenuItemLoadRecent: TMenuItem; 46 47 MenuItem3: TMenuItem; 47 MenuItem4: TMenuItem;48 48 MenuItem5: TMenuItem; 49 49 MenuItem6: TMenuItem;
Note:
See TracChangeset
for help on using the changeset viewer.