Changeset 31 for trunk


Ignore:
Timestamp:
Mar 4, 2014, 10:18:09 PM (11 years ago)
Author:
chronos
Message:
  • Added: Amount of inaccessible cells can be adjusted in New game dialog.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Languages/xtactics.cs.po

    r30 r31  
    112112msgstr "x"
    113113
     114#: tformnew.label3.caption
     115msgid "%"
     116msgstr ""
     117
    114118#: tformnew.listview1.columns[0].caption
    115119msgid "Name"
     
    170174msgid "You need at least two players"
    171175msgstr "Potřebujete alespoň dva hráče"
     176
  • trunk/Languages/xtactics.po

    r29 r31  
    103103msgstr ""
    104104
     105#: tformnew.label3.caption
     106msgid "%"
     107msgstr ""
     108
    105109#: tformnew.listview1.columns[0].caption
    106110msgid "Name"
  • trunk/UFormNew.lfm

    r29 r31  
    3030  end
    3131  object CheckBoxVoid: TCheckBox
    32     Left = 8
     32    Left = 16
    3333    Height = 24
    34     Top = 168
     34    Top = 172
    3535    Width = 175
    3636    Caption = 'Inaccessible places'
     37    OnChange = CheckBoxVoidChange
    3738    TabOrder = 2
    3839  end
     
    129130    TabOrder = 8
    130131  end
     132  object SpinEdit1: TSpinEdit
     133    Left = 224
     134    Height = 32
     135    Top = 168
     136    Width = 106
     137    MinValue = 1
     138    TabOrder = 9
     139    Value = 1
     140  end
     141  object Label3: TLabel
     142    Left = 339
     143    Height = 22
     144    Top = 173
     145    Width = 15
     146    Caption = '%'
     147    ParentColor = False
     148  end
    131149end
  • trunk/UFormNew.lrt

    r29 r31  
    1212TFORMNEW.LABEL2.CAPTION=x
    1313TFORMNEW.BUTTONPLAYERMODIFY.CAPTION=Modify
     14TFORMNEW.LABEL3.CAPTION=%
  • trunk/UFormNew.pas

    r30 r31  
    2222    Label1: TLabel;
    2323    Label2: TLabel;
     24    Label3: TLabel;
    2425    ListView1: TListView;
     26    SpinEdit1: TSpinEdit;
    2527    SpinEditMapSizeX: TSpinEdit;
    2628    SpinEditMapSizeY: TSpinEdit;
     
    2931    procedure ButtonPlayerModifyClick(Sender: TObject);
    3032    procedure ButtonPlayerRemoveClick(Sender: TObject);
     33    procedure CheckBoxVoidChange(Sender: TObject);
    3134    procedure FormCreate(Sender: TObject);
    3235    procedure FormDestroy(Sender: TObject);
     
    99102end;
    100103
     104procedure TFormNew.CheckBoxVoidChange(Sender: TObject);
     105begin
     106  SpinEdit1.Enabled := CheckBoxVoid.Checked;
     107end;
     108
    101109procedure TFormNew.ButtonPlayerAddClick(Sender: TObject);
    102110var
     
    134142begin
    135143  CheckBoxVoid.Checked := Game.VoidEnabled;
     144  SpinEdit1.Value := Game.VoidPercentage;
     145  SpinEdit1.Enabled := Game.VoidEnabled;
    136146  for I := 0 to Players.Count - 1 do
    137147    Players[I] := nil;
     
    158168  end;
    159169  Game.VoidEnabled := CheckBoxVoid.Checked;
     170  Game.VoidPercentage := SpinEdit1.Value;
    160171  Game.Map.Size := Point(SpinEditMapSizeX.Value, SpinEditMapSizeY.Value);
    161172end;
  • trunk/UGame.pas

    r30 r31  
    159159    Map: THexMap;
    160160    VoidEnabled: Boolean;
     161    VoidPercentage: Integer;
    161162    CurrentPlayer: TPlayer;
    162163    Moves: TObjectList; // TList<TMove>
     
    644645  Players.Add(Player);
    645646
    646   //VoidEnabled := True;
     647  VoidEnabled := True;
     648  VoidPercentage := 20;
    647649
    648650  Map := THexMap.Create;
     
    673675  for X := 0 to Map.Size.X - 1 do
    674676  with Map.Cells[Y, X] do begin
    675     if VoidEnabled and (Random(2) = 0) then Terrain := ttVoid
     677    if VoidEnabled and (Random < VoidPercentage / 100) then Terrain := ttVoid
    676678      else Terrain := ttNormal;
    677679    Power := Random(4);
Note: See TracChangeset for help on using the changeset viewer.