Changeset 336 for trunk/Core.pas


Ignore:
Timestamp:
Sep 7, 2024, 10:29:16 PM (2 months ago)
Author:
chronos
Message:
  • Added: Automated tests accessible in debug mode.
  • Fixed: Player units internal links.
  • Fixed: List items id regeneration before game save.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Core.pas

    r330 r336  
    1616  TCore = class(TDataModule)
    1717    AAbout: TAction;
     18    ATests: TAction;
    1819    AFullscreen: TAction;
    1920    AToggleFogOfWar: TAction;
     
    6061    procedure AShowKeyShortcutsExecute(Sender: TObject);
    6162    procedure AShowUnitMovesExecute(Sender: TObject);
     63    procedure ATestsExecute(Sender: TObject);
    6264    procedure AToggleFogOfWarExecute(Sender: TObject);
    6365    procedure Translator1Translate(Sender: TObject);
     
    127129
    128130uses
    129   FormNew, FormSettings, ClientAI, FormKeyShortcuts, Common, FormEx,
    130   FormHelp, FormUnitMoves, FormPlayersStats, ClientGUI, FormAbout;
     131  FormNew, FormSettings, ClientAI, FormKeyShortcuts, Common, FormEx, FormTests,
     132  FormHelp, FormUnitMoves, FormPlayersStats, ClientGUI, FormAbout, Tests;
    131133
    132134const
     
    292294procedure TCore.UpdateInterface;
    293295begin
    294   Core.AGameEnd.Enabled := Game.Running;
    295   Core.AFullscreen.Checked := FormMain.FullScreen;
     296  AGameEnd.Enabled := Game.Running;
     297  AFullscreen.Checked := FormMain.FullScreen;
     298  {$ifdef DEBUG}
     299  ATests.Visible := True;
     300  ATests.Enabled := True;
     301  {$else}
     302  ATests.Visible := False;
     303  ATests.Enabled := False;
     304  {$endif}
    296305end;
    297306
     
    470479  FormMain.FormUnitMoves.Game := Game;
    471480  FormMain.FormUnitMoves.Show;
     481end;
     482
     483procedure TCore.ATestsExecute(Sender: TObject);
     484var
     485  FormTests: TFormTests;
     486begin
     487  FormTests := TFormTests.Create(nil);
     488  FormTests.TestCases := GetTestCases;
     489  FormTests.ShowModal;
     490  FormTests.Free;
    472491end;
    473492
Note: See TracChangeset for help on using the changeset viewer.