Ignore:
Timestamp:
Jan 10, 2025, 4:24:19 PM (7 hours ago)
Author:
chronos
Message:
  • Modified: Lowered idle CPU consumption.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormMain.pas

    r364 r414  
    6767    PopupMenuToolbar: TPopupMenu;
    6868    Separator1: TMenuItem;
    69     Timer1: TTimer;
    7069    ToolBar1: TToolBar;
    7170    ToolButton1: TToolButton;
     
    9493    procedure FormDestroy(Sender: TObject);
    9594    procedure EraseBackground(DC: HDC); override;
    96     procedure Timer1Timer(Sender: TObject);
    9795  private
    9896    FormActivated: Boolean;
     
    106104    FormUnitMoves: TFormUnitMoves;
    107105    FormCharts: TFormCharts;
     106    procedure UpdateInterface;
    108107    procedure LoadConfig(Config: TXmlConfig; Path: string);
    109108    procedure SaveConfig(Config: TXmlConfig; Path: string);
     
    128127begin
    129128  // Do nothing, all background space covered by controls
    130 end;
    131 
    132 procedure TFormMain.Timer1Timer(Sender: TObject);
    133 var
    134   NewCaption: string;
    135 begin
    136   NewCaption := 'xTactics';
    137   if Assigned(Core.Core.Game.CurrentPlayer) then
    138     NewCaption := Core.Core.Game.CurrentPlayer.Name + ' - ' + STurn + ' ' +
    139     IntToStr(Core.Core.Game.TurnCounter) + ' - ' + NewCaption;
    140   Caption := NewCaption;
    141129end;
    142130
     
    311299end;
    312300
     301procedure TFormMain.UpdateInterface;
     302var
     303  NewCaption: string;
     304begin
     305  NewCaption := 'xTactics';
     306  if Assigned(Core.Core.Game.CurrentPlayer) then
     307    NewCaption := Core.Core.Game.CurrentPlayer.Name + ' - ' + STurn + ' ' +
     308    IntToStr(Core.Core.Game.TurnCounter) + ' - ' + NewCaption;
     309  Caption := NewCaption;
     310end;
     311
    313312procedure TFormMain.FormShow(Sender: TObject);
    314313begin
Note: See TracChangeset for help on using the changeset viewer.