Changeset 74


Ignore:
Timestamp:
Oct 4, 2014, 9:19:27 PM (10 years ago)
Author:
chronos
Message:
  • Added: Show player color in player list.
  • Added: Confirmation dialog for game restart action.
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r73 r74  
    8989      Top = 162
    9090      Width = 32
    91       Caption = 'ToolButton9'
    9291      Style = tbsSeparator
    9392    end
  • trunk/Forms/UFormMain.lrt

    r58 r74  
    11TFORMMAIN.CAPTION=xTactics
    2 TFORMMAIN.TOOLBUTTON9.CAPTION=ToolButton9
    32TFORMMAIN.MENUITEM1.CAPTION=Game
    43TFORMMAIN.MENUITEM5.CAPTION=-
  • trunk/Forms/UFormNew.lfm

    r70 r74  
    4949      TabOrder = 0
    5050      ViewStyle = vsReport
     51      OnCustomDrawSubItem = ListView1CustomDrawSubItem
    5152      OnData = ListView1Data
    5253      OnDblClick = ListView1DblClick
     
    127128    object CheckBoxVoid: TCheckBox
    128129      Left = 8
    129       Height = 24
     130      Height = 27
    130131      Top = 101
    131       Width = 175
     132      Width = 198
    132133      Caption = 'Inaccessible places'
    133134      OnChange = CheckBoxVoidChange
     
    136137    object Label1: TLabel
    137138      Left = 8
    138       Height = 22
     139      Height = 25
    139140      Top = 9
    140       Width = 88
     141      Width = 104
    141142      Caption = 'Map width:'
    142143      ParentColor = False
     
    144145    object SpinEditMapSizeX: TSpinEdit
    145146      Left = 128
    146       Height = 32
     147      Height = 35
    147148      Top = 4
    148149      Width = 98
     
    154155    object SpinEditMapSizeY: TSpinEdit
    155156      Left = 128
    156       Height = 32
     157      Height = 35
    157158      Top = 55
    158159      Width = 98
     
    164165    object SpinEditVoidPercent: TSpinEdit
    165166      Left = 216
    166       Height = 32
     167      Height = 35
    167168      Top = 97
    168169      Width = 106
     
    173174    object Label3: TLabel
    174175      Left = 331
    175       Height = 22
     176      Height = 25
    176177      Top = 102
    177       Width = 15
     178      Width = 17
    178179      Caption = '%'
    179180      ParentColor = False
     
    207208    object Label2: TLabel
    208209      Left = 8
    209       Height = 22
     210      Height = 25
    210211      Top = 57
    211       Width = 94
     212      Width = 110
    212213      Caption = 'Map height:'
    213214      ParentColor = False
     
    215216    object CheckBoxCity: TCheckBox
    216217      Left = 8
    217       Height = 24
     218      Height = 27
    218219      Top = 141
    219       Width = 68
     220      Width = 73
    220221      Caption = 'Cities'
    221222      OnChange = CheckBoxCityChange
     
    224225    object SpinEditCityPercent: TSpinEdit
    225226      Left = 216
    226       Height = 32
     227      Height = 35
    227228      Top = 137
    228229      Width = 106
     
    233234    object Label4: TLabel
    234235      Left = 331
    235       Height = 22
     236      Height = 25
    236237      Top = 142
    237       Width = 15
     238      Width = 17
    238239      Caption = '%'
    239240      ParentColor = False
     
    253254      ChildSizing.Layout = cclLeftToRightThenTopToBottom
    254255      ChildSizing.ControlsPerLine = 1
    255       ClientHeight = 52
     256      ClientHeight = 49
    256257      ClientWidth = 301
    257258      Items.Strings = (
     
    275276      ChildSizing.Layout = cclLeftToRightThenTopToBottom
    276277      ChildSizing.ControlsPerLine = 1
    277       ClientHeight = 81
     278      ClientHeight = 78
    278279      ClientWidth = 308
    279280      Items.Strings = (
     
    286287    object ComboBoxGridType: TComboBox
    287288      Left = 473
    288       Height = 30
     289      Height = 37
    289290      Top = 201
    290291      Width = 208
     
    300301    object Label5: TLabel
    301302      Left = 336
    302       Height = 22
     303      Height = 25
    303304      Top = 201
    304       Width = 79
     305      Width = 90
    305306      Caption = 'Grid type:'
    306307      ParentColor = False
     
    308309    object Label6: TLabel
    309310      Left = 8
    310       Height = 22
     311      Height = 25
    311312      Top = 313
    312       Width = 114
     313      Width = 129
    313314      Caption = 'Win objective:'
    314315      ParentColor = False
     
    316317    object ComboBoxWinObjective: TComboBox
    317318      Left = 232
    318       Height = 30
     319      Height = 37
    319320      Top = 305
    320321      Width = 328
     
    331332    object Label7: TLabel
    332333      Left = 8
    333       Height = 22
     334      Height = 25
    334335      Top = 348
    335       Width = 211
     336      Width = 245
    336337      Caption = 'Max random neutral units:'
    337338      ParentColor = False
     
    339340    object SpinEditNeutralUnits: TSpinEdit
    340341      Left = 384
    341       Height = 32
     342      Height = 35
    342343      Top = 344
    343344      Width = 98
     
    349350    object CheckBoxSymetricMap: TCheckBox
    350351      Left = 334
    351       Height = 24
     352      Height = 27
    352353      Top = 238
    353       Width = 133
     354      Width = 151
    354355      Caption = 'Symetric map'
    355356      TabOrder = 15
  • trunk/Forms/UFormNew.pas

    r70 r74  
    5656    procedure FormDestroy(Sender: TObject);
    5757    procedure FormShow(Sender: TObject);
     58    procedure ListView1CustomDrawSubItem(Sender: TCustomListView;
     59      Item: TListItem; SubItem: Integer; State: TCustomDrawState;
     60      var DefaultDraw: Boolean);
    5861    procedure ListView1Data(Sender: TObject; Item: TListItem);
    5962    procedure ListView1DblClick(Sender: TObject);
     
    111114    Item.Data := Players[Item.Index];
    112115    Item.SubItems.Add(PlayerModeText[Mode]);
    113     Item.SubItems.Add(IntToStr(Color));
     116    Item.SubItems.Add(''); // Do not show color text
    114117    Item.SubItems.Add(IntToStr(StartUnits));
    115118  end;
     
    212215begin
    213216  ReloadView;
     217end;
     218
     219procedure TFormNew.ListView1CustomDrawSubItem(Sender: TCustomListView;
     220  Item: TListItem; SubItem: Integer; State: TCustomDrawState;
     221  var DefaultDraw: Boolean);
     222begin
     223  if SubItem = 2 then
     224  with ListView1.Canvas do begin
     225    Brush.Color := TPlayer(Item.Data).Color;
     226    Brush.Style := bsSolid;
     227    FillRect(Item.DisplayRectSubItem(2, drBounds));
     228  end;
    214229end;
    215230
  • trunk/Languages/xtactics.cs.po

    r70 r74  
    144144msgstr "Nástroje"
    145145
    146 #: tformmain.toolbutton9.caption
    147 msgid "ToolButton9"
    148 msgstr ""
    149 
    150146#: tformmove.buttoncancel.caption
    151147msgctxt "tformmove.buttoncancel.caption"
     
    243239#: tformnew.checkboxsymetricmap.caption
    244240msgid "Symetric map"
    245 msgstr ""
     241msgstr "Symetrická mapa"
    246242
    247243#: tformnew.checkboxvoid.caption
     
    316312
    317313#: tformplayer.caption
     314msgctxt "tformplayer.caption"
    318315msgid "Player"
    319316msgstr "Hráč"
     
    361358#: tformsettings.label2.caption
    362359msgid "Animation speed:"
    363 msgstr ""
     360msgstr "Rychlost animace:"
    364361
    365362#: tformsettings.label3.caption
    366 #, fuzzy
    367363msgctxt "tformsettings.label3.caption"
    368364msgid "%"
     
    382378msgstr "Hráč %s vyhrál"
    383379
     380#: ucore.srestartgame
     381msgid "Restart game?"
     382msgstr "Restartovat hru?"
     383
     384#: ucore.srestartgamequestion
     385msgid "Do you want to restart current game?"
     386msgstr "Chcete restartovat aktuální hru?"
     387
    384388#: uformabout.sapplicationname
    385389msgid "Application name"
     
    492496#: ugame.snewgamefile
    493497msgid "New game.xtg"
    494 msgstr ""
     498msgstr "Nová hry.xtg"
     499
     500#: ugame.splayer
     501msgctxt "ugame.splayer"
     502msgid "Player"
     503msgstr "Hráč"
    495504
    496505#: ugame.sunfinishedbattle
     
    500509#: ugame.swrongfileformat
    501510msgid "Wrong file format"
    502 msgstr ""
    503 
     511msgstr "Chybný formát souboru"
     512
  • trunk/Languages/xtactics.po

    r70 r74  
    134134msgstr ""
    135135
    136 #: tformmain.toolbutton9.caption
    137 msgid "ToolButton9"
    138 msgstr ""
    139 
    140136#: tformmove.buttoncancel.caption
    141137msgctxt "tformmove.buttoncancel.caption"
     
    304300
    305301#: tformplayer.caption
     302msgctxt "tformplayer.caption"
    306303msgid "Player"
    307304msgstr ""
     
    369366msgstr ""
    370367
     368#: ucore.srestartgame
     369msgid "Restart game?"
     370msgstr ""
     371
     372#: ucore.srestartgamequestion
     373msgid "Do you want to restart current game?"
     374msgstr ""
     375
    371376#: uformabout.sapplicationname
    372377msgid "Application name"
     
    481486msgstr ""
    482487
     488#: ugame.splayer
     489msgctxt "ugame.splayer"
     490msgid "Player"
     491msgstr ""
     492
    483493#: ugame.sunfinishedbattle
    484494msgid "Unfinished battle"
  • trunk/UCore.lfm

    r64 r74  
    99  object ActionList1: TActionList
    1010    Images = ImageListSmall
    11     left = 252
    12     top = 72
     11    left = 112
     12    top = 80
    1313    object AGameNew: TAction
    1414      Caption = 'New'
  • trunk/UCore.pas

    r72 r74  
    7575  SEndGame = 'End game?';
    7676  SEndGameQuestion = 'Do you want to end current game?';
     77  SRestartGame = 'Restart game?';
     78  SRestartGameQuestion = 'Do you want to restart current game?';
    7779
    7880
     
    203205procedure TCore.AGameRestartExecute(Sender: TObject);
    204206begin
    205   Game.New;
    206   Game.Running := True;
    207   FormMain.AZoomAll.Execute;
    208   FormMain.Redraw;
    209   UpdateActions;
     207  if MessageDlg(SRestartGame, SRestartGameQuestion, mtConfirmation, mbYesNo, 0) = mrYes then begin
     208    Game.New;
     209    Game.Running := True;
     210    FormMain.AZoomAll.Execute;
     211    FormMain.Redraw;
     212    UpdateActions;
     213  end;
    210214end;
    211215
  • trunk/UGame.pas

    r72 r74  
    329329resourcestring
    330330  SMinimumPlayers = 'You need at least two players';
     331  SPlayer = 'Player';
    331332  SHuman = 'Human';
    332333  SComputer = 'Computer';
     
    19131914
    19141915  Player := TPlayer.Create;
    1915   Player.Name := 'Player 1';
     1916  Player.Name := SPlayer + ' 1';
    19161917  Player.Game := Self;
    19171918  Player.Color := clBlue;
    19181919  Players.Add(Player);
    19191920  Player := TPlayer.Create;
    1920   Player.Name := 'Player 2';
     1921  Player.Name := SPlayer + ' 2';
    19211922  Player.Game := Self;
    19221923  Player.Color := clRed;
  • trunk/xtactics.lpi

    r73 r74  
    2424          <Version Value="11"/>
    2525          <Target>
    26             <Filename Value="lib/$(TargetCPU)-$(TargetOS)/xtactics"/>
     26            <Filename Value="xtactics"/>
    2727          </Target>
    2828          <SearchPaths>
     
    156156    <Version Value="11"/>
    157157    <Target>
    158       <Filename Value="lib/$(TargetCPU)-$(TargetOS)/xtactics"/>
     158      <Filename Value="xtactics"/>
    159159    </Target>
    160160    <SearchPaths>
Note: See TracChangeset for help on using the changeset viewer.