Changeset 41


Ignore:
Timestamp:
Mar 12, 2014, 8:40:53 PM (11 years ago)
Author:
chronos
Message:
  • Added: Key press and mouse double click in new game player list.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNew.lfm

    r39 r41  
    11object FormNew: TFormNew
    22  Left = 706
    3   Height = 526
     3  Height = 505
    44  Top = 455
    55  Width = 716
    66  Caption = 'New game'
    7   ClientHeight = 526
     7  ClientHeight = 505
    88  ClientWidth = 716
    99  OnCreate = FormCreate
     
    1111  OnShow = FormShow
    1212  LCLVersion = '1.3'
    13   object ButtonOk: TButton
    14     Left = 632
    15     Height = 25
    16     Top = 490
    17     Width = 75
    18     Anchors = [akRight, akBottom]
    19     Caption = 'Ok'
    20     ModalResult = 1
     13  object Panel1: TPanel
     14    Left = 0
     15    Height = 170
     16    Top = 0
     17    Width = 716
     18    Align = alTop
     19    BevelOuter = bvNone
     20    ClientHeight = 170
     21    ClientWidth = 716
    2122    TabOrder = 0
     23    object ListView1: TListView
     24      Left = 16
     25      Height = 150
     26      Top = 8
     27      Width = 594
     28      Anchors = [akTop, akLeft, akRight, akBottom]
     29      Columns = <     
     30        item
     31          Caption = 'Name'
     32          Width = 200
     33        end     
     34        item
     35          Caption = 'Type'
     36          Width = 100
     37        end     
     38        item
     39          Caption = 'Color'
     40          Width = 100
     41        end     
     42        item
     43          Caption = 'Start units'
     44          Width = 177
     45        end>
     46      OwnerData = True
     47      ReadOnly = True
     48      RowSelect = True
     49      TabOrder = 0
     50      ViewStyle = vsReport
     51      OnData = ListView1Data
     52      OnDblClick = ListView1DblClick
     53      OnKeyPress = ListView1KeyPress
     54      OnKeyUp = ListView1KeyUp
     55      OnSelectItem = ListView1SelectItem
     56    end
     57    object ButtonPlayerAdd: TButton
     58      Left = 616
     59      Height = 25
     60      Top = 8
     61      Width = 83
     62      Action = APlayerAdd
     63      Anchors = [akTop, akLeft, akRight]
     64      Caption = 'Add'
     65      TabOrder = 1
     66    end
     67    object ButtonPlayerRemove: TButton
     68      Left = 616
     69      Height = 25
     70      Top = 40
     71      Width = 83
     72      Action = APlayerRemove
     73      Anchors = [akTop, akRight]
     74      Caption = 'Remove'
     75      TabOrder = 2
     76    end
     77    object ButtonPlayerModify: TButton
     78      Left = 616
     79      Height = 25
     80      Top = 72
     81      Width = 83
     82      Action = APlayerModify
     83      Anchors = [akTop, akRight]
     84      Caption = 'Modify'
     85      TabOrder = 3
     86    end
    2287  end
    23   object ButtonCancel: TButton
    24     Left = 544
    25     Height = 25
    26     Top = 491
    27     Width = 75
    28     Anchors = [akBottom]
    29     Caption = 'Cancel'
    30     ModalResult = 2
    31     TabOrder = 1
     88  object Splitter1: TSplitter
     89    Cursor = crVSplit
     90    Left = 0
     91    Height = 5
     92    Top = 170
     93    Width = 716
     94    Align = alTop
     95    ResizeAnchor = akTop
    3296  end
    33   object CheckBoxVoid: TCheckBox
    34     Left = 16
    35     Height = 24
    36     Top = 276
    37     Width = 175
    38     Caption = 'Inaccessible places'
    39     OnChange = CheckBoxVoidChange
     97  object Panel2: TPanel
     98    Left = 0
     99    Height = 330
     100    Top = 175
     101    Width = 716
     102    Align = alClient
     103    BevelOuter = bvNone
     104    ClientHeight = 330
     105    ClientWidth = 716
    40106    TabOrder = 2
     107    object ButtonOk: TButton
     108      Left = 624
     109      Height = 25
     110      Top = 283
     111      Width = 75
     112      Anchors = [akRight, akBottom]
     113      Caption = 'Ok'
     114      ModalResult = 1
     115      TabOrder = 0
     116    end
     117    object ButtonCancel: TButton
     118      Left = 535
     119      Height = 25
     120      Top = 283
     121      Width = 75
     122      Anchors = [akBottom]
     123      Caption = 'Cancel'
     124      ModalResult = 2
     125      TabOrder = 1
     126    end
     127    object CheckBoxVoid: TCheckBox
     128      Left = 8
     129      Height = 24
     130      Top = 101
     131      Width = 175
     132      Caption = 'Inaccessible places'
     133      OnChange = CheckBoxVoidChange
     134      TabOrder = 2
     135    end
     136    object Label1: TLabel
     137      Left = 8
     138      Height = 22
     139      Top = 9
     140      Width = 88
     141      Caption = 'Map width:'
     142      ParentColor = False
     143    end
     144    object SpinEditMapSizeX: TSpinEdit
     145      Left = 128
     146      Height = 32
     147      Top = 4
     148      Width = 98
     149      MinValue = 2
     150      OnChange = SpinEditMapSizeXChange
     151      TabOrder = 3
     152      Value = 2
     153    end
     154    object SpinEditMapSizeY: TSpinEdit
     155      Left = 128
     156      Height = 32
     157      Top = 55
     158      Width = 98
     159      MinValue = 2
     160      OnChange = SpinEditMapSizeYChange
     161      TabOrder = 4
     162      Value = 2
     163    end
     164    object SpinEditVoidPercent: TSpinEdit
     165      Left = 216
     166      Height = 32
     167      Top = 97
     168      Width = 106
     169      MinValue = 1
     170      TabOrder = 5
     171      Value = 1
     172    end
     173    object Label3: TLabel
     174      Left = 331
     175      Height = 22
     176      Top = 102
     177      Width = 15
     178      Caption = '%'
     179      ParentColor = False
     180    end
     181    object TrackBarSizeX: TTrackBar
     182      Left = 240
     183      Height = 43
     184      Top = 1
     185      Width = 451
     186      Max = 100
     187      Min = 2
     188      OnChange = TrackBarSizeXChange
     189      Position = 2
     190      TickStyle = tsNone
     191      Anchors = [akTop, akLeft, akRight]
     192      TabOrder = 6
     193    end
     194    object TrackBarSizeY: TTrackBar
     195      Left = 240
     196      Height = 43
     197      Top = 49
     198      Width = 451
     199      Max = 100
     200      Min = 2
     201      OnChange = TrackBarSizeYChange
     202      Position = 2
     203      TickStyle = tsNone
     204      Anchors = [akTop, akLeft, akRight]
     205      TabOrder = 7
     206    end
     207    object Label2: TLabel
     208      Left = 8
     209      Height = 22
     210      Top = 57
     211      Width = 94
     212      Caption = 'Map height:'
     213      ParentColor = False
     214    end
     215    object CheckBoxCity: TCheckBox
     216      Left = 8
     217      Height = 24
     218      Top = 141
     219      Width = 68
     220      Caption = 'Cities'
     221      OnChange = CheckBoxCityChange
     222      TabOrder = 8
     223    end
     224    object SpinEditCityPercent: TSpinEdit
     225      Left = 216
     226      Height = 32
     227      Top = 137
     228      Width = 106
     229      MinValue = 1
     230      TabOrder = 9
     231      Value = 1
     232    end
     233    object Label4: TLabel
     234      Left = 331
     235      Height = 22
     236      Top = 142
     237      Width = 15
     238      Caption = '%'
     239      ParentColor = False
     240    end
     241    object RadioGroupGrowAmount: TRadioGroup
     242      Left = 360
     243      Height = 76
     244      Top = 97
     245      Width = 241
     246      AutoFill = True
     247      Caption = 'Per turn grow amount'
     248      ChildSizing.LeftRightSpacing = 6
     249      ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
     250      ChildSizing.EnlargeVertical = crsHomogenousChildResize
     251      ChildSizing.ShrinkHorizontal = crsScaleChilds
     252      ChildSizing.ShrinkVertical = crsScaleChilds
     253      ChildSizing.Layout = cclLeftToRightThenTopToBottom
     254      ChildSizing.ControlsPerLine = 1
     255      ClientHeight = 52
     256      ClientWidth = 237
     257      Items.Strings = (
     258        'By one'
     259        'By square root'
     260      )
     261      TabOrder = 10
     262    end
     263    object RadioGroupGrowCells: TRadioGroup
     264      Left = 8
     265      Height = 105
     266      Top = 185
     267      Width = 185
     268      AutoFill = True
     269      Caption = 'Growing cells'
     270      ChildSizing.LeftRightSpacing = 6
     271      ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
     272      ChildSizing.EnlargeVertical = crsHomogenousChildResize
     273      ChildSizing.ShrinkHorizontal = crsScaleChilds
     274      ChildSizing.ShrinkVertical = crsScaleChilds
     275      ChildSizing.Layout = cclLeftToRightThenTopToBottom
     276      ChildSizing.ControlsPerLine = 1
     277      ClientHeight = 81
     278      ClientWidth = 181
     279      Items.Strings = (
     280        'None'
     281        'Player cities'
     282        'Player all'
     283      )
     284      TabOrder = 11
     285    end
     286    object ComboBoxGridType: TComboBox
     287      Left = 312
     288      Height = 34
     289      Top = 201
     290      Width = 208
     291      ItemHeight = 0
     292      Items.Strings = (
     293        'Hexagonal'
     294        'Square'
     295      )
     296      Style = csDropDownList
     297      TabOrder = 12
     298    end
     299    object Label5: TLabel
     300      Left = 216
     301      Height = 22
     302      Top = 201
     303      Width = 79
     304      Caption = 'Grid type:'
     305      ParentColor = False
     306    end
    41307  end
    42   object ListView1: TListView
    43     Left = 16
    44     Height = 150
    45     Top = 8
    46     Width = 594
    47     Columns = <   
    48       item
    49         Caption = 'Name'
    50         Width = 200
    51       end   
    52       item
    53         Caption = 'Type'
    54         Width = 100
    55       end   
    56       item
    57         Caption = 'Color'
    58         Width = 100
    59       end   
    60       item
    61         Caption = 'Start units'
    62         Width = 177
    63       end>
    64     OwnerData = True
    65     ReadOnly = True
    66     RowSelect = True
    67     TabOrder = 3
    68     ViewStyle = vsReport
    69     OnData = ListView1Data
    70     OnSelectItem = ListView1SelectItem
    71   end
    72   object ButtonPlayerAdd: TButton
    73     Left = 616
    74     Height = 25
    75     Top = 8
    76     Width = 83
    77     Caption = 'Add'
    78     OnClick = ButtonPlayerAddClick
    79     TabOrder = 4
    80   end
    81   object ButtonPlayerRemove: TButton
    82     Left = 616
    83     Height = 25
    84     Top = 40
    85     Width = 83
    86     Caption = 'Remove'
    87     OnClick = ButtonPlayerRemoveClick
    88     TabOrder = 5
    89   end
    90   object Label1: TLabel
    91     Left = 16
    92     Height = 22
    93     Top = 184
    94     Width = 88
    95     Caption = 'Map width:'
    96     ParentColor = False
    97   end
    98   object SpinEditMapSizeX: TSpinEdit
    99     Left = 136
    100     Height = 32
    101     Top = 179
    102     Width = 98
    103     MinValue = 2
    104     OnChange = SpinEditMapSizeXChange
    105     TabOrder = 6
    106     Value = 2
    107   end
    108   object SpinEditMapSizeY: TSpinEdit
    109     Left = 136
    110     Height = 32
    111     Top = 230
    112     Width = 98
    113     MinValue = 2
    114     OnChange = SpinEditMapSizeYChange
    115     TabOrder = 7
    116     Value = 2
    117   end
    118   object ButtonPlayerModify: TButton
    119     Left = 616
    120     Height = 25
    121     Top = 72
    122     Width = 83
    123     Caption = 'Modify'
    124     OnChangeBounds = ButtonPlayerModifyChangeBounds
    125     OnClick = ButtonPlayerModifyClick
    126     TabOrder = 8
    127   end
    128   object SpinEditVoidPercent: TSpinEdit
    129     Left = 224
    130     Height = 32
    131     Top = 272
    132     Width = 106
    133     MinValue = 1
    134     TabOrder = 9
    135     Value = 1
    136   end
    137   object Label3: TLabel
    138     Left = 339
    139     Height = 22
    140     Top = 277
    141     Width = 15
    142     Caption = '%'
    143     ParentColor = False
    144   end
    145   object TrackBarSizeX: TTrackBar
    146     Left = 248
    147     Height = 43
    148     Top = 176
    149     Width = 451
    150     Max = 100
    151     Min = 2
    152     OnChange = TrackBarSizeXChange
    153     Position = 2
    154     TickStyle = tsNone
    155     Anchors = [akTop, akLeft, akRight]
    156     TabOrder = 11
    157   end
    158   object TrackBarSizeY: TTrackBar
    159     Left = 248
    160     Height = 43
    161     Top = 224
    162     Width = 451
    163     Max = 100
    164     Min = 2
    165     OnChange = TrackBarSizeYChange
    166     Position = 2
    167     TickStyle = tsNone
    168     Anchors = [akTop, akLeft, akRight]
    169     TabOrder = 10
    170   end
    171   object Label2: TLabel
    172     Left = 16
    173     Height = 22
    174     Top = 232
    175     Width = 94
    176     Caption = 'Map height:'
    177     ParentColor = False
    178   end
    179   object CheckBoxCity: TCheckBox
    180     Left = 16
    181     Height = 24
    182     Top = 316
    183     Width = 68
    184     Caption = 'Cities'
    185     OnChange = CheckBoxCityChange
    186     TabOrder = 12
    187   end
    188   object SpinEditCityPercent: TSpinEdit
    189     Left = 224
    190     Height = 32
    191     Top = 312
    192     Width = 106
    193     MinValue = 1
    194     TabOrder = 13
    195     Value = 1
    196   end
    197   object Label4: TLabel
    198     Left = 339
    199     Height = 22
    200     Top = 317
    201     Width = 15
    202     Caption = '%'
    203     ParentColor = False
    204   end
    205   object RadioGroupGrowAmount: TRadioGroup
    206     Left = 376
    207     Height = 76
    208     Top = 272
    209     Width = 241
    210     AutoFill = True
    211     Caption = 'Per turn grow amount'
    212     ChildSizing.LeftRightSpacing = 6
    213     ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
    214     ChildSizing.EnlargeVertical = crsHomogenousChildResize
    215     ChildSizing.ShrinkHorizontal = crsScaleChilds
    216     ChildSizing.ShrinkVertical = crsScaleChilds
    217     ChildSizing.Layout = cclLeftToRightThenTopToBottom
    218     ChildSizing.ControlsPerLine = 1
    219     ClientHeight = 52
    220     ClientWidth = 237
    221     Items.Strings = (
    222       'By one'
    223       'By square root'
    224     )
    225     TabOrder = 14
    226   end
    227   object RadioGroupGrowCells: TRadioGroup
    228     Left = 16
    229     Height = 105
    230     Top = 360
    231     Width = 185
    232     AutoFill = True
    233     Caption = 'Growing cells'
    234     ChildSizing.LeftRightSpacing = 6
    235     ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
    236     ChildSizing.EnlargeVertical = crsHomogenousChildResize
    237     ChildSizing.ShrinkHorizontal = crsScaleChilds
    238     ChildSizing.ShrinkVertical = crsScaleChilds
    239     ChildSizing.Layout = cclLeftToRightThenTopToBottom
    240     ChildSizing.ControlsPerLine = 1
    241     ClientHeight = 81
    242     ClientWidth = 181
    243     Items.Strings = (
    244       'None'
    245       'Player cities'
    246       'Player all'
    247     )
    248     TabOrder = 15
    249   end
    250   object ComboBoxGridType: TComboBox
    251     Left = 320
    252     Height = 32
    253     Top = 376
    254     Width = 208
    255     ItemHeight = 0
    256     Items.Strings = (
    257       'Hexagonal'
    258       'Square'
    259     )
    260     Style = csDropDownList
    261     TabOrder = 16
    262   end
    263   object Label5: TLabel
    264     Left = 224
    265     Height = 22
    266     Top = 376
    267     Width = 79
    268     Caption = 'Grid type:'
    269     ParentColor = False
     308  object ActionList1: TActionList
     309    Images = Core.ImageListSmall
     310    left = 224
     311    top = 64
     312    object APlayerModify: TAction
     313      Caption = 'Modify player'
     314      OnExecute = APlayerModifyExecute
     315    end
     316    object APlayerAdd: TAction
     317      Caption = 'Add player'
     318      OnExecute = APlayerAddExecute
     319    end
     320    object APlayerRemove: TAction
     321      Caption = 'Remove player'
     322      OnExecute = APlayerRemoveExecute
     323    end
    270324  end
    271325end
  • trunk/Forms/UFormNew.lrt

    r39 r41  
    11TFORMNEW.CAPTION=New game
    2 TFORMNEW.BUTTONOK.CAPTION=Ok
    3 TFORMNEW.BUTTONCANCEL.CAPTION=Cancel
    4 TFORMNEW.CHECKBOXVOID.CAPTION=Inaccessible places
    52TFORMNEW.LISTVIEW1.COLUMNS[0].CAPTION=Name
    63TFORMNEW.LISTVIEW1.COLUMNS[1].CAPTION=Type
     
    96TFORMNEW.BUTTONPLAYERADD.CAPTION=Add
    107TFORMNEW.BUTTONPLAYERREMOVE.CAPTION=Remove
     8TFORMNEW.BUTTONPLAYERMODIFY.CAPTION=Modify
     9TFORMNEW.BUTTONOK.CAPTION=Ok
     10TFORMNEW.BUTTONCANCEL.CAPTION=Cancel
     11TFORMNEW.CHECKBOXVOID.CAPTION=Inaccessible places
    1112TFORMNEW.LABEL1.CAPTION=Map width:
    12 TFORMNEW.BUTTONPLAYERMODIFY.CAPTION=Modify
    1313TFORMNEW.LABEL3.CAPTION=%
    1414TFORMNEW.LABEL2.CAPTION=Map height:
     
    1818TFORMNEW.RADIOGROUPGROWCELLS.CAPTION=Growing cells
    1919TFORMNEW.LABEL5.CAPTION=Grid type:
     20TFORMNEW.APLAYERMODIFY.CAPTION=Modify player
     21TFORMNEW.APLAYERADD.CAPTION=Add player
     22TFORMNEW.APLAYERREMOVE.CAPTION=Remove player
  • trunk/Forms/UFormNew.pas

    r40 r41  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, Spin, ExtCtrls, UGame;
     9  ComCtrls, Spin, ExtCtrls, ActnList, UGame;
    1010
    1111type
     
    1414
    1515  TFormNew = class(TForm)
    16     ButtonPlayerAdd: TButton;
     16    APlayerAdd: TAction;
     17    APlayerRemove: TAction;
     18    APlayerModify: TAction;
     19    ActionList1: TActionList;
    1720    ButtonCancel: TButton;
    1821    ButtonOk: TButton;
     22    ButtonPlayerAdd: TButton;
     23    ButtonPlayerModify: TButton;
    1924    ButtonPlayerRemove: TButton;
    20     ButtonPlayerModify: TButton;
     25    CheckBoxCity: TCheckBox;
    2126    CheckBoxVoid: TCheckBox;
    22     CheckBoxCity: TCheckBox;
    2327    ComboBoxGridType: TComboBox;
    2428    Label1: TLabel;
     
    2832    Label5: TLabel;
    2933    ListView1: TListView;
     34    Panel1: TPanel;
     35    Panel2: TPanel;
     36    RadioGroupGrowAmount: TRadioGroup;
    3037    RadioGroupGrowCells: TRadioGroup;
    31     RadioGroupGrowAmount: TRadioGroup;
    32     SpinEditVoidPercent: TSpinEdit;
     38    SpinEditCityPercent: TSpinEdit;
    3339    SpinEditMapSizeX: TSpinEdit;
    3440    SpinEditMapSizeY: TSpinEdit;
    35     SpinEditCityPercent: TSpinEdit;
     41    SpinEditVoidPercent: TSpinEdit;
     42    Splitter1: TSplitter;
    3643    TrackBarSizeX: TTrackBar;
    3744    TrackBarSizeY: TTrackBar;
    38     procedure ButtonPlayerAddClick(Sender: TObject);
    39     procedure ButtonPlayerModifyChangeBounds(Sender: TObject);
    40     procedure ButtonPlayerModifyClick(Sender: TObject);
    41     procedure ButtonPlayerRemoveClick(Sender: TObject);
     45    procedure APlayerAddExecute(Sender: TObject);
     46    procedure APlayerModifyExecute(Sender: TObject);
     47    procedure APlayerRemoveExecute(Sender: TObject);
    4248    procedure CheckBoxCityChange(Sender: TObject);
    4349    procedure CheckBoxVoidChange(Sender: TObject);
     
    4652    procedure FormShow(Sender: TObject);
    4753    procedure ListView1Data(Sender: TObject; Item: TListItem);
     54    procedure ListView1DblClick(Sender: TObject);
     55    procedure ListView1KeyPress(Sender: TObject; var Key: char);
     56    procedure ListView1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState
     57      );
    4858    procedure ListView1SelectItem(Sender: TObject; Item: TListItem;
    4959      Selected: Boolean);
     
    8494end;
    8595
     96procedure TFormNew.ListView1DblClick(Sender: TObject);
     97begin
     98  APlayerModify.Execute;
     99end;
     100
     101procedure TFormNew.ListView1KeyPress(Sender: TObject; var Key: char);
     102begin
     103  if (Key = #13) then APlayerModify.Execute;
     104end;
     105
     106procedure TFormNew.ListView1KeyUp(Sender: TObject; var Key: Word;
     107  Shift: TShiftState);
     108begin
     109  if Key = 45 then APlayerAdd.Execute;
     110  if Key = 46 then APlayerRemove.Execute;
     111end;
     112
    86113procedure TFormNew.ListView1SelectItem(Sender: TObject; Item: TListItem;
    87114  Selected: Boolean);
     
    116143  ButtonPlayerRemove.Enabled := Assigned(ListView1.Selected);
    117144  ButtonPlayerAdd.Enabled := Players.Count < MaxPlayerCount;
    118   ButtonPlayerModify.Enabled := Assigned(ListView1.Selected);
     145  APlayerModify.Enabled := Assigned(ListView1.Selected);
    119146end;
    120147
     
    129156end;
    130157
    131 procedure TFormNew.ButtonPlayerRemoveClick(Sender: TObject);
    132 begin
    133   if Assigned(ListView1.Selected) then
     158procedure TFormNew.CheckBoxCityChange(Sender: TObject);
     159begin
     160  SpinEditCityPercent.Enabled := CheckBoxCity.Checked;
     161end;
     162
     163procedure TFormNew.CheckBoxVoidChange(Sender: TObject);
     164begin
     165  SpinEditVoidPercent.Enabled := CheckBoxVoid.Checked;
     166end;
     167
     168procedure TFormNew.APlayerModifyExecute(Sender: TObject);
     169begin
     170  if Assigned(ListView1.Selected) then begin
     171    FormPlayer.Load(TPlayer(ListView1.Selected.Data));
     172    if FormPlayer.ShowModal = mrOk then begin
     173      FormPlayer.Save(TPlayer(ListView1.Selected.Data));
     174      ReloadView;
     175    end;
     176  end;
     177end;
     178
     179procedure TFormNew.APlayerRemoveExecute(Sender: TObject);
     180begin
     181  if Assigned(ListView1.Selected) then begin
    134182    Players.Remove(ListView1.Selected.Data);
    135   ReloadView;
    136 end;
    137 
    138 procedure TFormNew.CheckBoxCityChange(Sender: TObject);
    139 begin
    140   SpinEditCityPercent.Enabled := CheckBoxCity.Checked;
    141 end;
    142 
    143 procedure TFormNew.CheckBoxVoidChange(Sender: TObject);
    144 begin
    145   SpinEditVoidPercent.Enabled := CheckBoxVoid.Checked;
    146 end;
    147 
    148 procedure TFormNew.ButtonPlayerAddClick(Sender: TObject);
     183    ReloadView;
     184  end;
     185end;
     186
     187procedure TFormNew.APlayerAddExecute(Sender: TObject);
    149188var
    150189  NewPlayer: TPlayer;
    151190begin
    152   NewPlayer := TPlayer.Create;
    153   NewPlayer.Name := 'Player ' + IntToStr(Players.Count + 1);
    154   NewPlayer.Color := PlayerColors[Players.Count];
    155   NewPlayer.Mode := pmComputer;
    156   Players.Add(NewPlayer);
    157   ReloadView;
    158 end;
    159 
    160 procedure TFormNew.ButtonPlayerModifyChangeBounds(Sender: TObject);
    161 begin
    162 
    163 end;
    164 
    165 procedure TFormNew.ButtonPlayerModifyClick(Sender: TObject);
    166 begin
    167   FormPlayer.Load(TPlayer(ListView1.Selected.Data));
    168   if FormPlayer.ShowModal = mrOk then
    169     FormPlayer.Save(TPlayer(ListView1.Selected.Data));
     191  if Players.Count <= (MaxPlayerCount - 1) then begin
     192    NewPlayer := TPlayer.Create;
     193    NewPlayer.Name := 'Player ' + IntToStr(Players.Count + 1);
     194    NewPlayer.Color := PlayerColors[Players.Count];
     195    NewPlayer.Mode := pmComputer;
     196    Players.Add(NewPlayer);
     197    ReloadView;
     198  end;
    170199end;
    171200
  • trunk/Languages/xtactics.cs.po

    r40 r41  
    130130msgstr "Každý tah:"
    131131
     132#: tformnew.aplayeradd.caption
     133msgid "Add player"
     134msgstr ""
     135
     136#: tformnew.aplayermodify.caption
     137msgid "Modify player"
     138msgstr ""
     139
     140#: tformnew.aplayerremove.caption
     141msgid "Remove player"
     142msgstr ""
     143
    132144#: tformnew.buttoncancel.caption
    133145msgctxt "tformnew.buttoncancel.caption"
  • trunk/Languages/xtactics.po

    r40 r41  
    120120msgstr ""
    121121
     122#: tformnew.aplayeradd.caption
     123msgid "Add player"
     124msgstr ""
     125
     126#: tformnew.aplayermodify.caption
     127msgid "Modify player"
     128msgstr ""
     129
     130#: tformnew.aplayerremove.caption
     131msgid "Remove player"
     132msgstr ""
     133
    122134#: tformnew.buttoncancel.caption
    123135msgctxt "TFORMNEW.BUTTONCANCEL.CAPTION"
Note: See TracChangeset for help on using the changeset viewer.