Ignore:
Timestamp:
Jun 21, 2024, 12:44:53 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Remove U prefix from unit names.
  • Modified: Use TFormEx for all forms for code simplification.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormPlayersStats.pas

    r316 r317  
    1 unit UFormPlayersStats;
     1unit FormPlayersStats;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   Menus, ActnList, UGame, ListViewSort;
     7  Menus, ActnList, Game, ListViewSort, FormEx;
    88
    99type
     
    1111  { TFormPlayersStats }
    1212
    13   TFormPlayersStats = class(TForm)
     13  TFormPlayersStats = class(TFormEx)
    1414    ASpectate: TAction;
    1515    ActionList1: TActionList;
     
    1919    PopupMenu1: TPopupMenu;
    2020    procedure ASpectateExecute(Sender: TObject);
    21     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2221    procedure FormShow(Sender: TObject);
    2322    procedure ListView1Data(Sender: TObject; Item: TListItem);
     
    2827  end;
    2928
    30 var
    31   FormPlayersStats: TFormPlayersStats;
    32 
    3329
    3430implementation
    3531
    3632uses
    37   UCore, UPlayer;
     33  Core, Player;
    3834
    3935{$R *.lfm}
     
    4339procedure TFormPlayersStats.ListView1Data(Sender: TObject; Item: TListItem);
    4440begin
    45   with Core.Game do
     41  with Core.Core.Game do
    4642  if Item.Index < ListViewSort1.List.Count then
    4743  with TPlayer(ListViewSort1.List[Item.Index]) do begin
     
    8177begin
    8278  ListViewSort1.List.Clear;
    83   for I := 0 to Core.Game.Players.Count - 1 do begin
    84     ListViewSort1.List.Add(Core.Game.Players[I]);
     79  for I := 0 to Core.Core.Game.Players.Count - 1 do begin
     80    ListViewSort1.List.Add(Core.Core.Game.Players[I]);
    8581  end;
    8682end;
     
    8884procedure TFormPlayersStats.FormShow(Sender: TObject);
    8985begin
    90   Core.PersistentForm.Load(Self);
    91   Core.ThemeManager1.UseTheme(Self);
    92   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    9386  ReloadList;
    94 end;
    95 
    96 procedure TFormPlayersStats.FormClose(Sender: TObject;
    97   var CloseAction: TCloseAction);
    98 begin
    99   Core.PersistentForm.Save(Self);
    10087end;
    10188
     
    10390begin
    10491  if Assigned(ListView1.Selected) then
    105     Core.Spectate(TPlayer(ListView1.Selected.Data));
     92    Core.Core.Spectate(TPlayer(ListView1.Selected.Data));
    10693end;
    10794
Note: See TracChangeset for help on using the changeset viewer.