Changeset 89 for trunk/Forms/FormNew.pas


Ignore:
Timestamp:
Jun 7, 2024, 4:35:46 PM (5 months ago)
Author:
chronos
Message:
  • Added: Allow to select color palette in new game dialog.
  • Fixed: Use scrollboxes in options dialogs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormNew.pas

    r86 r89  
    1616    CheckBoxRecordHistory: TCheckBox;
    1717    CheckBoxUndoEnabled: TCheckBox;
     18    ComboBoxColorPalette: TComboBox;
    1819    ComboBoxSize: TComboBox;
    1920    ComboBoxSkin: TComboBox;
    2021    Label1: TLabel;
    2122    Label2: TLabel;
     23    Label3: TLabel;
     24    ScrollBox1: TScrollBox;
    2225    procedure FormCreate(Sender: TObject);
    2326  public
     
    3134{$R *.lfm}
    3235
    33 uses
    34   Core;
    35 
    3636{ TFormNew }
    3737
    3838procedure TFormNew.FormCreate(Sender: TObject);
    3939var
    40   I: TTileSkin;
     40  TileSkin: TTileSkin;
     41  ColorPalette: TColorPalette;
    4142begin
    4243  ComboBoxSkin.Items.BeginUpdate;
    4344  try
    4445    ComboBoxSkin.Items.Clear;
    45     for I := Low(SkinText) to High(SkinText) do
    46       ComboBoxSkin.Items.Add(SkinText[I]);
     46    for TileSkin := Low(SkinText) to High(SkinText) do
     47      ComboBoxSkin.Items.Add(SkinText[TileSkin]);
    4748  finally
    4849    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;
    4959  end;
    5060end;
     
    5666  CheckBoxRecordHistory.Checked := Game.RecordHistory;
    5767  ComboBoxSkin.ItemIndex := Integer(Game.Skin);
     68  ComboBoxColorPalette.ItemIndex := Integer(Game.ColorPalette);
    5869end;
    5970
     
    6475  Game.RecordHistory := CheckBoxRecordHistory.Checked;
    6576  Game.Skin := TTileSkin(ComboBoxSkin.ItemIndex);
     77  Game.ColorPalette := TColorPalette(ComboBoxColorPalette.ItemIndex);
    6678end;
    6779
Note: See TracChangeset for help on using the changeset viewer.