Changeset 103 for trunk


Ignore:
Timestamp:
Dec 9, 2024, 3:04:44 PM (5 weeks 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.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormMain.lfm

    r101 r103  
    11object FormMain: TFormMain
    22  Left = 534
    3   Height = 959
     3  Height = 1027
    44  Top = 223
    55  Width = 1491
     
    4242        OnClick = MenuItemFullScreenClick
    4343      end
     44      object MenuItemColorPalette: TMenuItem
     45        Caption = 'Color palette'
     46      end
     47      object MenuItemTileSkin: TMenuItem
     48        Caption = 'Tile skin'
     49      end
    4450    end
    4551    object MenuItemTools: TMenuItem
  • trunk/Forms/FormMain.lrj

    r86 r103  
    44{"hash":380871,"name":"tformmain.menuitem5.caption","sourcebytes":[86,105,101,119],"value":"View"},
    55{"hash":131549534,"name":"tformmain.menuitemfullscreen.caption","sourcebytes":[70,117,108,108,32,115,99,114,101,101,110],"value":"Full screen"},
     6{"hash":203534229,"name":"tformmain.menuitemcolorpalette.caption","sourcebytes":[67,111,108,111,114,32,112,97,108,101,116,116,101],"value":"Color palette"},
     7{"hash":41409278,"name":"tformmain.menuitemtileskin.caption","sourcebytes":[84,105,108,101,32,115,107,105,110],"value":"Tile skin"},
    68{"hash":5989939,"name":"tformmain.menuitemtools.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"},
    79{"hash":322608,"name":"tformmain.menuitemhelp.caption","sourcebytes":[72,101,108,112],"value":"Help"}
  • trunk/Forms/FormMain.pas

    r102 r103  
    2828    MenuItem5: TMenuItem;
    2929    MenuItem6: TMenuItem;
     30    MenuItemColorPalette: TMenuItem;
     31    MenuItemTileSkin: TMenuItem;
    3032    MenuItemFullScreen: TMenuItem;
    3133    MenuItemMovesHistory: TMenuItem;
     
    5860    MoveBuffer: array of TMoveDirection;
    5961    MoveBufferLock: TCriticalSection;
     62    procedure MenuItemTileSkinClick(Sender: TObject);
     63    procedure MenuItemColorPaletteClick(Sender: TObject);
    6064    procedure AddToMoveBuffer(Direction: TMoveDirection);
    6165    procedure ProcessMoveBuffer;
     
    179183
    180184procedure TFormMain.FormCreate(Sender: TObject);
     185var
     186  TileSkin: TTileSkin;
     187  ColorPalette: TColorPalette;
     188  MenuItem: TMenuItem;
    181189begin
    182190  MoveBufferLock := TCriticalSection.Create;
     
    186194  MoveThread.Start;
    187195  ControlStyle := ControlStyle + [csOpaque];
     196
     197  for TileSkin := Low(SkinText) to High(SkinText) do begin
     198    MenuItem := TMenuItem.Create(MenuItemTileSkin);
     199    MenuItem.RadioItem := True;
     200    MenuItem.AutoCheck := True;
     201    MenuItem.Tag := Integer(TileSkin);
     202    MenuItem.Caption := SkinText[TileSkin];
     203    MenuItem.OnClick := MenuItemTileSkinClick;
     204    MenuItemTileSkin.Add(MenuItem);
     205  end;
     206
     207  for ColorPalette := Low(ColorPaletteText) to High(ColorPaletteText) do begin
     208    MenuItem := TMenuItem.Create(MenuItemColorPalette);
     209    MenuItem.RadioItem := True;
     210    MenuItem.AutoCheck := True;
     211    MenuItem.Tag := Integer(ColorPalette);
     212    MenuItem.Caption := ColorPaletteText[ColorPalette];
     213    MenuItem.OnClick := MenuItemColorPaletteClick;
     214    MenuItemColorPalette.Add(MenuItem);
     215  end;
    188216end;
    189217
     
    221249begin
    222250  // Do nothing
     251end;
     252
     253procedure TFormMain.MenuItemTileSkinClick(Sender: TObject);
     254begin
     255  Core.Core.Game.Skin := TTileSkin(TMenuItem(Sender).Tag);
     256end;
     257
     258procedure TFormMain.MenuItemColorPaletteClick(Sender: TObject);
     259begin
     260  Core.Core.Game.ColorPalette := TColorPalette(TMenuItem(Sender).Tag);
    223261end;
    224262
     
    277315    end;
    278316  MenuItemTools.Visible := ToolsVisible;
     317  MenuItemTileSkin.Items[Integer(Core.Core.Game.Skin)].Checked := True;
     318  MenuItemColorPalette.Items[Integer(Core.Core.Game.ColorPalette)].Checked := True;
    279319end;
    280320
  • trunk/Forms/FormNew.lfm

    r89 r103  
    88  ClientWidth = 514
    99  DesignTimePPI = 144
    10   OnCreate = FormCreate
    11   LCLVersion = '3.4.0.0'
     10  LCLVersion = '3.6.0.0'
    1211  object ButtonCancel: TButton
    1312    Left = 255
     
    3635    Width = 497
    3736    HorzScrollBar.Page = 435
    38     VertScrollBar.Page = 214
     37    VertScrollBar.Page = 118
    3938    Anchors = [akTop, akLeft, akRight, akBottom]
    4039    ClientHeight = 245
     
    8786      TabOrder = 2
    8887    end
    89     object Label2: TLabel
    90       Left = 16
    91       Height = 26
    92       Top = 133
    93       Width = 75
    94       Caption = 'Tile skin:'
    95       ParentColor = False
    96     end
    97     object ComboBoxSkin: TComboBox
    98       Left = 173
    99       Height = 38
    100       Top = 128
    101       Width = 262
    102       ItemHeight = 0
    103       Items.Strings = (
    104         ''
    105       )
    106       Style = csDropDownList
    107       TabOrder = 3
    108     end
    109     object Label3: TLabel
    110       Left = 16
    111       Height = 26
    112       Top = 181
    113       Width = 113
    114       Caption = 'Color palette:'
    115       ParentColor = False
    116     end
    117     object ComboBoxColorPalette: TComboBox
    118       Left = 173
    119       Height = 38
    120       Top = 176
    121       Width = 262
    122       ItemHeight = 0
    123       Items.Strings = (
    124         'RGB'
    125         'RBG'
    126         'GRB'
    127         'GBR'
    128         'BGR'
    129         'BRG'
    130       )
    131       Style = csDropDownList
    132       TabOrder = 4
    133     end
    13488  end
    13589end
  • trunk/Forms/FormNew.lrj

    r89 r103  
    55{"hash":103901194,"name":"tformnew.label1.caption","sourcebytes":[66,111,97,114,100,32,115,105,122,101,58],"value":"Board size:"},
    66{"hash":260260820,"name":"tformnew.checkboxundoenabled.caption","sourcebytes":[85,110,100,111,32,101,110,97,98,108,101,100],"value":"Undo enabled"},
    7 {"hash":146862089,"name":"tformnew.checkboxrecordhistory.caption","sourcebytes":[82,101,99,111,114,100,32,109,111,118,101,115,32,104,105,115,116,111,114,121],"value":"Record moves history"},
    8 {"hash":125677626,"name":"tformnew.label2.caption","sourcebytes":[84,105,108,101,32,115,107,105,110,58],"value":"Tile skin:"},
    9 {"hash":35322186,"name":"tformnew.label3.caption","sourcebytes":[67,111,108,111,114,32,112,97,108,101,116,116,101,58],"value":"Color palette:"}
     7{"hash":146862089,"name":"tformnew.checkboxrecordhistory.caption","sourcebytes":[82,101,99,111,114,100,32,109,111,118,101,115,32,104,105,115,116,111,114,121],"value":"Record moves history"}
    108]}
  • 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
  • trunk/Install/flatpak/net.zdechov.app.x2048.yml

    r98 r103  
    11app-id: net.zdechov.app.x2048
    22runtime: org.kde.Platform
    3 runtime-version: '5.15-23.08'
     3runtime-version: '5.15-24.08'
    44sdk: org.kde.Sdk
    55sdk-extensions:
     
    1010  - --socket=fallback-x11
    1111  - --socket=wayland
    12   - --socket=pulseaudio
    1312  - --device=dri
    1413modules:
     
    3837      - install -Dm644 "Images/Logo 256x256.png" $FLATPAK_DEST/share/icons/hicolor/256x256/apps/${FLATPAK_ID}.png
    3938      - install -Dm644 Languages/*.po -t $FLATPAK_DEST/share/Game2048/Languages
     39      - install -Dm644 Packages/Common/Languages/*.po -t $FLATPAK_DEST/share/Game2048/Languages
    4040      - install -Dm644 Install/flatpak/${FLATPAK_ID}.appdata.xml $FLATPAK_DEST/share/metainfo/${FLATPAK_ID}.metainfo.xml
  • trunk/Languages/Game2048.cs.po

    r102 r103  
    228228msgstr "Zobrazení"
    229229
     230#: tformmain.menuitemcolorpalette.caption
     231msgid "Color palette"
     232msgstr "Paleta barev"
     233
    230234#: tformmain.menuitemfullscreen.caption
    231235msgid "Full screen"
     
    241245msgstr "Nápověda"
    242246
     247#: tformmain.menuitemtileskin.caption
     248msgid "Tile skin"
     249msgstr "Povrch dlaždic"
     250
    243251#: tformmain.menuitemtools.caption
    244252msgid "Tools"
     
    272280msgstr "Velikost desky:"
    273281
    274 #: tformnew.label2.caption
    275 msgid "Tile skin:"
    276 msgstr "Povrch dlaždic:"
    277 
    278 #: tformnew.label3.caption
    279 msgid "Color palette:"
    280 msgstr "Barevná paleta:"
    281 
    282282#: tformsettings.buttoncancel.caption
    283283msgctxt "tformsettings.buttoncancel.caption"
Note: See TracChangeset for help on using the changeset viewer.