close Warning: Can't synchronize with repository "(default)" (No changeset 184 in the repository). Look in the Trac log for more information.

Changeset 182


Ignore:
Timestamp:
Feb 9, 2018, 10:06:13 AM (6 years ago)
Author:
chronos
Message:
  • Added: Popup menu action Spectate in Players stats window.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormPlayersStats.lfm

    r181 r182  
    33  Height = 300
    44  Top = 237
    5   Width = 596
     5  Width = 697
    66  Caption = 'Players stats'
    77  ClientHeight = 300
    8   ClientWidth = 596
     8  ClientWidth = 697
    99  DesignTimePPI = 120
    1010  OnClose = FormClose
     
    1515    Height = 292
    1616    Top = 4
    17     Width = 588
     17    Width = 689
    1818    Align = alClient
    1919    BorderSpacing.Around = 4
     
    2121      item
    2222        Caption = 'Name'
     23        Width = 100
     24      end   
     25      item
     26        Caption = 'Mode'
    2327        Width = 100
    2428      end   
     
    4044      end>
    4145    OwnerData = True
     46    PopupMenu = PopupMenu1
    4247    ReadOnly = True
    4348    RowSelect = True
     
    4651    OnData = ListView1Data
    4752  end
     53  object PopupMenu1: TPopupMenu
     54    left = 143
     55    top = 110
     56    object MenuItem1: TMenuItem
     57      Action = ASpectate
     58    end
     59  end
     60  object ActionList1: TActionList
     61    left = 358
     62    top = 111
     63    object ASpectate: TAction
     64      Caption = 'Spectate'
     65      OnExecute = ASpectateExecute
     66    end
     67  end
    4868end
  • trunk/Forms/UFormPlayersStats.pas

    r181 r182  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   UGame;
     9  Menus, ActnList, UGame;
    1010
    1111type
     
    1414
    1515  TFormPlayersStats = class(TForm)
     16    ASpectate: TAction;
     17    ActionList1: TActionList;
    1618    ListView1: TListView;
     19    MenuItem1: TMenuItem;
     20    PopupMenu1: TPopupMenu;
     21    procedure ASpectateExecute(Sender: TObject);
    1722    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    1823    procedure FormShow(Sender: TObject);
     
    4348  with TPlayer(Players[Item.Index]) do begin
    4449    Item.Caption := Name;
     50    Item.Data := Players[Item.Index];
     51    Item.SubItems.Add(PlayerModeText[Mode]);
    4552    Item.SubItems.Add(IntToStr(TotalCells));
    4653    Item.SubItems.Add(IntToStr(TotalDiscovered));
     
    6370end;
    6471
     72procedure TFormPlayersStats.ASpectateExecute(Sender: TObject);
     73begin
     74  if Assigned(ListView1.Selected) then
     75    Core.Spectate(TPlayer(ListView1.Selected.Data));
     76end;
     77
    6578procedure TFormPlayersStats.ReloadList;
    6679begin
  • trunk/Languages/xtactics.cs.po

    r181 r182  
    522522msgstr "Počátečních jednotek:"
    523523
     524#: tformplayersstats.aspectate.caption
     525msgid "Spectate"
     526msgstr "Pozorovat"
     527
    524528#: tformplayersstats.caption
    525529msgid "Players stats"
     
    532536
    533537#: tformplayersstats.listview1.columns[1].caption
     538msgid "Mode"
     539msgstr "Režim"
     540
     541#: tformplayersstats.listview1.columns[2].caption
    534542msgid "Cells"
    535 msgstr "Buňky"
    536 
    537 #: tformplayersstats.listview1.columns[2].caption
    538 msgid "Discovered"
    539543msgstr "Objevených"
    540544
    541545#: tformplayersstats.listview1.columns[3].caption
    542546msgctxt "tformplayersstats.listview1.columns[3].caption"
     547msgid "Discovered"
     548msgstr "Města"
     549
     550#: tformplayersstats.listview1.columns[4].caption
     551msgctxt "tformplayersstats.listview1.columns[4].caption"
    543552msgid "Cities"
    544 msgstr "Města"
    545 
    546 #: tformplayersstats.listview1.columns[4].caption
     553msgstr "Jednotky"
     554
     555#: tformplayersstats.listview1.columns[5].caption
     556msgctxt "tformplayersstats.listview1.columns[5].caption"
    547557msgid "Units"
    548558msgstr "Jednotky"
     
    690700
    691701#: uformhelp.scontent
    692 msgid ""
    693 "xTactics is a risk based strategic game. Main focus of the game is to offer player various possibilities to configure game conditions. Map for game is generated randomly for each play. Game is multiplayer so single player can play with other human opponents or with many computer opponents.\n"
     702msgid "xTactics is a risk based strategic game. Main focus of the game is to offer player various possibilities to configure game conditions. Map for game is generated randomly for each play. Game is multiplayer so single player can play with other human opponents or with many computer opponents.\n"
    694703"\n"
    695704"Each cell has defined number of units which can be instructed to attack enemy or neutral adjacent cells. Units can also defend against enemy attach from adjacent cells. You can move units inside your territory. \n"
     
    697706"\n"
    698707"Resolution of attack of units is determined by rule similar to one which is used in Risk game. Battle consist of several fights. Each fight attacker can use up to 3 units and defender up to 2 units. Number of units for each side determine number of dices. Both sides roll their dices and order them in descending order. Each side takes one dice with highest value. One who has dice with higher value wins. In case of tie, defender wins. Loser lose its unit and another pair of dices is evaluated. This process is calculated automatically and for each planned attack win probability is displayed.\n"
    699 msgstr ""
    700 "xTactics je strategická hra založena na hře Risk. Hlavní zaměření hry je nabídnout hráči různé možnosti k nastavení podmínek hry. Mapa hry je generována náhodně pro každou hru. Hra je pro více hráčů takže jeden hráč může hrát s dalšími lidskými protivníky nebo s mnoha počítačovými protivníky.\n"
     708""
     709msgstr "xTactics je strategická hra založena na hře Risk. Hlavní zaměření hry je nabídnout hráči různé možnosti k nastavení podmínek hry. Mapa hry je generována náhodně pro každou hru. Hra je pro více hráčů takže jeden hráč může hrát s dalšími lidskými protivníky nebo s mnoha počítačovými protivníky.\n"
    701710"\n"
    702711"Každá buňka má určitý počet jednotek, které mohou být použity k útoku na přilehlé nepřátelské nebo neutrální buňky. Jednotky se mohou bránit proti nepřátelském útoku z přilehlých buněk. Můžete přesouvat jednotky uvnitř území.\n"
     
    704713"\n"
    705714"Vyhodnocení útoku jednotek je určen pravidlem podobným tomu, které je použito u hry Risk. Bitva se skládá z několika bojů. Každá boj útočník může použít do 3 jednotek a obránce do 2 jednotek. Počet jednotek pro každou stranu určuje počet kostek. Obě strany házejí jejich kostkami a seřadí je v sestupném pořadí. Každá strana bere jednu kostku s nejvyšší hodnotou. Ten, který má kostku s vyšší hodnotou vyhrává. V případě remízy, vyhrává obránce. Prohrávající ztrácí své jednotky a další pár kostek je vyhodnocen. Tento proces je vypočítáván automaticky a pro každý plánovaný útok je zobrazena odhadovaná pravděpodobnost.\n"
     715""
    706716
    707717#: uformmain.sturn
  • trunk/Languages/xtactics.po

    r181 r182  
    507507msgstr ""
    508508
     509#: tformplayersstats.aspectate.caption
     510msgid "Spectate"
     511msgstr ""
     512
    509513#: tformplayersstats.caption
    510514msgid "Players stats"
     
    517521
    518522#: tformplayersstats.listview1.columns[1].caption
     523msgid "Mode"
     524msgstr ""
     525
     526#: tformplayersstats.listview1.columns[2].caption
    519527msgid "Cells"
    520 msgstr ""
    521 
    522 #: tformplayersstats.listview1.columns[2].caption
    523 msgid "Discovered"
    524528msgstr ""
    525529
    526530#: tformplayersstats.listview1.columns[3].caption
    527531msgctxt "tformplayersstats.listview1.columns[3].caption"
     532msgid "Discovered"
     533msgstr ""
     534
     535#: tformplayersstats.listview1.columns[4].caption
     536msgctxt "tformplayersstats.listview1.columns[4].caption"
    528537msgid "Cities"
    529538msgstr ""
    530539
    531 #: tformplayersstats.listview1.columns[4].caption
     540#: tformplayersstats.listview1.columns[5].caption
     541msgctxt "tformplayersstats.listview1.columns[5].caption"
    532542msgid "Units"
    533543msgstr ""
  • trunk/UCore.pas

    r181 r182  
    9191    //CurrentClient: TClient;
    9292    LocalClients: TObjectList; // TClient
     93    procedure Spectate(Player: TPlayer);
    9394    procedure UpdateActions;
    9495    procedure Init;
     
    359360
    360361procedure TCore.ANewSpectatorClientExecute(Sender: TObject);
    361 var
    362   Form: TFormClient;
    363 begin
    364   Form := TFormClient.Create(nil);
    365   Form.Client := Game.Server.Clients.New(SSpectator);
    366   //Form.Client.Form := Form;
    367   Form.AZoomAll.Execute;
    368   Form.Show;
     362begin
     363  Spectate(nil);
    369364end;
    370365
     
    480475end;
    481476
     477procedure TCore.Spectate(Player: TPlayer);
     478var
     479  Form: TFormClient;
     480begin
     481  Form := TFormClient.Create(nil);
     482  Form.Client := Game.Server.Clients.New(SSpectator);
     483  //Form.Client.Form := Form;
     484  //Form.Client.ControlPlayer := Player;
     485  Form.AZoomAll.Execute;
     486  Form.Show;
     487end;
     488
    482489procedure TCore.StartNewGame;
    483490begin
Note: See TracChangeset for help on using the changeset viewer.