Changeset 203 for trunk/Forms/UFormClient.pas
- Timestamp:
- May 18, 2018, 12:54:37 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.