Changeset 318
- Timestamp:
- Jun 21, 2024, 3:20:20 PM (5 months ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ClientGUI.pas
r317 r318 334 334 end; 335 335 end; 336 337 336 338 337 procedure TClientGUI.DrawCells(Canvas: TCanvas; View: TView); -
trunk/Core.pas
r317 r318 420 420 if not Assigned(FormMain.FormPlayersStats) then 421 421 FormMain.FormPlayersStats := TFormPlayersStats.Create(nil); 422 FormMain.FormPlayersStats.OnSpectate := Spectate; 422 423 FormMain.FormPlayersStats.Show; 423 424 end; … … 446 447 if not Assigned(FormMain.FormCharts) then 447 448 FormMain.FormCharts := TFormCharts.Create(nil); 449 FormMain.FormCharts.Game := Game; 448 450 FormMain.FormCharts.Show; 449 451 end; … … 451 453 procedure TCore.AShowKeyShortcutsExecute(Sender: TObject); 452 454 begin 453 if not Assigned(FormMain.FormKeyShortcuts) then FormMain.FormKeyShortcuts := TFormKeyShortcuts.Create(nil); 454 FormMain.FormKeyShortcuts.Show; 455 if not Assigned(FormMain.FormKeyShortcuts) then 456 FormMain.FormKeyShortcuts := TFormKeyShortcuts.Create(nil); 457 with FormMain.FormKeyShortcuts do begin 458 SourceComponents.Clear; 459 SourceComponents.Add(Self); 460 SourceComponents.Add(FormMain); 461 Show; 462 end; 455 463 end; 456 464 … … 459 467 if not Assigned(FormMain.FormUnitMoves) then 460 468 FormMain.FormUnitMoves := TFormUnitMoves.Create(nil); 469 FormMain.FormUnitMoves.Game := Game; 461 470 FormMain.FormUnitMoves.Show; 462 471 end; -
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; -
trunk/GameClient.pas
r317 r318 138 138 procedure TClient.ReceiveCmd(Command: TCommand; DataOut, DataIn: TStream); 139 139 begin 140 141 140 end; 142 141 … … 249 248 end; 250 249 251 252 250 end. 253 251 -
trunk/GameSystem.pas
r317 r318 81 81 begin 82 82 Files := TStringList.Create; 83 FindAllFiles(Files, Dir, '*' + GameSystemExt, True, faAnyFile); 84 for I := 0 to Files.Count - 1 do begin 85 NewItem := TGameSystem.Create; 86 NewItem.LoadFromFile(Files[I]); 87 Add(NewItem); 88 end; 89 Files.Free; 83 try 84 FindAllFiles(Files, Dir, '*' + GameSystemExt, True, faAnyFile); 85 for I := 0 to Files.Count - 1 do begin 86 NewItem := TGameSystem.Create; 87 NewItem.LoadFromFile(Files[I]); 88 Add(NewItem); 89 end; 90 finally 91 Files.Free; 92 end; 90 93 end; 91 94 -
trunk/Languages/xtactics.cs.po
r317 r318 210 210 msgctxt "formlist.snew" 211 211 msgid "New" 212 msgstr "Nov á"212 msgstr "Nový" 213 213 214 214 #: formlist.sremoveitems -
trunk/Player.pas
r317 r318 86 86 procedure SaveToNode(Node: TDOMNode); 87 87 end; 88 89 88 90 89 { TPlayer } … … 149 148 end; 150 149 150 TPlayerEvent = procedure (Player: TPlayer) of object; 151 151 TPlayerArray = array of TPlayer; 152 152 -
trunk/TCP.pas
r317 r318 199 199 destructor TTCPClientThread.Destroy; 200 200 begin 201 Socket.Free;201 FreeAndNil(Socket); 202 202 inherited; 203 203 end;
Note:
See TracChangeset
for help on using the changeset viewer.