Changeset 181


Ignore:
Timestamp:
Feb 9, 2018, 9:41:25 AM (7 years ago)
Author:
chronos
Message:
  • Added: New window with players statistics.
Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormCharts.pas

    r145 r181  
    8989  LastIndex: Integer;
    9090begin
     91  Core.CoolTranslator1.TranslateComponentRecursive(Self);
    9192  with ComboBox1 do begin
    9293    LastIndex := ItemIndex;
  • trunk/Forms/UFormMain.lfm

    r180 r181  
    7272      Height = 32
    7373      Top = 2
    74       Caption = 'ToolButton2'
    7574      Style = tbsDivider
    7675    end
     
    166165        Action = Core.AShowUnitMoves
    167166      end
     167      object MenuItem28: TMenuItem
     168        Action = Core.APlayersStats
     169      end
    168170    end
    169171    object MenuItem16: TMenuItem
  • trunk/Forms/UFormMain.pas

    r180 r181  
    4242    MenuItem26: TMenuItem;
    4343    MenuItem27: TMenuItem;
     44    MenuItem28: TMenuItem;
    4445    MenuItemLoadRecent: TMenuItem;
    4546    MenuItem3: TMenuItem;
  • trunk/Forms/UFormUnitMoves.pas

    r150 r181  
    5151begin
    5252  Core.PersistentForm.Load(Self);
     53  Core.CoolTranslator1.TranslateComponentRecursive(Self);
    5354  ReloadList;
    5455end;
  • trunk/Languages/xtactics.cs.po

    r180 r181  
    7878#: tcore.anewspectatorclient.caption
    7979msgid "New spectator client"
    80 msgstr ""
     80msgstr "Nový klient divák"
     81
     82#: tcore.aplayersstats.caption
     83msgid "Players statistics"
     84msgstr "Statistiky hráčů"
    8185
    8286#: tcore.asettings.caption
     
    149153
    150154#: tformclient.astatusbarvisible.caption
    151 #, fuzzy
    152155msgctxt "tformclient.astatusbarvisible.caption"
    153156msgid "Statusbar visible"
     
    155158
    156159#: tformclient.atoolbarbigicons.caption
    157 #, fuzzy
    158160msgctxt "tformclient.atoolbarbigicons.caption"
    159161msgid "Toolbar big icons"
     
    161163
    162164#: tformclient.atoolbarvisible.caption
    163 #, fuzzy
    164165msgctxt "tformclient.atoolbarvisible.caption"
    165166msgid "Toolbar visible"
     
    167168
    168169#: tformclient.azoomall.caption
    169 #, fuzzy
    170170msgctxt "tformclient.azoomall.caption"
    171171msgid "Zoom all"
     
    173173
    174174#: tformclient.azoomin.caption
    175 #, fuzzy
    176175msgctxt "tformclient.azoomin.caption"
    177176msgid "Zoom in"
     
    179178
    180179#: tformclient.azoomout.caption
    181 #, fuzzy
    182180msgctxt "tformclient.azoomout.caption"
    183181msgid "Zoom out"
     
    186184#: tformclient.caption
    187185msgid "Client"
    188 msgstr ""
     186msgstr "Klient"
    189187
    190188#: tformhelp.caption
     
    219217
    220218#: tformmain.menuitem11.caption
    221 #, fuzzy
    222219msgctxt "tformmain.menuitem11.caption"
    223220msgid "Zoom all"
     
    225222
    226223#: tformmain.menuitem12.caption
    227 #, fuzzy
    228224msgctxt "tformmain.menuitem12.caption"
    229225msgid "Zoom in"
     
    231227
    232228#: tformmain.menuitem13.caption
    233 #, fuzzy
    234229msgctxt "tformmain.menuitem13.caption"
    235230msgid "Zoom out"
     
    242237
    243238#: tformmain.menuitem22.caption
    244 #, fuzzy
    245239msgctxt "tformmain.menuitem22.caption"
    246240msgid "Statusbar visible"
     
    258252msgstr "Načíst nedávné"
    259253
    260 #: tformmain.toolbutton2.caption
    261 msgid "ToolButton2"
    262 msgstr ""
    263 
    264254#: tformmove.buttoncancel.caption
    265255msgctxt "tformmove.buttoncancel.caption"
     
    356346
    357347#: tformnew.checkboxcity.caption
     348msgctxt "tformnew.checkboxcity.caption"
    358349msgid "Cities"
    359350msgstr "Města"
     
    531522msgstr "Počátečních jednotek:"
    532523
     524#: tformplayersstats.caption
     525msgid "Players stats"
     526msgstr "Statistiky hráčů"
     527
     528#: tformplayersstats.listview1.columns[0].caption
     529msgctxt "tformplayersstats.listview1.columns[0].caption"
     530msgid "Name"
     531msgstr "Jméno"
     532
     533#: tformplayersstats.listview1.columns[1].caption
     534msgid "Cells"
     535msgstr "Buňky"
     536
     537#: tformplayersstats.listview1.columns[2].caption
     538msgid "Discovered"
     539msgstr "Objevených"
     540
     541#: tformplayersstats.listview1.columns[3].caption
     542msgctxt "tformplayersstats.listview1.columns[3].caption"
     543msgid "Cities"
     544msgstr "Města"
     545
     546#: tformplayersstats.listview1.columns[4].caption
     547msgid "Units"
     548msgstr "Jednotky"
     549
    533550#: tformsettings.buttoncancel.caption
    534551msgctxt "tformsettings.buttoncancel.caption"
     
    668685
    669686#: uformclient.sturn
    670 #, fuzzy
    671687msgctxt "uformclient.sturn"
    672688msgid "turn"
     
    822838#: ugame.sspectator
    823839msgid "Spectator"
    824 msgstr ""
     840msgstr "Divák"
    825841
    826842#: ugame.sunfinishedbattle
  • trunk/Languages/xtactics.po

    r180 r181  
    7070msgstr ""
    7171
     72#: tcore.aplayersstats.caption
     73msgid "Players statistics"
     74msgstr ""
     75
    7276#: tcore.asettings.caption
    7377msgctxt "tcore.asettings.caption"
     
    237241msgstr ""
    238242
    239 #: tformmain.toolbutton2.caption
    240 msgid "ToolButton2"
    241 msgstr ""
    242 
    243243#: tformmove.buttoncancel.caption
    244244msgctxt "tformmove.buttoncancel.caption"
     
    333333
    334334#: tformnew.checkboxcity.caption
     335msgctxt "tformnew.checkboxcity.caption"
    335336msgid "Cities"
    336337msgstr ""
     
    504505#: tformplayer.label5.caption
    505506msgid "Start units:"
     507msgstr ""
     508
     509#: tformplayersstats.caption
     510msgid "Players stats"
     511msgstr ""
     512
     513#: tformplayersstats.listview1.columns[0].caption
     514msgctxt "tformplayersstats.listview1.columns[0].caption"
     515msgid "Name"
     516msgstr ""
     517
     518#: tformplayersstats.listview1.columns[1].caption
     519msgid "Cells"
     520msgstr ""
     521
     522#: tformplayersstats.listview1.columns[2].caption
     523msgid "Discovered"
     524msgstr ""
     525
     526#: tformplayersstats.listview1.columns[3].caption
     527msgctxt "tformplayersstats.listview1.columns[3].caption"
     528msgid "Cities"
     529msgstr ""
     530
     531#: tformplayersstats.listview1.columns[4].caption
     532msgid "Units"
    506533msgstr ""
    507534
  • trunk/UCore.lfm

    r180 r181  
    33  OnDestroy = DataModuleDestroy
    44  OldCreateOrder = False
    5   Height = 848
    6   HorizontalOffset = 695
    7   VerticalOffset = 182
    8   Width = 1175
     5  Height = 676
     6  HorizontalOffset = 365
     7  VerticalOffset = 284
     8  Width = 1048
    99  PPI = 120
    1010  object ActionList1: TActionList
     
    8686      Caption = 'New spectator client'
    8787      OnExecute = ANewSpectatorClientExecute
     88    end
     89    object APlayersStats: TAction
     90      Caption = 'Players statistics'
     91      OnExecute = APlayersStatsExecute
    8892    end
    8993  end
  • trunk/UCore.pas

    r180 r181  
    1616  TCore = class(TDataModule)
    1717    AAbout: TAction;
     18    APlayersStats: TAction;
    1819    ANewSpectatorClient: TAction;
    1920    AShowUnitMoves: TAction;
     
    4950    procedure AHelpExecute(Sender: TObject);
    5051    procedure ANewSpectatorClientExecute(Sender: TObject);
     52    procedure APlayersStatsExecute(Sender: TObject);
    5153    procedure ASettingsExecute(Sender: TObject);
    5254    procedure AShowChartsExecute(Sender: TObject);
     
    7880    procedure LoadGame(FileName: string);
    7981    procedure RedrawClients;
     82    procedure UpdateOtherForms;
    8083  public
    8184    Game: TGame;
     
    103106uses
    104107  UFormMove, UFormMain, UFormNew, UFormSettings, UFormAbout, UFormPlayer,
    105   UFormHelp, UFormCharts, UFormUnitMoves;
     108  UFormHelp, UFormCharts, UFormUnitMoves, UFormPlayersStats;
    106109
    107110const
     
    366369end;
    367370
     371procedure TCore.APlayersStatsExecute(Sender: TObject);
     372begin
     373  if not Assigned(FormPlayersStats) then
     374    FormPlayersStats := TFormPlayersStats.Create(nil);
     375  FormPlayersStats.Show;
     376end;
     377
    368378procedure TCore.ASettingsExecute(Sender: TObject);
    369379begin
     
    383393procedure TCore.AShowChartsExecute(Sender: TObject);
    384394begin
     395  if not Assigned(FormCharts) then FormCharts := TFormCharts.Create(nil);
    385396  FormCharts.Show;
    386397end;
     
    388399procedure TCore.AShowUnitMovesExecute(Sender: TObject);
    389400begin
     401  if not Assigned(FormUnitMoves) then FormUnitMoves := TFormUnitMoves.Create(nil);
    390402  FormUnitMoves.Show;
    391403end;
     
    416428procedure TCore.DataModuleDestroy(Sender: TObject);
    417429begin
     430  if Assigned(FormPlayersStats) then FreeAndNil(FormPlayersStats);
     431  if Assigned(FormUnitMoves) then FreeAndNil(FormUnitMoves);
     432  if Assigned(FormCharts) then FreeAndNil(FormCharts);
    418433  FreeAndNil(FormClients);
    419434  FreeAndNil(StoredDimension);
     
    446461  FormClient.AZoomAll.Execute;
    447462  RedrawClients;
    448   if FormCharts.Visible then FormCharts.Redraw;
    449   if FormUnitMoves.Visible then FormUnitMoves.ReloadList;
     463  UpdateOtherForms;
    450464end;
    451465
     
    457471    Form.Redraw;
    458472  FormClient.Redraw;
     473end;
     474
     475procedure TCore.UpdateOtherForms;
     476begin
     477  if Assigned(FormCharts) and FormCharts.Visible then FormCharts.Redraw;
     478  if Assigned(FormUnitMoves) and FormUnitMoves.Visible then FormUnitMoves.ReloadList;
     479  if Assigned(FormPlayersStats) and FormPlayersStats.Visible then FormPlayersStats.ReloadList;
    459480end;
    460481
     
    468489    else ShowMessage(Format(SPlayersNotInitialized, [Game.Players.Count, Game.Players.GetAliveCount]));
    469490  RedrawClients;
    470   if FormCharts.Visible then FormCharts.Redraw;
    471   if FormUnitMoves.Visible then FormUnitMoves.ReloadList;
     491  UpdateOtherForms;
    472492  ProcessComputerTurns;
    473493  UpdateActions;
     
    479499    FormClient.Client := Game.CurrentPlayer.Client;
    480500  end;
    481   if FormCharts.Visible then FormCharts.Redraw;
    482   if FormUnitMoves.Visible then FormUnitMoves.ReloadList;
     501  UpdateOtherForms;
    483502end;
    484503
    485504procedure TCore.DoMoveUpdated(UnitMove: TUnitMove);
    486505begin
    487   if FormUnitMoves.Visible then FormUnitMoves.ReloadList;
     506  if Assigned(FormUnitMoves) and FormUnitMoves.Visible then
     507    FormUnitMoves.ReloadList;
    488508end;
    489509
  • trunk/xtactics.lpi

    r180 r181  
    100100      </Item6>
    101101    </RequiredPackages>
    102     <Units Count="18">
     102    <Units Count="19">
    103103      <Unit0>
    104104        <Filename Value="xtactics.lpr"/>
     
    209209        <ResourceBaseClass Value="Form"/>
    210210      </Unit17>
     211      <Unit18>
     212        <Filename Value="Forms/UFormPlayersStats.pas"/>
     213        <IsPartOfProject Value="True"/>
     214        <ComponentName Value="FormPlayersStats"/>
     215        <ResourceBaseClass Value="Form"/>
     216      </Unit18>
    211217    </Units>
    212218  </ProjectOptions>
  • trunk/xtactics.lpr

    r180 r181  
    1212  { you can add units after this },
    1313  SysUtils, UFormMain, UFormMove, UFormNew, UFormCharts, UFormUnitMoves,
    14   UFormChat, UGameSocket, UTCP, UServerList;
     14  UFormChat, UGameSocket, UTCP, UServerList, UFormPlayersStats;
    1515
    1616{$R *.res}
     
    3535  Application.CreateForm(TFormMove, FormMove);
    3636  Application.CreateForm(TFormPlayer, FormPlayer);
    37   Application.CreateForm(TFormCharts, FormCharts);
    38   Application.CreateForm(TFormUnitMoves, FormUnitMoves);
    3937  Application.Run;
    4038end.
Note: See TracChangeset for help on using the changeset viewer.