Fix possibility to edit tileset base index (fix #4163)

Regression from 242555ab06
This commit is contained in:
David Capello 2023-11-22 16:11:49 -03:00
parent 0cc8769e29
commit aeb7157277
2 changed files with 10 additions and 5 deletions

View File

@ -111,10 +111,10 @@ void TilesetSelector::updateControlsState()
ts->matchFlags());
}
name()->setEnabled(isNewTileset || !m_info.allowNewTileset);
name()->setEnabled(true);
gridWidth()->setEnabled(isNewTileset);
gridHeight()->setEnabled(isNewTileset);
baseIndex()->setEnabled(isNewTileset);
baseIndex()->setEnabled(true);
}
else {
tilesets()->setEnabled(false);

View File

@ -26,11 +26,16 @@ namespace app {
class TilesetSelector : public app::gen::TilesetSelector {
public:
struct Info {
// Enables/disables the tileset selector combobox
// Enables/disables the tileset selector combobox and fields to
// edit the tileset data.
bool enabled = true;
// When false, removes the "New Tileset" option from the tileset selector combobox
// When false, removes the "New Tileset" option from the tileset
// selector combobox.
bool allowNewTileset = true;
// When false, we only can select a "New Tileset" option or change the tileset properties
// When false, we only can select a "New Tileset" option or
// change the tileset properties.
bool allowExistentTileset = true;
// Output members that are set when TilesetSelector.getInfo()