Changeset 130 for trunk


Ignore:
Timestamp:
Jun 18, 2017, 11:27:44 AM (7 years ago)
Author:
chronos
Message:
  • Fixed: Require at least 2 players for a game.
  • Fixed: Translate more strings.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormCharts.pas

    r128 r130  
    2323  public
    2424    procedure Redraw;
     25    procedure Translate;
    2526  end;
    2627
     
    3435uses
    3536  UCore, UGame;
     37
     38resourcestring
     39  SOccupiedCells = 'Occupied cells';
     40  SMilitaryPower = 'Military power';
     41  SDiscoveredCells = 'Discovered cells';
     42  SCitiesCount = 'Cities count';
     43
    3644
    3745{ TFormCharts }
     
    5058begin
    5159  Core.PersistentForm.Load(Self);
     60  if (ComboBox1.ItemIndex = -1) and (ComboBox1.Items.Count > 0) then
     61    ComboBox1.ItemIndex := 0;
    5262  Redraw;
     63  Translate;
    5364end;
    5465
     
    7485end;
    7586
     87procedure TFormCharts.Translate;
     88var
     89  LastIndex: Integer;
     90begin
     91  with ComboBox1 do begin
     92    LastIndex := ItemIndex;
     93    Clear;
     94    Items.Add(SOccupiedCells);
     95    Items.Add(SMilitaryPower);
     96    Items.Add(SDiscoveredCells);
     97    Items.Add(SCitiesCount);
     98    ItemIndex := LastIndex;
     99  end;
     100end;
     101
    76102end.
    77103
  • trunk/Forms/UFormNew.lfm

    r107 r130  
    1313  OnShow = FormShow
    1414  Position = poMainFormCenter
    15   LCLVersion = '1.4.4.0'
     15  LCLVersion = '1.6.4.0'
    1616  object ButtonCancel: TButton
    1717    Left = 454
     
    4747    object TabSheet1: TTabSheet
    4848      Caption = 'Players'
    49       ClientHeight = 398
    50       ClientWidth = 854
     49      ClientHeight = 397
     50      ClientWidth = 663
    5151      object ListView1: TListView
    5252        Left = 4
    53         Height = 348
     53        Height = 347
    5454        Top = 4
    55         Width = 846
     55        Width = 655
    5656        Align = alTop
    5757        Anchors = [akTop, akLeft, akRight, akBottom]
     
    9090        Left = 224
    9191        Height = 25
    92         Top = 360
     92        Top = 359
    9393        Width = 83
    9494        Action = APlayerRemove
     
    9999        Left = 16
    100100        Height = 25
    101         Top = 360
     101        Top = 359
    102102        Width = 83
    103103        Action = APlayerAdd
     
    108108        Left = 120
    109109        Height = 25
    110         Top = 360
     110        Top = 359
    111111        Width = 83
    112112        Action = APlayerModify
     
    118118    object TabSheet2: TTabSheet
    119119      Caption = 'Map'
    120       ClientHeight = 401
    121       ClientWidth = 661
     120      ClientHeight = 397
     121      ClientWidth = 663
    122122      object Label1: TLabel
    123123        Left = 8
    124         Height = 25
     124        Height = 24
    125125        Top = 9
    126         Width = 89
     126        Width = 95
    127127        Caption = 'Map width:'
    128128        ParentColor = False
     
    130130      object Label2: TLabel
    131131        Left = 8
    132         Height = 25
     132        Height = 24
    133133        Top = 57
    134         Width = 95
     134        Width = 102
    135135        Caption = 'Map height:'
    136136        ParentColor = False
     
    138138      object SpinEditMapSizeX: TSpinEdit
    139139        Left = 128
    140         Height = 33
     140        Height = 34
    141141        Top = 4
    142142        Width = 98
     
    148148      object SpinEditMapSizeY: TSpinEdit
    149149        Left = 128
    150         Height = 33
     150        Height = 34
    151151        Top = 55
    152152        Width = 98
     
    160160        Height = 46
    161161        Top = 8
    162         Width = 410
     162        Width = 412
    163163        Max = 100
    164164        Min = 2
     
    173173        Height = 46
    174174        Top = 49
    175         Width = 410
     175        Width = 412
    176176        Max = 100
    177177        Min = 2
     
    184184      object Label5: TLabel
    185185        Left = 8
    186         Height = 25
     186        Height = 24
    187187        Top = 104
    188         Width = 77
     188        Width = 83
    189189        Caption = 'Grid type:'
    190190        ParentColor = False
     
    192192      object ComboBoxGridType: TComboBox
    193193        Left = 146
    194         Height = 33
     194        Height = 34
    195195        Top = 104
    196196        Width = 208
    197         ItemHeight = 25
     197        ItemHeight = 0
    198198        Items.Strings = (
    199199          'Hexagonal'
     
    206206      object ComboBoxMapShape: TComboBox
    207207        Left = 146
    208         Height = 33
     208        Height = 34
    209209        Top = 144
    210210        Width = 208
    211         ItemHeight = 25
     211        ItemHeight = 0
    212212        Items.Strings = (
    213213          'Hexagonal'
     
    221221      object Label8: TLabel
    222222        Left = 8
    223         Height = 25
     223        Height = 24
    224224        Top = 144
    225         Width = 92
     225        Width = 98
    226226        Caption = 'Map shape:'
    227227        ParentColor = False
     
    231231        Height = 27
    232232        Top = 110
    233         Width = 173
     233        Width = 175
    234234        Anchors = [akTop, akLeft, akRight]
    235235        AutoSize = False
     
    239239      object SpinEditVoidPercent: TSpinEdit
    240240        Left = 216
    241         Height = 33
     241        Height = 34
    242242        Top = 224
    243243        Width = 106
     
    248248      object CheckBoxVoid: TCheckBox
    249249        Left = 8
    250         Height = 29
     250        Height = 28
    251251        Top = 232
    252         Width = 177
     252        Width = 187
    253253        Caption = 'Inaccessible places'
    254254        OnChange = CheckBoxVoidChange
     
    257257      object CheckBoxCity: TCheckBox
    258258        Left = 8
    259         Height = 29
     259        Height = 28
    260260        Top = 272
    261         Width = 72
     261        Width = 71
    262262        Caption = 'Cities'
    263263        OnChange = CheckBoxCityChange
     
    266266      object SpinEditCityPercent: TSpinEdit
    267267        Left = 216
    268         Height = 33
     268        Height = 34
    269269        Top = 272
    270270        Width = 106
     
    275275      object Label4: TLabel
    276276        Left = 331
    277         Height = 25
     277        Height = 24
    278278        Top = 272
    279279        Width = 15
     
    283283      object Label3: TLabel
    284284        Left = 331
    285         Height = 25
     285        Height = 24
    286286        Top = 232
    287287        Width = 15
     
    291291      object SpinEditNeutralUnits: TSpinEdit
    292292        Left = 408
    293         Height = 33
     293        Height = 34
    294294        Top = 352
    295295        Width = 98
     
    301301      object Label7: TLabel
    302302        Left = 8
    303         Height = 25
     303        Height = 24
    304304        Top = 352
    305         Width = 207
     305        Width = 227
    306306        Caption = 'Max random neutral units:'
    307307        ParentColor = False
     
    309309      object EditImageFile: TEdit
    310310        Left = 144
    311         Height = 33
     311        Height = 34
    312312        Top = 184
    313         Width = 394
     313        Width = 396
    314314        Anchors = [akTop, akLeft, akRight]
    315315        TabOrder = 12
    316316      end
    317317      object ButtonImageBrowse: TButton
    318         Left = 546
     318        Left = 548
    319319        Height = 25
    320320        Top = 192
     
    327327      object Label9: TLabel
    328328        Left = 8
    329         Height = 25
     329        Height = 24
    330330        Top = 184
    331         Width = 82
     331        Width = 90
    332332        Caption = 'Image file:'
    333333        ParentColor = False
     
    335335      object CheckBoxBridges: TCheckBox
    336336        Left = 8
    337         Height = 29
     337        Height = 28
    338338        Top = 310
    339         Width = 199
     339        Width = 210
    340340        Caption = 'Bridges between cells'
    341341        TabOrder = 14
     
    344344    object TabSheet3: TTabSheet
    345345      Caption = 'Rules'
    346       ClientHeight = 398
    347       ClientWidth = 854
     346      ClientHeight = 397
     347      ClientWidth = 663
    348348      object RadioGroupGrowCells: TRadioGroup
    349349        Left = 15
     
    360360        ChildSizing.Layout = cclLeftToRightThenTopToBottom
    361361        ChildSizing.ControlsPerLine = 1
    362         ClientHeight = 75
     362        ClientHeight = 79
    363363        ClientWidth = 308
    364364        Items.Strings = (
     
    382382        Top = 240
    383383        Width = 328
    384         ItemHeight = 25
     384        ItemHeight = 0
    385385        Items.Strings = (
    386386          'Defeat all oponents'
     
    406406        ChildSizing.Layout = cclLeftToRightThenTopToBottom
    407407        ChildSizing.ControlsPerLine = 1
    408         ClientHeight = 46
     408        ClientHeight = 50
    409409        ClientWidth = 301
    410410        Items.Strings = (
  • trunk/Forms/UFormNew.pas

    r125 r130  
    9090    procedure Translate;
    9191    procedure ReloadView;
     92    procedure UpdateInterface;
    9293    procedure Load(Game: TGame);
    9394    procedure Save(Game: TGame);
     
    229230  ListView1.Items.Count := Players.Count;
    230231  ListView1.Refresh;
    231   ButtonPlayerRemove.Enabled := Assigned(ListView1.Selected) and (Players.Count > 1);
    232   ButtonPlayerAdd.Enabled := Players.Count < MaxPlayerCount;
     232  Translate;
     233  UpdateInterface;
     234end;
     235
     236procedure TFormNew.UpdateInterface;
     237begin
     238  APlayerRemove.Enabled := Assigned(ListView1.Selected) and (Players.Count > 2);
     239  APlayerAdd.Enabled := Players.Count < MaxPlayerCount;
    233240  APlayerModify.Enabled := Assigned(ListView1.Selected);
    234241  EditImageFile.Enabled := ComboBoxMapShape.ItemIndex = Integer(msImage);
    235242  ButtonImageBrowse.Enabled := ComboBoxMapShape.ItemIndex = Integer(msImage);
    236   Translate;
    237243end;
    238244
  • trunk/Languages/xtactics.cs.po

    r128 r130  
    121121
    122122#: tformcharts.combobox1.text
     123msgctxt "tformcharts.combobox1.text"
    123124msgid "Occupied cells"
    124125msgstr "Obsazené buňky"
     
    505506msgstr "Verze"
    506507
     508#: uformcharts.scitiescount
     509msgid "Cities count"
     510msgstr "Počet měst"
     511
     512#: uformcharts.sdiscoveredcells
     513msgid "Discovered cells"
     514msgstr "Objevených buněk"
     515
     516#: uformcharts.smilitarypower
     517msgid "Military power"
     518msgstr "Vojenská síla"
     519
     520#: uformcharts.soccupiedcells
     521msgctxt "uformcharts.soccupiedcells"
     522msgid "Occupied cells"
     523msgstr "Obsazené buňky"
     524
    507525#: uformmain.sturn
    508526msgid "turn"
  • trunk/Languages/xtactics.po

    r128 r130  
    111111
    112112#: tformcharts.combobox1.text
     113msgctxt "tformcharts.combobox1.text"
    113114msgid "Occupied cells"
    114115msgstr ""
     
    490491msgstr ""
    491492
     493#: uformcharts.scitiescount
     494msgid "Cities count"
     495msgstr ""
     496
     497#: uformcharts.sdiscoveredcells
     498msgid "Discovered cells"
     499msgstr ""
     500
     501#: uformcharts.smilitarypower
     502msgid "Military power"
     503msgstr ""
     504
     505#: uformcharts.soccupiedcells
     506msgctxt "uformcharts.soccupiedcells"
     507msgid "Occupied cells"
     508msgstr ""
     509
    492510#: uformmain.sturn
    493511msgid "turn"
  • trunk/UCore.pas

    r129 r130  
    442442  {$ENDIF}
    443443  FInitialized := True;
     444
    444445  LoadConfig;
    445446  Game.LoadConfig(XMLConfig1, 'Game');
    446447
     448  // Update translated default player names
     449  TPlayer(Game.Players[0]).Name := SPlayer + ' 1';
     450  TPlayer(Game.Players[1]).Name := SPlayer + ' 2';
     451
    447452  CommandLineParams;
    448453  ScaleDPI;
Note: See TracChangeset for help on using the changeset viewer.