Changeset 317 for trunk/Forms/FormUnitMoves.pas
- Timestamp:
- Jun 21, 2024, 12:44:53 PM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormUnitMoves.pas
r316 r317 1 unit UFormUnitMoves;1 unit FormUnitMoves; 2 2 3 3 interface 4 4 5 5 uses 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls; 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 FormEx; 7 8 8 9 type … … 10 11 { TFormUnitMoves } 11 12 12 TFormUnitMoves = class(TForm )13 TFormUnitMoves = class(TFormEx) 13 14 ListView1: TListView; 14 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);15 15 procedure FormShow(Sender: TObject); 16 16 procedure ListView1Data(Sender: TObject; Item: TListItem); 17 private18 19 17 public 20 18 procedure ReloadList; 21 19 end; 22 20 23 var24 FormUnitMoves: TFormUnitMoves;25 21 26 22 implementation 27 23 28 24 uses 29 UGame, UCore, UPlayer;25 Game, Core, Player; 30 26 31 27 {$R *.lfm} … … 35 31 procedure TFormUnitMoves.ListView1Data(Sender: TObject; Item: TListItem); 36 32 begin 37 if Assigned(Core. Game) and Assigned(Core.Game.CurrentPlayer) then38 with Core. Game.CurrentPlayer do33 if Assigned(Core.Core.Game) and Assigned(Core.Core.Game.CurrentPlayer) then 34 with Core.Core.Game.CurrentPlayer do 39 35 if (Mode = pmHuman) and (Item.Index < Moves.Count) then 40 36 with TUnitMove(Moves[Item.Index]) do begin … … 48 44 procedure TFormUnitMoves.FormShow(Sender: TObject); 49 45 begin 50 Core.PersistentForm.Load(Self);51 Core.ThemeManager1.UseTheme(Self);52 Core.CoolTranslator1.TranslateComponentRecursive(Self);53 46 ReloadList; 54 end;55 56 procedure TFormUnitMoves.FormClose(Sender: TObject;57 var CloseAction: TCloseAction);58 begin59 Core.PersistentForm.Save(Self);60 47 end; 61 48 62 49 procedure TFormUnitMoves.ReloadList; 63 50 begin 64 if Assigned(Core. Game) and Assigned(Core.Game.CurrentPlayer) and65 (Core. Game.CurrentPlayer.Mode = pmHuman) then66 ListView1.Items.Count := Core. Game.CurrentPlayer.Moves.Count51 if Assigned(Core.Core.Game) and Assigned(Core.Core.Game.CurrentPlayer) and 52 (Core.Core.Game.CurrentPlayer.Mode = pmHuman) then 53 ListView1.Items.Count := Core.Core.Game.CurrentPlayer.Moves.Count 67 54 else ListView1.Items.Count := 0; 68 55 ListView1.Refresh;
Note:
See TracChangeset
for help on using the changeset viewer.