Ignore:
Timestamp:
Dec 9, 2024, 3:04:44 PM (13 days ago)
Author:
chronos
Message:
  • Modified: Tile skin and color palette setting moved from new game dialog to menu. It can be now set during gameplay.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormNew.pas

    r89 r103  
    1616    CheckBoxRecordHistory: TCheckBox;
    1717    CheckBoxUndoEnabled: TCheckBox;
    18     ComboBoxColorPalette: TComboBox;
    1918    ComboBoxSize: TComboBox;
    20     ComboBoxSkin: TComboBox;
    2119    Label1: TLabel;
    22     Label2: TLabel;
    23     Label3: TLabel;
    2420    ScrollBox1: TScrollBox;
    25     procedure FormCreate(Sender: TObject);
    2621  public
    2722    procedure Load(Game: TGame);
     
    3530
    3631{ TFormNew }
    37 
    38 procedure TFormNew.FormCreate(Sender: TObject);
    39 var
    40   TileSkin: TTileSkin;
    41   ColorPalette: TColorPalette;
    42 begin
    43   ComboBoxSkin.Items.BeginUpdate;
    44   try
    45     ComboBoxSkin.Items.Clear;
    46     for TileSkin := Low(SkinText) to High(SkinText) do
    47       ComboBoxSkin.Items.Add(SkinText[TileSkin]);
    48   finally
    49     ComboBoxSkin.Items.EndUpdate;
    50   end;
    51 
    52   ComboBoxColorPalette.Items.BeginUpdate;
    53   try
    54     ComboBoxColorPalette.Items.Clear;
    55     for ColorPalette := Low(ColorPaletteText) to High(ColorPaletteText) do
    56       ComboBoxColorPalette.Items.Add(ColorPaletteText[ColorPalette]);
    57   finally
    58     ComboBoxColorPalette.Items.EndUpdate;
    59   end;
    60 end;
    61 
    6232procedure TFormNew.Load(Game: TGame);
    6333begin
     
    6535  CheckBoxUndoEnabled.Checked := Game.UndoEnabled;
    6636  CheckBoxRecordHistory.Checked := Game.RecordHistory;
    67   ComboBoxSkin.ItemIndex := Integer(Game.Skin);
    68   ComboBoxColorPalette.ItemIndex := Integer(Game.ColorPalette);
    6937end;
    7038
     
    7442  Game.UndoEnabled := CheckBoxUndoEnabled.Checked;
    7543  Game.RecordHistory := CheckBoxRecordHistory.Checked;
    76   Game.Skin := TTileSkin(ComboBoxSkin.ItemIndex);
    77   Game.ColorPalette := TColorPalette(ComboBoxColorPalette.ItemIndex);
    7844end;
    7945
Note: See TracChangeset for help on using the changeset viewer.