Ignore:
Timestamp:
Dec 9, 2024, 4:40:34 PM (13 days ago)
Author:
chronos
Message:
  • Added: Set number of randomly generated disabled tiles in new game form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormNew.pas

    r103 r105  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   Game, FormEx;
     7  Spin, Game, FormEx, Math;
    88
    99type
     
    1818    ComboBoxSize: TComboBox;
    1919    Label1: TLabel;
     20    Label2: TLabel;
    2021    ScrollBox1: TScrollBox;
     22    SpinEditDisabledTiles: TSpinEdit;
     23    procedure ComboBoxSizeChange(Sender: TObject);
    2124  public
     25    procedure UpdateInterface;
    2226    procedure Load(Game: TGame);
    2327    procedure Save(Game: TGame);
     
    3034
    3135{ TFormNew }
     36
     37procedure TFormNew.ComboBoxSizeChange(Sender: TObject);
     38begin
     39  UpdateInterface;
     40end;
     41
     42procedure TFormNew.UpdateInterface;
     43begin
     44  SpinEditDisabledTiles.MaxValue := ComboBoxSize.ItemIndex + 2;
     45end;
     46
    3247procedure TFormNew.Load(Game: TGame);
    3348begin
     
    3550  CheckBoxUndoEnabled.Checked := Game.UndoEnabled;
    3651  CheckBoxRecordHistory.Checked := Game.RecordHistory;
     52  SpinEditDisabledTiles.Value := Game.DisabledTilesCount;
     53  UpdateInterface;
    3754end;
    3855
     
    4259  Game.UndoEnabled := CheckBoxUndoEnabled.Checked;
    4360  Game.RecordHistory := CheckBoxRecordHistory.Checked;
     61  Game.DisabledTilesCount := SpinEditDisabledTiles.Value;
    4462end;
    4563
Note: See TracChangeset for help on using the changeset viewer.