Changeset 317 for trunk/Forms/FormClient.pas
- Timestamp:
- Jun 21, 2024, 12:44:53 PM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormClient.pas
r316 r317 1 unit UFormClient;1 unit FormClient; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 7 UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, Math, 8 UGeometry, UGameClient, UGameProtocol, Threading, UPlayer, UClientGUI, UFormMain; 7 Game, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, Math, 8 Geometry, GameClient, GameProtocol, Threading, Player, ClientGUI, 9 FormEx, Generics.Collections; 9 10 10 11 const … … 18 19 { TFormClient } 19 20 20 TFormClient = class(TForm )21 TFormClient = class(TFormEx) 21 22 ASurrender: TAction; 22 23 AGameEndTurn: TAction; … … 93 94 procedure DoClientDestroy(Sender: TObject); 94 95 public 95 FormMain: TFormMain;96 96 procedure LoadConfig(Config: TXmlConfig; Path: string); 97 97 procedure SaveConfig(Config: TXmlConfig; Path: string); … … 101 101 end; 102 102 103 var 104 FormClient: TFormClient;103 TFormClients = class(TObjectList<TFormClient>) 104 end; 105 105 106 106 const … … 111 111 112 112 uses 113 UCore, UFormMove;113 Core, FormMove; 114 114 115 115 resourcestring … … 321 321 if RedrawPending and not Drawing then begin 322 322 Drawing := True; 323 if not Core. DevelMode then RedrawPending := False;323 if not Core.Core.DevelMode then RedrawPending := False; 324 324 TimerPeriod := (9 * TimerPeriod + (Now - LastTimerTime)) / 10; 325 325 LastTimerTime := Now; … … 327 327 StatusBar1.Panels[1].Text := IntToStr(Trunc(DrawDuration / OneMillisecond)) + ' / ' + 328 328 IntToStr(Trunc(TimerPeriod / OneMillisecond)) + ' ms' + 329 ' ' + IntToStr(Core. Game.Map.CellLinks.Count);329 ' ' + IntToStr(Core.Core.Game.Map.CellLinks.Count); 330 330 NewCaption := 'xTactics'; 331 if Assigned(Core. Game.CurrentPlayer) then332 NewCaption := Core. Game.CurrentPlayer.Name + ' - ' + STurn + ' ' + IntToStr(Core.Game.TurnCounter) + ' - ' + NewCaption;331 if Assigned(Core.Core.Game.CurrentPlayer) then 332 NewCaption := Core.Core.Game.CurrentPlayer.Name + ' - ' + STurn + ' ' + IntToStr(Core.Core.Game.TurnCounter) + ' - ' + NewCaption; 333 333 Caption := NewCaption; 334 334 Drawing := False; … … 350 350 FClient.OnNextPlayer := DoNextPlayer; 351 351 FClient.View.DestRect := TRect.CreateBounds(TPoint.Create(0, 0), TPoint.Create(PaintBox1.Width, PaintBox1.Height)); 352 FClient.CellGridVisible := Core.C ellGridVisible;353 FClient.UnitShapeVisible := Core. UnitShapeVisible;352 FClient.CellGridVisible := Core.Core.CellGridVisible; 353 FClient.UnitShapeVisible := Core.Core.UnitShapeVisible; 354 354 end; 355 355 Redraw; … … 399 399 begin 400 400 if AToolBarBigIcons.Checked then begin 401 ToolBar1.Images := Core. ImageListLarge;402 ToolBar1.ButtonWidth := Core. ImageListLarge.Width + 7;403 ToolBar1.ButtonHeight := Core. ImageListLarge.Height + 6;404 ToolBar1.Width := Core. ImageListLarge.Width + 10;405 ToolBar1.Height := Core. ImageListLarge.Height + 10;401 ToolBar1.Images := Core.Core.ImageListLarge; 402 ToolBar1.ButtonWidth := Core.Core.ImageListLarge.Width + 7; 403 ToolBar1.ButtonHeight := Core.Core.ImageListLarge.Height + 6; 404 ToolBar1.Width := Core.Core.ImageListLarge.Width + 10; 405 ToolBar1.Height := Core.Core.ImageListLarge.Height + 10; 406 406 end else begin 407 ToolBar1.Images := Core. ImageListSmall;408 ToolBar1.ButtonWidth := Core. ImageListSmall.Width + 7;409 ToolBar1.ButtonHeight := Core. ImageListSmall.Height + 6;410 ToolBar1.Width := Core. ImageListSmall.Width + 10;411 ToolBar1.Height := Core. ImageListSmall.Height + 10;407 ToolBar1.Images := Core.Core.ImageListSmall; 408 ToolBar1.ButtonWidth := Core.Core.ImageListSmall.Width + 7; 409 ToolBar1.ButtonHeight := Core.Core.ImageListSmall.Height + 6; 410 ToolBar1.Width := Core.Core.ImageListSmall.Width + 10; 411 ToolBar1.Height := Core.Core.ImageListSmall.Height + 10; 412 412 end; 413 413 ToolBar1.Visible := AToolBarVisible.Checked; … … 433 433 TimerPeriod := 0; 434 434 LastTimerTime := Now; 435 Core.CoolTranslator1.TranslateComponentRecursive(Self);436 435 end; 437 436 438 437 procedure TFormClient.AZoomAllExecute(Sender: TObject); 439 438 begin 440 with Core , Game, Client, View do begin439 with Core.Core, Game, Client, View do begin 441 440 ZoomAll; 442 441 end; … … 512 511 procedure TFormClient.FormClose(Sender: TObject; var CloseAction: TCloseAction); 513 512 begin 514 SaveConfig(Core.XMLConfig1, 'FormClient'); 515 Core.PersistentForm.Save(Self); 513 SaveConfig(Core.Core.XMLConfig1, 'FormClient'); 516 514 end; 517 515 … … 529 527 begin 530 528 if (Key = EscapeKey) or (Key = ControlKey) then 531 if Assigned(Core. Game.CurrentPlayer) then begin529 if Assigned(Core.Core.Game.CurrentPlayer) then begin 532 530 Client.View.SelectedCell := nil; 533 531 Redraw; … … 538 536 begin 539 537 SetToolbarHints; 540 LoadConfig(Core.XMLConfig1, 'FormClient'); 541 Core.PersistentForm.Load(Self); 542 Core.ThemeManager1.UseTheme(Self); 538 LoadConfig(Core.Core.XMLConfig1, 'FormClient'); 543 539 UpdateInterface; 544 540 Redraw; … … 585 581 Cell := nil; 586 582 OldCell := Client.View.FocusedCell; 587 with Core. Game do583 with Core.Core.Game do 588 584 if Assigned(Client.ControlPlayer) then begin 589 585 if Map.Cyclic then begin … … 619 615 if (Abs(StartMousePoint.X - X) < Trunc(Screen.PixelsPerInch * MouseMinDiff)) and 620 616 (Abs(StartMousePoint.Y - Y) < Trunc(Screen.PixelsPerInch * MouseMinDiff)) then begin 621 if Core. Game.Running and (Core.Game.CurrentPlayer.Mode = pmHuman) and622 (Core. Game.CurrentPlayer = Client.ControlPlayer) then begin617 if Core.Core.Game.Running and (Core.Core.Game.CurrentPlayer.Mode = pmHuman) and 618 (Core.Core.Game.CurrentPlayer = Client.ControlPlayer) then begin 623 619 Client.View.SelectCell(TPoint.Create(X, Y), Client.ControlPlayer, Shift); 624 620 Redraw;
Note:
See TracChangeset
for help on using the changeset viewer.