Changeset 318 for trunk/Forms
- Timestamp:
- Jun 21, 2024, 3:20:20 PM (5 months ago)
- Location:
- trunk/Forms
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormCharts.pas
r317 r318 5 5 uses 6 6 Classes, SysUtils, FileUtil, TAGraph, TASeries, Forms, Controls, Graphics, 7 Dialogs, StdCtrls, FormEx ;7 Dialogs, StdCtrls, FormEx, Game; 8 8 9 9 type … … 16 16 procedure ComboBox1Change(Sender: TObject); 17 17 procedure FormShow(Sender: TObject); 18 private 19 FGame: TGame; 18 20 public 19 21 procedure Redraw; 20 22 procedure Translate; 23 property Game: TGame read FGame write FGame; 21 24 end; 22 25 … … 27 30 28 31 uses 29 Core, Game,Player;32 Player; 30 33 31 34 resourcestring … … 35 38 SCitiesCount = 'Cities count'; 36 39 SWinObjectiveCells = 'Win objective cells'; 37 38 40 39 41 { TFormCharts } … … 59 61 begin 60 62 Chart1.Series.Clear; 61 for I := 0 to Core.Core.Game.Players.Count - 1 do62 with TPlayer( Core.Core.Game.Players[I]) do begin63 for I := 0 to Game.Players.Count - 1 do 64 with TPlayer(Game.Players[I]) do begin 63 65 NewSeries := TLineSeries.Create(nil); 64 66 NewSeries.LinePen.Color := Color; 65 67 for X := 0 to TurnStats.Count - 1 do begin 66 if ComboBox1.ItemIndex = 0 then NewSeries.AddXY(X, T GameTurnStat(TurnStats[X]).OccupiedCells)67 else if ComboBox1.ItemIndex = 1 then NewSeries.AddXY(X, T GameTurnStat(TurnStats[X]).Units)68 else if ComboBox1.ItemIndex = 2 then NewSeries.AddXY(X, T GameTurnStat(TurnStats[X]).DiscoveredCells)69 else if ComboBox1.ItemIndex = 3 then NewSeries.AddXY(X, T GameTurnStat(TurnStats[X]).Cities)70 else if ComboBox1.ItemIndex = 4 then NewSeries.AddXY(X, T GameTurnStat(TurnStats[X]).WinObjectiveCells);68 if ComboBox1.ItemIndex = 0 then NewSeries.AddXY(X, TurnStats[X].OccupiedCells) 69 else if ComboBox1.ItemIndex = 1 then NewSeries.AddXY(X, TurnStats[X].Units) 70 else if ComboBox1.ItemIndex = 2 then NewSeries.AddXY(X, TurnStats[X].DiscoveredCells) 71 else if ComboBox1.ItemIndex = 3 then NewSeries.AddXY(X, TurnStats[X].Cities) 72 else if ComboBox1.ItemIndex = 4 then NewSeries.AddXY(X, TurnStats[X].WinObjectiveCells); 71 73 end; 72 74 Chart1.AddSeries(NewSeries); … … 78 80 LastIndex: Integer; 79 81 begin 80 Core.Core.Translator1.TranslateComponentRecursive(Self);82 TFormEx.Translator.TranslateComponentRecursive(Self); 81 83 with ComboBox1 do begin 82 84 LastIndex := ItemIndex; -
trunk/Forms/FormClient.pas
r317 r318 168 168 FormMove.ShowWinProbability := CellTo.MapCell.Player <> CellFrom.MapCell.Player; 169 169 170 FormMove.Game := Client.Game; 170 171 if FormMove.ShowModal = mrOk then begin 171 172 CountOnce := FormMove.SpinEditOnce.Value; -
trunk/Forms/FormGameSystems.lfm
r317 r318 1 1 object FormGameSystems: TFormGameSystems 2 2 Left = 1080 3 Height = 3 603 Height = 300 4 4 Top = 570 5 Width = 4 805 Width = 400 6 6 Caption = 'Game systems' 7 ClientHeight = 3 608 ClientWidth = 4 807 ClientHeight = 300 8 ClientWidth = 400 9 9 DesignTimePPI = 144 10 10 OnCreate = FormCreate … … 14 14 object ListView1: TListView 15 15 Left = 0 16 Height = 32216 Height = 262 17 17 Top = 0 18 Width = 4 8018 Width = 400 19 19 Align = alClient 20 20 Columns = < … … 39 39 Left = 0 40 40 Height = 38 41 Top = 32242 Width = 4 8041 Top = 262 42 Width = 400 43 43 Align = alBottom 44 44 Images = Core.ImageListSmall -
trunk/Forms/FormGameSystems.pas
r317 r318 127 127 finally 128 128 FreeAndNil(FormGameSystem); 129 end;130 TempEntry.Free;129 FreeAndNil(TempEntry); 130 end; 131 131 end; 132 132 -
trunk/Forms/FormItem.pas
r317 r318 35 35 36 36 {$R *.lfm} 37 38 uses39 Core;40 37 41 38 { TFormItem } … … 204 201 NewControl.Top := Y; 205 202 NewControl.Parent := Self; 206 Core.Core.Translator1.TranslateComponent(NewControl);207 Core.Core.ThemeManager1.ApplyTheme(NewControl);203 TFormEx.Translator.TranslateComponent(NewControl); 204 TFormEx.ThemeManager.ApplyTheme(NewControl); 208 205 NewControl.Visible := True; 209 206 DataControls.Add(NewControl); -
trunk/Forms/FormKeyShortcuts.lfm
r317 r318 1 1 object FormKeyShortcuts: TFormKeyShortcuts 2 2 Left = 1016 3 Height = 5243 Height = 437 4 4 Top = 501 5 Width = 6325 Width = 527 6 6 Caption = 'Key shortcuts' 7 ClientHeight = 5248 ClientWidth = 6327 ClientHeight = 437 8 ClientWidth = 527 9 9 DesignTimePPI = 144 10 OnCreate = FormCreate 11 OnDestroy = FormDestroy 10 12 OnShow = FormShow 11 13 LCLVersion = '3.4.0.0' 12 14 object ListView1: TListView 13 15 Left = 5 14 Height = 51416 Height = 427 15 17 Top = 5 16 Width = 62218 Width = 517 17 19 Align = alClient 18 20 BorderSpacing.Around = 5 -
trunk/Forms/FormKeyShortcuts.pas
r317 r318 5 5 uses 6 6 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, 7 ComCtrls, ActnList, LCLProc, Menus, FormEx ;7 ComCtrls, ActnList, LCLProc, Menus, FormEx, Generics.Collections; 8 8 9 9 type … … 15 15 MenuItem1: TMenuItem; 16 16 PopupMenu1: TPopupMenu; 17 procedure FormCreate(Sender: TObject); 18 procedure FormDestroy(Sender: TObject); 17 19 procedure FormShow(Sender: TObject); 18 20 procedure MenuItem1Click(Sender: TObject); 19 21 public 22 SourceComponents: TObjectList<TComponent>; 20 23 procedure LoadFromComponent(C: TComponent); 21 24 end; … … 25 28 26 29 uses 27 FormMain , Core;30 FormMain; 28 31 29 32 resourcestring … … 34 37 35 38 procedure TFormKeyShortcuts.FormShow(Sender: TObject); 39 var 40 I: Integer; 36 41 begin 37 42 try 38 43 ListView1.BeginUpdate; 39 44 ListView1.Clear; 40 LoadFromComponent(Core.Core);41 LoadFromComponent(Core.Core.FormMain);45 for I := 0 to SourceComponents.Count - 1 do 46 LoadFromComponent(SourceComponents[I]); 42 47 finally 43 48 ListView1.EndUpdate; 44 49 end; 50 end; 51 52 procedure TFormKeyShortcuts.FormCreate(Sender: TObject); 53 begin 54 SourceComponents := TObjectList<TComponent>.Create; 55 SourceComponents.OwnsObjects := False; 56 end; 57 58 procedure TFormKeyShortcuts.FormDestroy(Sender: TObject); 59 begin 60 FreeAndNil(SourceComponents); 45 61 end; 46 62 -
trunk/Forms/FormMove.pas
r317 r318 4 4 5 5 uses 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Spin, 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Spin, Game, 7 7 StdCtrls, ComCtrls, FormEx; 8 8 … … 43 43 ShowWinProbability: Boolean; 44 44 AllowChangeOnce: Boolean; 45 Game: TGame; 45 46 procedure UpdateView; 46 47 end; … … 50 51 51 52 {$R *.lfm} 52 53 uses54 Core;55 53 56 54 { TFormMove } … … 73 71 Label3.Visible := ShowWinProbability; 74 72 LabelWinProbability.Caption := 75 IntToStr(Round( Core.Core.Game.AttackProbability(AttackCount + SpinEditOnce.Value,73 IntToStr(Round(Game.AttackProbability(AttackCount + SpinEditOnce.Value, 76 74 DefendCount) * 100)) + ' %'; 77 75 end; -
trunk/Forms/FormPlayersStats.pas
r317 r318 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 Menus, ActnList, Game, ListViewSort, FormEx ;7 Menus, ActnList, Game, ListViewSort, FormEx, Player; 8 8 9 9 type … … 23 23 function ListViewSort1CompareItem(Item1, Item2: TObject): Integer; 24 24 procedure ListViewSort1Filter(ListViewSort: TListViewSort); 25 private 26 FOnSpectate: TPlayerEvent; 25 27 public 28 Game: TGame; 26 29 procedure ReloadList; 30 property OnSpectate: TPlayerEvent read FOnSpectate write FOnSpectate; 27 31 end; 28 32 29 33 30 34 implementation 31 32 uses33 Core, Player;34 35 35 36 {$R *.lfm} … … 39 40 procedure TFormPlayersStats.ListView1Data(Sender: TObject; Item: TListItem); 40 41 begin 41 with Core.Core.Game do42 with Game do 42 43 if Item.Index < ListViewSort1.List.Count then 43 44 with TPlayer(ListViewSort1.List[Item.Index]) do begin … … 77 78 begin 78 79 ListViewSort1.List.Clear; 79 for I := 0 to Core.Core.Game.Players.Count - 1 do begin80 ListViewSort1.List.Add( Core.Core.Game.Players[I]);80 for I := 0 to Game.Players.Count - 1 do begin 81 ListViewSort1.List.Add(Game.Players[I]); 81 82 end; 82 83 end; … … 90 91 begin 91 92 if Assigned(ListView1.Selected) then 92 Core.Core.Spectate(TPlayer(ListView1.Selected.Data)); 93 if Assigned(FOnSpectate) then 94 FOnSpectate(TPlayer(ListView1.Selected.Data)); 93 95 end; 94 96 -
trunk/Forms/FormSettings.pas
r317 r318 41 41 procedure Save; 42 42 end; 43 44 43 45 44 -
trunk/Forms/FormUnitMoves.lfm
r317 r318 1 1 object FormUnitMoves: TFormUnitMoves 2 2 Left = 879 3 Height = 4 994 Top = 51 45 Width = 9503 Height = 418 4 Top = 511 5 Width = 802 6 6 Caption = 'Unit moves' 7 ClientHeight = 4 998 ClientWidth = 9507 ClientHeight = 418 8 ClientWidth = 802 9 9 DesignTimePPI = 144 10 10 OnShow = FormShow … … 12 12 object ListView1: TListView 13 13 Left = 0 14 Height = 4 9914 Height = 418 15 15 Top = 0 16 Width = 95016 Width = 802 17 17 Align = alClient 18 18 Columns = < -
trunk/Forms/FormUnitMoves.pas
r317 r318 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 FormEx ;7 FormEx, Game; 8 8 9 9 type … … 16 16 procedure ListView1Data(Sender: TObject; Item: TListItem); 17 17 public 18 Game: TGame; 18 19 procedure ReloadList; 19 20 end; … … 23 24 24 25 uses 25 Game, Core,Player;26 Player; 26 27 27 28 {$R *.lfm} … … 31 32 procedure TFormUnitMoves.ListView1Data(Sender: TObject; Item: TListItem); 32 33 begin 33 if Assigned( Core.Core.Game) and Assigned(Core.Core.Game.CurrentPlayer) then34 with Core.Core.Game.CurrentPlayer do34 if Assigned(Game) and Assigned(Game.CurrentPlayer) then 35 with Game.CurrentPlayer do 35 36 if (Mode = pmHuman) and (Item.Index < Moves.Count) then 36 37 with TUnitMove(Moves[Item.Index]) do begin … … 49 50 procedure TFormUnitMoves.ReloadList; 50 51 begin 51 if Assigned( Core.Core.Game) and Assigned(Core.Core.Game.CurrentPlayer) and52 ( Core.Core.Game.CurrentPlayer.Mode = pmHuman) then53 ListView1.Items.Count := Core.Core.Game.CurrentPlayer.Moves.Count52 if Assigned(Game) and Assigned(Game.CurrentPlayer) and 53 (Game.CurrentPlayer.Mode = pmHuman) then 54 ListView1.Items.Count := Game.CurrentPlayer.Moves.Count 54 55 else ListView1.Items.Count := 0; 55 56 ListView1.Refresh;
Note:
See TracChangeset
for help on using the changeset viewer.