Changeset 36 for trunk/Forms


Ignore:
Timestamp:
Mar 8, 2014, 12:01:08 AM (11 years ago)
Author:
chronos
Message:
  • Added: Save and load game setting to persistent XML config file.
  • Fixed: Show error on player start cell initialization if there is not free place for other start cells.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        55xtactics.dbg
        66heaptrclog.trc
         7Config.xml
  • trunk/Forms/UFormNew.lfm

    r34 r36  
    8989    Left = 16
    9090    Height = 22
    91     Top = 206
    92     Width = 75
    93     Caption = 'Map size:'
     91    Top = 224
     92    Width = 88
     93    Caption = 'Map width:'
    9494    ParentColor = False
    9595  end
     
    9797    Left = 136
    9898    Height = 32
    99     Top = 200
     99    Top = 219
    100100    Width = 98
    101101    MinValue = 2
     102    OnChange = SpinEditMapSizeXChange
    102103    TabOrder = 6
    103104    Value = 2
    104105  end
    105106  object SpinEditMapSizeY: TSpinEdit
    106     Left = 256
     107    Left = 136
    107108    Height = 32
    108     Top = 200
    109     Width = 90
     109    Top = 270
     110    Width = 98
    110111    MinValue = 2
     112    OnChange = SpinEditMapSizeYChange
    111113    TabOrder = 7
    112114    Value = 2
    113   end
    114   object Label2: TLabel
    115     Left = 240
    116     Height = 22
    117     Top = 208
    118     Width = 9
    119     Caption = 'x'
    120     ParentColor = False
    121115  end
    122116  object ButtonPlayerModify: TButton
     
    130124    TabOrder = 8
    131125  end
    132   object SpinEdit1: TSpinEdit
     126  object SpinEditVoidPercent: TSpinEdit
    133127    Left = 224
    134128    Height = 32
     
    147141    ParentColor = False
    148142  end
     143  object TrackBarSizeX: TTrackBar
     144    Left = 248
     145    Height = 43
     146    Top = 216
     147    Width = 451
     148    Max = 100
     149    Min = 2
     150    OnChange = TrackBarSizeXChange
     151    Position = 2
     152    TickStyle = tsNone
     153    Anchors = [akTop, akLeft, akRight]
     154    TabOrder = 11
     155  end
     156  object TrackBarSizeY: TTrackBar
     157    Left = 248
     158    Height = 43
     159    Top = 264
     160    Width = 451
     161    Max = 100
     162    Min = 2
     163    OnChange = TrackBarSizeYChange
     164    Position = 2
     165    TickStyle = tsNone
     166    Anchors = [akTop, akLeft, akRight]
     167    TabOrder = 10
     168  end
     169  object Label2: TLabel
     170    Left = 16
     171    Height = 22
     172    Top = 272
     173    Width = 94
     174    Caption = 'Map height:'
     175    ParentColor = False
     176  end
    149177end
  • trunk/Forms/UFormNew.lrt

    r34 r36  
    99TFORMNEW.BUTTONPLAYERADD.CAPTION=Add
    1010TFORMNEW.BUTTONPLAYERREMOVE.CAPTION=Remove
    11 TFORMNEW.LABEL1.CAPTION=Map size:
    12 TFORMNEW.LABEL2.CAPTION=x
     11TFORMNEW.LABEL1.CAPTION=Map width:
    1312TFORMNEW.BUTTONPLAYERMODIFY.CAPTION=Modify
    1413TFORMNEW.LABEL3.CAPTION=%
     14TFORMNEW.LABEL2.CAPTION=Map height:
  • trunk/Forms/UFormNew.pas

    r34 r36  
    2424    Label3: TLabel;
    2525    ListView1: TListView;
    26     SpinEdit1: TSpinEdit;
     26    SpinEditVoidPercent: TSpinEdit;
    2727    SpinEditMapSizeX: TSpinEdit;
    2828    SpinEditMapSizeY: TSpinEdit;
     29    TrackBarSizeX: TTrackBar;
     30    TrackBarSizeY: TTrackBar;
    2931    procedure ButtonPlayerAddClick(Sender: TObject);
    3032    procedure ButtonPlayerModifyChangeBounds(Sender: TObject);
     
    3840    procedure ListView1SelectItem(Sender: TObject; Item: TListItem;
    3941      Selected: Boolean);
     42    procedure SpinEditMapSizeXChange(Sender: TObject);
     43    procedure SpinEditMapSizeYChange(Sender: TObject);
     44    procedure TrackBarSizeYChange(Sender: TObject);
     45    procedure TrackBarSizeXChange(Sender: TObject);
    4046  private
    4147    Players: TPlayers;
     
    7682end;
    7783
     84procedure TFormNew.SpinEditMapSizeXChange(Sender: TObject);
     85begin
     86  TrackBarSizeX.Position := SpinEditMapSizeX.Value;
     87end;
     88
     89procedure TFormNew.SpinEditMapSizeYChange(Sender: TObject);
     90begin
     91  TrackBarSizeY.Position := SpinEditMapSizeY.Value;
     92end;
     93
     94procedure TFormNew.TrackBarSizeYChange(Sender: TObject);
     95begin
     96  SpinEditMapSizeY.Value := TrackBarSizeY.Position;
     97end;
     98
     99procedure TFormNew.TrackBarSizeXChange(Sender: TObject);
     100begin
     101  SpinEditMapSizeX.Value := TrackBarSizeX.Position;
     102end;
     103
    78104procedure TFormNew.ReloadView;
    79105begin
     
    104130procedure TFormNew.CheckBoxVoidChange(Sender: TObject);
    105131begin
    106   SpinEdit1.Enabled := CheckBoxVoid.Checked;
     132  SpinEditVoidPercent.Enabled := CheckBoxVoid.Checked;
    107133end;
    108134
     
    142168begin
    143169  CheckBoxVoid.Checked := Game.VoidEnabled;
    144   SpinEdit1.Value := Game.VoidPercentage;
    145   SpinEdit1.Enabled := Game.VoidEnabled;
     170  SpinEditVoidPercent.Value := Game.VoidPercentage;
     171  SpinEditVoidPercent.Enabled := Game.VoidEnabled;
    146172  for I := 0 to Players.Count - 1 do
    147173    Players[I] := nil;
     
    168194  end;
    169195  Game.VoidEnabled := CheckBoxVoid.Checked;
    170   Game.VoidPercentage := SpinEdit1.Value;
     196  Game.VoidPercentage := SpinEditVoidPercent.Value;
    171197  Game.Map.Size := Point(SpinEditMapSizeX.Value, SpinEditMapSizeY.Value);
    172198end;
Note: See TracChangeset for help on using the changeset viewer.