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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.