Changeset 39 for trunk/Forms


Ignore:
Timestamp:
Mar 10, 2014, 11:01:14 PM (11 years ago)
Author:
chronos
Message:
  • Added: Option to create hexagonal or square map. This is implemented using object inheritance and virtual methods of class TMap.
  • Added: Dummy actions to load and save map.
Location:
trunk/Forms
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r35 r39  
    101101        Action = Core.AGameEndTurn
    102102      end
     103      object MenuItem14: TMenuItem
     104        Action = Core.AGameLoad
     105      end
     106      object MenuItem15: TMenuItem
     107        Action = Core.AGameSave
     108      end
    103109      object MenuItem5: TMenuItem
    104110        Caption = '-'
  • trunk/Forms/UFormMain.pas

    r35 r39  
    2727    MenuItem12: TMenuItem;
    2828    MenuItem13: TMenuItem;
     29    MenuItem14: TMenuItem;
     30    MenuItem15: TMenuItem;
    2931    MenuItem2: TMenuItem;
    3032    MenuItem3: TMenuItem;
     
    242244    if Assigned(Cell) then begin
    243245      Core.Game.CurrentPlayer.View.FocusedCell := Cell;
    244       StatusBar1.Panels[0].Text := '[' + IntToStr(Cell.Pos.X) + ', ' + IntToStr(Cell.Pos.Y) + '] (' + IntToStr(Cell.MovesFrom.Count) + ', ' + IntToStr(Cell.MovesTo.Count) + ')';
     246      StatusBar1.Panels[0].Text := '[' + IntToStr(Cell.Pos.X) + ', ' + IntToStr(Cell.Pos.Y) +
     247        '] (' + IntToStr(Cell.MovesFrom.Count) + ', ' + IntToStr(Cell.MovesTo.Count) + ')';
    245248    end else begin
    246249      Core.Game.CurrentPlayer.View.FocusedCell := nil;
  • trunk/Forms/UFormNew.lfm

    r38 r39  
    3535    Height = 24
    3636    Top = 276
    37     Width = 194
     37    Width = 175
    3838    Caption = 'Inaccessible places'
    3939    OnChange = CheckBoxVoidChange
     
    9292    Height = 22
    9393    Top = 184
    94     Width = 99
     94    Width = 88
    9595    Caption = 'Map width:'
    9696    ParentColor = False
     
    139139    Height = 22
    140140    Top = 277
    141     Width = 17
     141    Width = 15
    142142    Caption = '%'
    143143    ParentColor = False
     
    173173    Height = 22
    174174    Top = 232
    175     Width = 106
     175    Width = 94
    176176    Caption = 'Map height:'
    177177    ParentColor = False
     
    181181    Height = 24
    182182    Top = 316
    183     Width = 73
     183    Width = 68
    184184    Caption = 'Cities'
    185185    OnChange = CheckBoxCityChange
     
    199199    Height = 22
    200200    Top = 317
    201     Width = 17
     201    Width = 15
    202202    Caption = '%'
    203203    ParentColor = False
     
    248248    TabOrder = 15
    249249  end
     250  object ComboBoxGridType: TComboBox
     251    Left = 320
     252    Height = 32
     253    Top = 376
     254    Width = 208
     255    ItemHeight = 0
     256    Items.Strings = (
     257      'Hexagonal'
     258      'Square'
     259    )
     260    Style = csDropDownList
     261    TabOrder = 16
     262  end
     263  object Label5: TLabel
     264    Left = 224
     265    Height = 22
     266    Top = 376
     267    Width = 79
     268    Caption = 'Grid type:'
     269    ParentColor = False
     270  end
    250271end
  • trunk/Forms/UFormNew.lrt

    r38 r39  
    1717TFORMNEW.RADIOGROUPGROWAMOUNT.CAPTION=Per turn grow amount
    1818TFORMNEW.RADIOGROUPGROWCELLS.CAPTION=Growing cells
     19TFORMNEW.LABEL5.CAPTION=Grid type:
  • trunk/Forms/UFormNew.pas

    r38 r39  
    2121    CheckBoxVoid: TCheckBox;
    2222    CheckBoxCity: TCheckBox;
     23    ComboBoxGridType: TComboBox;
    2324    Label1: TLabel;
    2425    Label2: TLabel;
    2526    Label3: TLabel;
    2627    Label4: TLabel;
     28    Label5: TLabel;
    2729    ListView1: TListView;
    2830    RadioGroupGrowCells: TRadioGroup;
     
    194196  RadioGroupGrowAmount.ItemIndex := Integer(Game.GrowAmount);
    195197  RadioGroupGrowCells.ItemIndex := Integer(Game.GrowCells);
     198  ComboBoxGridType.ItemIndex := Integer(Game.MapType) - 1;
    196199end;
    197200
     
    215218  Game.GrowAmount := TGrowAmount(RadioGroupGrowAmount.ItemIndex);
    216219  Game.GrowCells := TGrowCells(RadioGroupGrowCells.ItemIndex);
     220  Game.MapType := TMapType(ComboBoxGridType.ItemIndex + 1);
    217221end;
    218222
Note: See TracChangeset for help on using the changeset viewer.