Changeset 262


Ignore:
Timestamp:
Sep 24, 2018, 11:46:31 PM (6 years ago)
Author:
chronos
Message:
  • Added: New game option to set cells without player units as neutral.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNew.lfm

    r250 r262  
    550550        object ComboBoxWinObjective: TComboBox
    551551          Left = 224
    552           Height = 40
     552          Height = 36
    553553          Top = 244
    554554          Width = 328
     
    653653          end
    654654        end
     655        object CheckBoxEmptyCellsNeutral: TCheckBox
     656          Left = 336
     657          Height = 30
     658          Top = 62
     659          Width = 360
     660          Caption = 'Set cells without player units as neutral'
     661          TabOrder = 5
     662        end
    655663      end
    656664    end
  • trunk/Forms/UFormNew.pas

    r247 r262  
    3131    ButtonPlayerModify: TButton;
    3232    ButtonPlayerRemove: TButton;
     33    CheckBoxEmptyCellsNeutral: TCheckBox;
    3334    CheckBoxBridges: TCheckBox;
    3435    CheckBoxCity: TCheckBox;
     
    538539    SpinEditTurns.Value := StayAliveForDefinedTurns;
    539540    SpinEditSpecialCells.Value := SpecialCaptureCellCount;
     541    CheckBoxEmptyCellsNeutral.Checked := EmptyCellsNeutral;
    540542  end;
    541543end;
     
    580582    StayAliveForDefinedTurns := SpinEditTurns.Value;
    581583    SpecialCaptureCellCount := SpinEditSpecialCells.Value;
     584    EmptyCellsNeutral := CheckBoxEmptyCellsNeutral.Checked;
    582585  end;
    583586end;
  • trunk/Forms/UFormSettings.lfm

    r243 r262  
    11object FormSettings: TFormSettings
    22  Left = 535
    3   Height = 328
    4   Top = 417
    5   Width = 605
     3  Height = 359
     4  Top = 386
     5  Width = 576
    66  ActiveControl = ButtonOk
    77  Caption = 'Settings'
    8   ClientHeight = 328
    9   ClientWidth = 605
     8  ClientHeight = 359
     9  ClientWidth = 576
    1010  Constraints.MinHeight = 300
    1111  Constraints.MinWidth = 454
    12   DesignTimePPI = 120
     12  DesignTimePPI = 144
    1313  OnClose = FormClose
    1414  OnCreate = FormCreate
     
    1717  LCLVersion = '1.8.2.0'
    1818  object ButtonOk: TButton
    19     Left = 522
     19    Left = 493
    2020    Height = 25
    21     Top = 289
     21    Top = 320
    2222    Width = 75
    2323    Anchors = [akRight, akBottom]
     
    2727  end
    2828  object ButtonCancel: TButton
    29     Left = 427
     29    Left = 398
    3030    Height = 25
    31     Top = 289
     31    Top = 320
    3232    Width = 75
    3333    Anchors = [akRight, akBottom]
     
    3838  object PageControl1: TPageControl
    3939    Left = 8
    40     Height = 273
     40    Height = 304
    4141    Top = 8
    42     Width = 589
    43     ActivePage = TabSheetDebug
     42    Width = 560
     43    ActivePage = TabSheetGeneral
    4444    Align = alTop
    4545    Anchors = [akTop, akLeft, akRight, akBottom]
    4646    BorderSpacing.Around = 8
    47     TabIndex = 1
     47    TabIndex = 0
    4848    TabOrder = 2
    4949    object TabSheetGeneral: TTabSheet
    5050      Caption = 'General'
    51       ClientHeight = 240
    52       ClientWidth = 581
     51      ClientHeight = 260
     52      ClientWidth = 554
    5353      object Panel1: TPanel
    5454        Left = 0
    55         Height = 240
     55        Height = 260
    5656        Top = 0
    57         Width = 581
     57        Width = 554
    5858        Align = alClient
    5959        BevelOuter = bvNone
    60         ClientHeight = 240
    61         ClientWidth = 581
     60        ClientHeight = 260
     61        ClientWidth = 554
    6262        TabOrder = 0
    6363        object Label1: TLabel
    6464          Left = 20
    65           Height = 20
    66           Top = 26
    67           Width = 68
     65          Height = 26
     66          Top = 32
     67          Width = 88
    6868          Caption = 'Language:'
    6969          ParentColor = False
     
    7171        object ComboBoxLanguage: TComboBox
    7272          Left = 178
    73           Height = 28
     73          Height = 40
    7474          Top = 24
    7575          Width = 196
    76           ItemHeight = 20
     76          ItemHeight = 0
    7777          Style = csDropDownList
    7878          TabOrder = 0
    7979        end
    8080        object ComboBoxTheme: TComboBox
    81           Left = 178
    82           Height = 28
    83           Top = 56
     81          Left = 176
     82          Height = 40
     83          Top = 72
    8484          Width = 196
    85           ItemHeight = 20
     85          ItemHeight = 0
    8686          Style = csDropDownList
    8787          TabOrder = 1
     
    8989        object Label6: TLabel
    9090          Left = 20
    91           Height = 20
    92           Top = 58
    93           Width = 48
     91          Height = 26
     92          Top = 80
     93          Width = 63
    9494          Caption = 'Theme:'
    9595          ParentColor = False
     
    9797        object SpinEditAnimSpeed: TSpinEdit
    9898          Left = 232
    99           Height = 28
    100           Top = 110
     99          Height = 36
     100          Top = 120
    101101          Width = 122
    102102          TabOrder = 2
     
    104104        object Label3: TLabel
    105105          Left = 368
    106           Height = 20
    107           Top = 114
    108           Width = 12
     106          Height = 26
     107          Top = 124
     108          Width = 15
    109109          Caption = '%'
    110110          ParentColor = False
     
    112112        object Label2: TLabel
    113113          Left = 20
    114           Height = 20
    115           Top = 110
    116           Width = 116
     114          Height = 26
     115          Top = 120
     116          Width = 150
    117117          Caption = 'Animation speed:'
    118118          ParentColor = False
     
    120120        object CheckBoxAutoSaveTurn: TCheckBox
    121121          Left = 20
    122           Height = 24
    123           Top = 144
    124           Width = 213
     122          Height = 30
     123          Top = 154
     124          Width = 269
    125125          Caption = 'Autosave game on each turn'
    126126          TabOrder = 3
     
    128128        object CheckBoxReopenLastFile: TCheckBox
    129129          Left = 20
    130           Height = 24
    131           Top = 184
    132           Width = 198
     130          Height = 30
     131          Top = 194
     132          Width = 249
    133133          Caption = 'Reopen last game on start'
    134134          TabOrder = 4
     
    138138    object TabSheetDebug: TTabSheet
    139139      Caption = 'Debug'
    140       ClientHeight = 240
    141       ClientWidth = 581
     140      ClientHeight = 260
     141      ClientWidth = 554
    142142      object Panel2: TPanel
    143143        Left = 0
    144         Height = 240
     144        Height = 229
    145145        Top = 0
    146         Width = 581
     146        Width = 583
    147147        Align = alClient
    148148        BevelOuter = bvNone
    149         ClientHeight = 240
    150         ClientWidth = 581
     149        ClientHeight = 229
     150        ClientWidth = 583
    151151        TabOrder = 0
    152152        object CheckBox2: TCheckBox
     
    154154          Height = 24
    155155          Top = 32
    156           Width = 549
     156          Width = 551
    157157          Anchors = [akTop, akLeft, akRight]
    158158          AutoSize = False
     
    163163        object Label4: TLabel
    164164          Left = 14
    165           Height = 20
     165          Height = 26
    166166          Top = 67
    167           Width = 26
     167          Width = 35
    168168          Caption = 'DPI:'
    169169          ParentColor = False
     
    171171        object SpinEditX: TSpinEdit
    172172          Left = 104
    173           Height = 28
     173          Height = 36
    174174          Top = 64
    175175          Width = 96
     
    181181        object Label5: TLabel
    182182          Left = 208
    183           Height = 20
     183          Height = 26
    184184          Top = 67
    185           Width = 7
     185          Width = 10
    186186          Caption = 'x'
    187187          ParentColor = False
     
    189189        object SpinEditY: TSpinEdit
    190190          Left = 232
    191           Height = 28
     191          Height = 36
    192192          Top = 64
    193193          Width = 90
     
    201201          Height = 27
    202202          Top = 136
    203           Width = 553
     203          Width = 555
    204204          Anchors = [akTop, akLeft, akRight]
    205205          AutoSize = False
  • trunk/Languages/xtactics.cs.po

    r258 r262  
    354354
    355355#: tformnew.aplayermodify.caption
     356#, fuzzy
     357#| msgid "Modify player"
    356358msgctxt "tformnew.aplayermodify.caption"
    357 msgid "Modify player"
     359msgid "Modify"
    358360msgstr "Upravit"
    359361
     
    379381msgstr "Odstranit"
    380382
    381 #: tformnew.button1.caption
    382 msgctxt "tformnew.button1.caption"
    383 msgid "Add"
    384 msgstr "Přidat"
    385 
    386 #: tformnew.button2.caption
    387 msgctxt "tformnew.button2.caption"
    388 msgid "Remove"
    389 msgstr "Odstranit"
    390 
    391 #: tformnew.button3.caption
    392 msgctxt "tformnew.button3.caption"
    393 msgid "Modify"
    394 msgstr "Upravit"
    395 
    396383#: tformnew.buttoncancel.caption
    397384msgctxt "tformnew.buttoncancel.caption"
     
    409396msgstr "Ok"
    410397
    411 #: tformnew.buttonplayeradd.caption
    412 msgctxt "tformnew.buttonplayeradd.caption"
    413 msgid "Add"
    414 msgstr "Přidat"
    415 
    416 #: tformnew.buttonplayermodify.caption
    417 msgctxt "tformnew.buttonplayermodify.caption"
    418 msgid "Modify"
    419 msgstr "Upravit"
    420 
    421 #: tformnew.buttonplayerremove.caption
    422 msgctxt "tformnew.buttonplayerremove.caption"
    423 msgid "Remove"
    424 msgstr "Odstranit"
    425 
    426398#: tformnew.caption
    427399msgctxt "tformnew.caption"
     
    441413msgid "Cyclic map"
    442414msgstr "Cyklická mapa"
     415
     416#: tformnew.checkboxemptycellsneutral.caption
     417msgid "Set cells without player units as neutral"
     418msgstr "Nastavit buňky bez jednotek hráče jako neutrální"
    443419
    444420#: tformnew.checkboxfogofwar.caption
  • trunk/Languages/xtactics.po

    r258 r262  
    343343#: tformnew.aplayermodify.caption
    344344msgctxt "tformnew.aplayermodify.caption"
    345 msgid "Modify player"
     345msgid "Modify"
    346346msgstr ""
    347347
     
    366366msgstr ""
    367367
    368 #: tformnew.button1.caption
    369 msgctxt "tformnew.button1.caption"
    370 msgid "Add"
    371 msgstr ""
    372 
    373 #: tformnew.button2.caption
    374 msgctxt "tformnew.button2.caption"
    375 msgid "Remove"
    376 msgstr ""
    377 
    378 #: tformnew.button3.caption
    379 msgctxt "tformnew.button3.caption"
    380 msgid "Modify"
    381 msgstr ""
    382 
    383368#: tformnew.buttoncancel.caption
    384369msgctxt "TFORMNEW.BUTTONCANCEL.CAPTION"
     
    396381msgstr ""
    397382
    398 #: tformnew.buttonplayeradd.caption
    399 msgctxt "tformnew.buttonplayeradd.caption"
    400 msgid "Add"
    401 msgstr ""
    402 
    403 #: tformnew.buttonplayermodify.caption
    404 msgctxt "tformnew.buttonplayermodify.caption"
    405 msgid "Modify"
    406 msgstr ""
    407 
    408 #: tformnew.buttonplayerremove.caption
    409 msgctxt "tformnew.buttonplayerremove.caption"
    410 msgid "Remove"
    411 msgstr ""
    412 
    413383#: tformnew.caption
    414384msgctxt "tformnew.caption"
     
    427397#: tformnew.checkboxcyclicmap.caption
    428398msgid "Cyclic map"
     399msgstr ""
     400
     401#: tformnew.checkboxemptycellsneutral.caption
     402msgid "Set cells without player units as neutral"
    429403msgstr ""
    430404
  • trunk/UGame.pas

    r251 r262  
    7777    BridgeEnabled: Boolean;
    7878    MaxPower: Integer;
     79    EmptyCellsNeutral: Boolean;
    7980    procedure PostConfig;
    8081    procedure Assign(Source: TGame);
     
    427428  BridgeEnabled := Source.BridgeEnabled;
    428429  MaxPower := Source.MaxPower;
     430  EmptyCellsNeutral := Source.EmptyCellsNeutral;
    429431end;
    430432
     
    450452    SetValue(DOMString(Path + '/StayAliveForDefinedTurns'), StayAliveForDefinedTurns);
    451453    SetValue(DOMString(Path + '/SpecialCaptureCellCount'), SpecialCaptureCellCount);
     454    SetValue(DOMString(Path + '/EmptyCellsNeutral'), EmptyCellsNeutral);
    452455    Players.SaveConfig(Config, Path + '/Players');
    453456  end;
     
    485488    StayAliveForDefinedTurns := GetValue(DOMString(Path + '/StayAliveForDefinedTurns'), 20);
    486489    SpecialCaptureCellCount := GetValue(DOMString(Path + '/SpecialCaptureCellCount'), 1);
     490    EmptyCellsNeutral := GetValue(DOMString(Path + '/EmptyCellsNeutral'), False);
    487491    Players.LoadConfig(Config, Path + '/Players');
    488492  end;
     
    519523      TurnCounter := ReadInteger(RootNode, 'TurnCounter', 0);
    520524      WinObjective := TWinObjective(ReadInteger(RootNode, 'WinObjective', Integer(woDefeatAllOponents)));
    521       ReadInteger(RootNode, 'StayAliveForDefinedTurns', StayAliveForDefinedTurns);
     525      StayAliveForDefinedTurns := ReadInteger(RootNode, 'StayAliveForDefinedTurns', 10);
     526      EmptyCellsNeutral := ReadBoolean(RootNode, 'EmptyCellsNeutral', False);
    522527
    523528      NewNode := FindNode('Map');
     
    573578      WriteInteger(RootNode, 'WinObjective', Integer(WinObjective));
    574579      WriteInteger(RootNode, 'StayAliveForDefinedTurns', StayAliveForDefinedTurns);
     580      WriteBoolean(RootNode, 'EmptyCellsNeutral', EmptyCellsNeutral);
    575581      WriteBoolean(RootNode, 'Running', Running);
    576582
     
    641647  CurrentPlayer.MoveAll;
    642648  CurrentPlayer.Grow;
     649  CurrentPlayer.UpdateEmptyCellsNeutral;
    643650  CurrentPlayer.UpdateRepeatMoves;
    644651  ComputePlayerStats;
  • trunk/UPlayer.pas

    r258 r262  
    121121    procedure RemoveInvalidMoves;
    122122    procedure UpdateRepeatMoves;
     123    procedure UpdateEmptyCellsNeutral;
    123124    procedure MoveAll;
    124125    procedure Grow;
     
    10921093end;
    10931094
     1095procedure TPlayer.UpdateEmptyCellsNeutral;
     1096var
     1097  I: Integer;
     1098begin
     1099  if TGame(Game).EmptyCellsNeutral then
     1100  for I := 0 to PlayerMap.Cells.Count - 1 do
     1101  with TPlayerCell(PlayerMap.Cells[I]) do begin
     1102    if MapCell.Power = 0 then MapCell.Player := nil;
     1103  end;
     1104end;
     1105
    10941106procedure TPlayer.RemoveEmptyUnitMoves;
    10951107var
Note: See TracChangeset for help on using the changeset viewer.