Changeset 55 for trunk/Forms


Ignore:
Timestamp:
Aug 18, 2014, 9:34:15 AM (10 years ago)
Author:
chronos
Message:
  • Fixed: More translation of TGroupBox and TComboBox items.
  • Fixed: Shape of hexagon was not regular due to rounding error in polygon generation and drawing. Cells are now generated internally as bigger to avoid rounding error.
  • Fixed: After game end do not allow to execute End turn and End game actions.
  • Added: Preparation for random voronoi map. So far hidden in developer mode as algorithm is missing.
Location:
trunk/Forms
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNew.lfm

    r47 r55  
    240240    end
    241241    object RadioGroupGrowAmount: TRadioGroup
    242       Left = 360
     242      Left = 376
    243243      Height = 76
    244244      Top = 97
    245       Width = 241
     245      Width = 305
    246246      AutoFill = True
    247247      Caption = 'Per turn grow amount'
     
    254254      ChildSizing.ControlsPerLine = 1
    255255      ClientHeight = 49
    256       ClientWidth = 237
     256      ClientWidth = 301
    257257      Items.Strings = (
    258258        'By one'
     
    264264      Left = 8
    265265      Height = 105
    266       Top = 185
    267       Width = 185
     266      Top = 184
     267      Width = 312
    268268      AutoFill = True
    269269      Caption = 'Growing cells'
     
    276276      ChildSizing.ControlsPerLine = 1
    277277      ClientHeight = 78
    278       ClientWidth = 181
     278      ClientWidth = 308
    279279      Items.Strings = (
    280280        'None'
     
    285285    end
    286286    object ComboBoxGridType: TComboBox
    287       Left = 312
    288       Height = 37
     287      Left = 473
     288      Height = 33
    289289      Top = 201
    290290      Width = 208
     
    299299    end
    300300    object Label5: TLabel
    301       Left = 216
     301      Left = 336
    302302      Height = 25
    303303      Top = 201
     
    315315    end
    316316    object ComboBoxWinObjective: TComboBox
    317       Left = 160
    318       Height = 37
     317      Left = 232
     318      Height = 33
    319319      Top = 305
    320       Width = 208
     320      Width = 328
    321321      ItemHeight = 0
    322322      Items.Strings = (
     
    338338    end
    339339    object SpinEditNeutralUnits: TSpinEdit
    340       Left = 272
    341       Height = 35
    342       Top = 343
     340      Left = 384
     341      Height = 35
     342      Top = 344
    343343      Width = 98
    344344      MaxValue = 99
  • trunk/Forms/UFormNew.pas

    r42 r55  
    6969    Players: TPlayers;
    7070  public
     71    procedure Translate;
    7172    procedure ReloadView;
    7273    procedure Load(Game: TGame);
     
    8283
    8384uses
    84   UFormPlayer;
     85  UFormPlayer, UCore;
     86
     87resourcestring
     88  SGridTypeHexagon = 'Hexagonal';
     89  SGridTypeSquare = 'Square';
     90  SGridTypeTriangle = 'Triangonal';
     91  SGridTypeVoronoi = 'Voronoi random';
     92  SWinObjectiveDefeatAllOponents = 'Defeat all oponents';
     93  SWinObjectiveDefeatAllCities = 'Defeat all oponents cities';
     94  SWinObjectiveCapturePosition = 'Capture position';
     95  SWinObjectiveStayAliveForTurns = 'Stay alive for number of turns';
     96  SGrowNone = 'None';
     97  SGrowPlayerCities = 'Player cities';
     98  SGrowPlayerAllCells = 'Player all cells';
     99  SGrowAmountByOne = 'By one';
     100  SGrowAmountBySquareRoot = 'By square root';
     101
    85102
    86103{ TFormNew }
     
    141158end;
    142159
     160procedure TFormNew.Translate;
     161var
     162  LastIndex: Integer;
     163begin
     164  with ComboBoxGridType do begin
     165    LastIndex := ItemIndex;
     166    Clear;
     167    Items.Add(SGridTypeHexagon);
     168    Items.Add(SGridTypeSquare);
     169    Items.Add(SGridTypeTriangle);
     170    if Core.DevelMode then
     171      Items.Add(SGridTypeVoronoi);
     172    ItemIndex := LastIndex;
     173  end;
     174  with ComboBoxWinObjective do begin
     175    LastIndex := ItemIndex;
     176    Clear;
     177    Items.Add(SWinObjectiveDefeatAllOponents);
     178    Items.Add(SWinObjectiveDefeatAllCities);
     179    Items.Add(SWinObjectiveCapturePosition);
     180    Items.Add(SWinObjectiveStayAliveForTurns);
     181    ItemIndex := LastIndex;
     182  end;
     183  with RadioGroupGrowCells do begin
     184    LastIndex := ItemIndex;
     185    Items.Clear;
     186    Items.Add(SGrowNone);
     187    Items.Add(SGrowPlayerCities);
     188    Items.Add(SGrowPlayerAllCells);
     189    ItemIndex := LastIndex;
     190  end;
     191  with RadioGroupGrowAmount do begin
     192    LastIndex := ItemIndex;
     193    Items.Clear;
     194    Items.Add(SGrowAmountByOne);
     195    Items.Add(SGrowAmountBySquareRoot);
     196    ItemIndex := LastIndex;
     197  end;
     198end;
     199
    143200procedure TFormNew.ReloadView;
    144201begin
     
    148205  ButtonPlayerAdd.Enabled := Players.Count < MaxPlayerCount;
    149206  APlayerModify.Enabled := Assigned(ListView1.Selected);
     207  Translate;
    150208end;
    151209
  • trunk/Forms/UFormPlayer.pas

    r29 r55  
    2525    { private declarations }
    2626  public
     27    procedure Translate;
    2728    procedure Load(Player: TPlayer);
    2829    procedure Save(Player: TPlayer);
     
    3637{$R *.lfm}
    3738
     39resourcestring
     40  SHuman = 'Human';
     41  SComputer = 'Computer';
     42
    3843{ TFormPlayer }
     44
     45procedure TFormPlayer.Translate;
     46var
     47  LastIndex: Integer;
     48begin
     49  with ComboBox1 do begin
     50    LastIndex := ItemIndex;
     51    Clear;
     52    Items.Add(SHuman);
     53    Items.Add(SComputer);
     54    ItemIndex := LastIndex;
     55  end;
     56end;
    3957
    4058procedure TFormPlayer.Load(Player: TPlayer);
  • trunk/Forms/UFormSettings.lfm

    r33 r55  
    2929  object Label1: TLabel
    3030    Left = 20
    31     Height = 22
     31    Height = 25
    3232    Top = 26
    33     Width = 80
     33    Width = 95
    3434    Caption = 'Language:'
    3535    ParentColor = False
     
    3737  object ComboBoxLanguage: TComboBox
    3838    Left = 178
    39     Height = 32
     39    Height = 37
    4040    Top = 24
    4141    Width = 196
     
    4444    TabOrder = 2
    4545  end
     46  object CheckBoxDevelMode: TCheckBox
     47    Left = 16
     48    Height = 27
     49    Top = 80
     50    Width = 176
     51    Caption = 'Developer mode'
     52    TabOrder = 3
     53  end
    4654end
  • trunk/Forms/UFormSettings.lrt

    r33 r55  
    33TFORMSETTINGS.BUTTONCANCEL.CAPTION=Cancel
    44TFORMSETTINGS.LABEL1.CAPTION=Language:
     5TFORMSETTINGS.CHECKBOXDEVELMODE.CAPTION=Developer mode
  • trunk/Forms/UFormSettings.pas

    r33 r55  
    1515    ButtonOk: TButton;
    1616    ButtonCancel: TButton;
     17    CheckBoxDevelMode: TCheckBox;
    1718    ComboBoxLanguage: TComboBox;
    1819    Label1: TLabel;
     
    4142   ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language);
    4243   if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
     44   CheckBoxDevelMode.Checked := Core.DevelMode;
    4345end;
    4446
     
    4749  if ComboBoxLanguage.ItemIndex <> -1 then
    4850    Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
     51  Core.DevelMode := CheckBoxDevelMode.Checked;
    4952end;
    5053
Note: See TracChangeset for help on using the changeset viewer.