Changeset 194


Ignore:
Timestamp:
May 14, 2018, 5:38:45 PM (7 years ago)
Author:
chronos
Message:
  • Added: Configurable game parameter maximum units per cell.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNew.lfm

    r179 r194  
    11object FormNew: TFormNew
    2   Left = 596
    3   Height = 617
    4   Top = 243
    5   Width = 775
     2  Left = 387
     3  Height = 843
     4  Top = 102
     5  Width = 1069
    66  Caption = 'New game'
    7   ClientHeight = 617
    8   ClientWidth = 775
     7  ClientHeight = 843
     8  ClientWidth = 1069
    99  Constraints.MinHeight = 501
    1010  Constraints.MinWidth = 667
     
    1515  OnShow = FormShow
    1616  Position = poMainFormCenter
    17   LCLVersion = '1.8.0.6'
     17  LCLVersion = '1.8.2.0'
    1818  object PageControl1: TPageControl
    1919    Left = 4
    20     Height = 330
     20    Height = 556
    2121    Top = 4
    22     Width = 767
    23     ActivePage = TabSheetMode
     22    Width = 1061
     23    ActivePage = TabSheet2
    2424    Align = alClient
    2525    BorderSpacing.Around = 4
    26     TabIndex = 0
     26    TabIndex = 2
    2727    TabOrder = 0
    2828    object TabSheetMode: TTabSheet
     
    180180    object TabSheet2: TTabSheet
    181181      Caption = 'Map'
    182       ClientHeight = 297
    183       ClientWidth = 759
     182      ClientHeight = 523
     183      ClientWidth = 1053
    184184      object Label1: TLabel
    185185        Left = 8
     
    222222        Height = 47
    223223        Top = 8
    224         Width = 508
     224        Width = 802
    225225        Max = 100
    226226        Min = 2
     
    235235        Height = 47
    236236        Top = 49
    237         Width = 508
     237        Width = 802
    238238        Max = 100
    239239        Min = 2
     
    293293        Height = 27
    294294        Top = 110
    295         Width = 271
     295        Width = 565
    296296        Anchors = [akTop, akLeft, akRight]
    297297        AutoSize = False
     
    354354        Left = 408
    355355        Height = 28
    356         Top = 352
     356        Top = 384
    357357        Width = 98
    358358        MaxValue = 99
    359         OnChange = SpinEditMapSizeYChange
    360359        TabOrder = 11
    361360        Value = 12
     
    364363        Left = 8
    365364        Height = 20
    366         Top = 352
     365        Top = 384
    367366        Width = 172
    368367        Caption = 'Max random neutral units:'
     
    373372        Height = 28
    374373        Top = 184
    375         Width = 492
     374        Width = 786
    376375        Anchors = [akTop, akLeft, akRight]
    377376        TabOrder = 12
    378377      end
    379378      object ButtonImageBrowse: TButton
    380         Left = 644
     379        Left = 938
    381380        Height = 25
    382381        Top = 192
     
    402401        Caption = 'Bridges between cells'
    403402        TabOrder = 14
     403      end
     404      object SpinEditMaxPower: TSpinEdit
     405        Left = 408
     406        Height = 28
     407        Top = 344
     408        Width = 98
     409        MaxValue = 1000000
     410        MinValue = 1
     411        OnChange = SpinEditMaxPowerChange
     412        TabOrder = 15
     413        Value = 99
     414      end
     415      object Label10: TLabel
     416        Left = 8
     417        Height = 20
     418        Top = 344
     419        Width = 119
     420        Caption = 'Max units per cell:'
     421        ParentColor = False
    404422      end
    405423    end
     
    491509    Left = 0
    492510    Height = 45
    493     Top = 572
    494     Width = 775
     511    Top = 798
     512    Width = 1069
    495513    Align = alBottom
    496514    BevelOuter = bvNone
    497515    ClientHeight = 45
    498     ClientWidth = 775
     516    ClientWidth = 1069
    499517    TabOrder = 1
    500518    object ButtonOk: TButton
    501       Left = 587
     519      Left = 881
    502520      Height = 25
    503521      Top = 6
     
    509527    end
    510528    object ButtonCancel: TButton
    511       Left = 691
     529      Left = 985
    512530      Height = 25
    513531      Top = 6
     
    522540    Left = 0
    523541    Height = 228
    524     Top = 344
    525     Width = 775
     542    Top = 570
     543    Width = 1069
    526544    Align = alBottom
    527545    BevelOuter = bvNone
     
    532550    Left = 0
    533551    Height = 6
    534     Top = 338
    535     Width = 775
     552    Top = 564
     553    Width = 1069
    536554    Align = alBottom
    537555    ResizeAnchor = akBottom
  • trunk/Forms/UFormNew.pas

    r193 r194  
    3636    EditImageFile: TEdit;
    3737    Label1: TLabel;
     38    Label10: TLabel;
    3839    Label11: TLabel;
    3940    Label12: TLabel;
     
    6162    RadioGroupGrowAmount: TRadioGroup;
    6263    RadioGroupGrowCells: TRadioGroup;
     64    SpinEditMaxPower: TSpinEdit;
    6365    SpinEditServerPort: TSpinEdit;
    6466    SpinEditCityPercent: TSpinEdit;
     
    98100    procedure SpinEditMapSizeXChange(Sender: TObject);
    99101    procedure SpinEditMapSizeYChange(Sender: TObject);
     102    procedure SpinEditMaxPowerChange(Sender: TObject);
    100103    procedure TrackBarSizeYChange(Sender: TObject);
    101104    procedure TrackBarSizeXChange(Sender: TObject);
     
    191194end;
    192195
     196procedure TFormNew.SpinEditMaxPowerChange(Sender: TObject);
     197begin
     198  UpdateInterface;
     199end;
     200
    193201procedure TFormNew.TrackBarSizeYChange(Sender: TObject);
    194202begin
     
    268276  SpinEditServerPort.Enabled := RadioButtonModeNetworkServer.Checked;
    269277  ListViewServers.Enabled := RadioButtonModeNetworkClient.Checked;
     278  PanelChat.Visible := RadioButtonModeNetworkClient.Checked or RadioButtonModeNetworkServer.Checked;
     279  SpinEditNeutralUnits.MaxValue := SpinEditMaxPower.Value;
    270280end;
    271281
     
    402412    EditServerAddress.Text := LocalNetworkAddress;
    403413    SpinEditServerPort.Value := LocalNetworkPort;
     414    SpinEditMaxPower.Value := Game.MaxPower;
    404415  end;
    405416end;
     
    429440    Game.FogOfWar := CheckBoxFogOfWar.Checked;
    430441    Game.BridgeEnabled := CheckBoxBridges.Checked;
     442    Game.MaxPower := SpinEditMaxPower.Value;
    431443  end;
    432444end;
  • trunk/Languages/xtactics.cs.po

    r193 r194  
    366366msgid "Map width:"
    367367msgstr "Šířka mapy:"
     368
     369#: tformnew.label10.caption
     370msgid "Max units per cell:"
     371msgstr "Nejvíce jednotek na buňku:"
    368372
    369373#: tformnew.label11.caption
  • trunk/Languages/xtactics.po

    r193 r194  
    351351#: tformnew.label1.caption
    352352msgid "Map width:"
     353msgstr ""
     354
     355#: tformnew.label10.caption
     356msgid "Max units per cell:"
    353357msgstr ""
    354358
  • trunk/UCore.lfm

    r193 r194  
    44  OldCreateOrder = False
    55  Height = 676
    6   HorizontalOffset = 365
    7   VerticalOffset = 284
     6  HorizontalOffset = 275
     7  VerticalOffset = 190
    88  Width = 1048
    99  PPI = 120
  • trunk/UGame.pas

    r193 r194  
    1717  TriangleCellMulY = 1.05;
    1818  MaxPlayerCount = 8;
     19  DefaultMaxPower = 99;
    1920
    2021type
     
    460461    FogOfWar: Boolean;
    461462    BridgeEnabled: Boolean;
     463    MaxPower: Integer;
    462464    function AttackProbability(AttackCount, DefendCount: Integer): Double;
    463465    procedure LoadConfig(Config: TXmlConfig; Path: string);
     
    14061408  DefaultCellSize.X := ReadInteger(Node, 'DefaultCellSizeX', 1);
    14071409  DefaultCellSize.Y := ReadInteger(Node, 'DefaultCellSizeY', 1);
    1408   MaxPower := ReadInteger(Node, 'MaxPower', 99);
     1410  MaxPower := ReadInteger(Node, 'MaxPower', DefaultMaxPower);
    14091411  Shape := TMapShape(ReadInteger(Node, 'Shape', Integer(msRectangle)));
    14101412  Node2 := Node.FindNode('Cells');
     
    16561658constructor TMap.Create;
    16571659begin
    1658   MaxPower := 99;
     1660  MaxPower := DefaultMaxPower;
    16591661  DefaultCellSize := TPoint.Create(220, 220);
    16601662  Cells := TCells.Create;
     
    32603262      VoidPercentage := ReadInteger(RootNode, 'VoidPercentage', 0);
    32613263      MaxNeutralUnits := ReadInteger(RootNode, 'MaxNeutralUnits', 3);
     3264      MaxPower := ReadInteger(RootNode, 'MaxPower', DefaultMaxPower);
    32623265      GrowCells := TGrowCells(ReadInteger(RootNode, 'GrowCells', Integer(gcNone)));
    32633266      GrowAmount := TGrowAmount(ReadInteger(RootNode, 'GrowAmount', Integer(gaByOne)));
     
    33093312      WriteInteger(RootNode, 'VoidPercentage', VoidPercentage);
    33103313      WriteInteger(RootNode, 'MaxNeutralUnits', MaxNeutralUnits);
     3314      WriteInteger(RootNode, 'MaxPower', MaxPower);
    33113315      WriteInteger(RootNode, 'GrowCells', Integer(GrowCells));
    33123316      WriteInteger(RootNode, 'GrowAmount', Integer(GrowAmount));
     
    34473451  VoidEnabled := True;
    34483452  VoidPercentage := 20;
    3449   MaxNeutralUnits := 4;
     3453  MaxPower := DefaultMaxPower;
     3454  MaxNeutralUnits := Min(4, MaxPower);
    34503455
    34513456  Map.Game := Self;
     
    34773482
    34783483  Map.Generate;
     3484  Map.MaxPower := MaxPower;
    34793485  BuildTerrain;
    34803486
Note: See TracChangeset for help on using the changeset viewer.