Ignore:
Timestamp:
Jul 19, 2024, 9:46:33 PM (4 months ago)
Author:
chronos
Message:
  • Fixed: New game symetric map units calcualtion.
  • Fixed: Map preview with cell and unit borders.
  • Fixed: Allow to set preferred game system grid type.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormGameSystem.pas

    r317 r330  
    1919    CheckBoxUnitsMoveImmediately: TCheckBox;
    2020    CheckBoxUnitsSplitMerge: TCheckBox;
     21    ComboBoxPreferredGridType: TComboBox;
     22    Label5: TLabel;
    2123    OpenDialog1: TOpenDialog;
    2224    PageControl1: TPageControl;
     
    3638    FormBuildingKinds: TFormList;
    3739    procedure SetGameSystem(AValue: TGameSystem);
     40    procedure Translate;
    3841  public
    3942    property GameSystem: TGameSystem read FGameSystem write SetGameSystem;
     
    4750{$R *.lfm}
    4851
     52uses
     53  MapType;
     54
    4955resourcestring
    5056  SFileDialogFilter = 'xTactics game system (.xts)|*.xts|All files|*.*';
     57
    5158
    5259{ TFormGameSystem }
     
    8895  FormBuildingKinds.Align := alClient;
    8996  FormBuildingKinds.Visible := True;
     97  Translate;
    9098end;
    9199
     
    114122end;
    115123
     124procedure TFormGameSystem.Translate;
     125var
     126  LastIndex: Integer;
     127begin
     128  with ComboBoxPreferredGridType do begin
     129    LastIndex := ItemIndex;
     130    Clear;
     131    Items.AddObject(SGridTypeNone, TObject(mtNone));
     132    Items.AddObject(SGridTypeHexagonVertical, TObject(mtHexagonVertical));
     133    Items.AddObject(SGridTypeHexagonHorizontal, TObject(mtHexagonHorizontal));
     134    Items.AddObject(SGridTypeSquare, TObject(mtSquare));
     135    Items.AddObject(SGridTypeTriangle, TObject(mtTriangle));
     136    Items.AddObject(SGridTypeRandom, TObject(mtRandom));
     137    Items.AddObject(SGridTypeIsometric, TObject(mtIsometric));
     138    ItemIndex := LastIndex;
     139  end;
     140end;
     141
    116142procedure TFormGameSystem.LoadData(GameSystem: TGameSystem);
    117143begin
     
    120146  CheckBoxUnitsSplitMerge.Checked := GameSystem.UnitsSplitMerge;
    121147  CheckBoxUnitsMoveImmediately.Checked := GameSystem.UnitsMoveImmediately;
     148  ComboBoxPreferredGridType.ItemIndex := Integer(GameSystem.PreferedMapType);
    122149  FormNations.UpdateList;
    123150  FormNations.UpdateInterface;
     
    134161  GameSystem.UnitsSplitMerge := CheckBoxUnitsSplitMerge.Checked;
    135162  GameSystem.UnitsMoveImmediately := CheckBoxUnitsMoveImmediately.Checked;
     163  GameSystem.PreferedMapType := TMapType(ComboBoxPreferredGridType.ItemIndex);
    136164end;
    137165
Note: See TracChangeset for help on using the changeset viewer.