Skip to content

Commit

Permalink
Fixed the entry limit for enums used as flags to be 30
Browse files Browse the repository at this point in the history
Due to the use of a 32-bit int to store the flags, the maximum number of
flags is actually 30 rather than 32. When more entries are added, the
editing of enum values breaks entirely.

The translations have been updated to use a parameter for the maximum
number of flags in an enum, to make it easier to adjust this value when
it might be increased in the future.

Closes #3658
  • Loading branch information
bjorn committed Apr 18, 2023
1 parent 01042d0 commit e532e24
Show file tree
Hide file tree
Showing 27 changed files with 44 additions and 40 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Unreleased

* Fixed the entry limit for enums used as flags to be 30 (#3658)

### Tiled 1.10.1 (4 April 2023)

* Make panning with Space require pressing a mouse button as well (#3626)
Expand Down
4 changes: 2 additions & 2 deletions src/tiled/propertytypeseditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,10 @@ void PropertyTypesEditor::removeValues()

bool PropertyTypesEditor::checkValueCount(int count)
{
if (count > 32) {
if (count > 30) {
QMessageBox::critical(this,
tr("Too Many Values"),
tr("Too many values for enum with values stored as flags. Maximum number of bit flags is 32."));
tr("Too many values for enum with values stored as flags. Maximum number of bit flags is %1.").arg(30));
return false;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_ar_DZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6165,7 +6165,7 @@ Please select specific format.</source>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_bg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6061,8 +6061,8 @@ Please select specific format.</source>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>Твърде много стойности за изброен тип, чийто стойности се съхраняват като флагове. Максималния брой на флаговете в този вид е 32.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>Твърде много стойности за изброен тип, чийто стойности се съхраняват като флагове. Максималния брой на флаговете в този вид е %1.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6091,8 +6091,8 @@ Prosím vyberte formát ručně.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>Příliš mnoho hodnot pro výčet uložený po bitech. Maximální počet takových hodnot je 32.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>Příliš mnoho hodnot pro výčet uložený po bitech. Maximální počet takových hodnot je %1.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6061,8 +6061,8 @@ Bitte Format angeben.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>Zu viele Werte für einen Enum, in dem die Werte als Flag gespeichert werden. Maximale Anzahl: 32.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>Zu viele Werte für einen Enum, in dem die Werte als Flag gespeichert werden. Maximale Anzahl: %1.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6050,8 +6050,8 @@ Please select specific format.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6058,7 +6058,7 @@ Por favor seleccione un formato específico.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_fi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6061,8 +6061,8 @@ Ole hyvä ja valitse tietty tiedostomuoto.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>Liian monta arvoa enumille, jonka arvot on tallennettu lippuina. Lippujen enimmäismäärä on 32 bittiä.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>Liian monta arvoa enumille, jonka arvot on tallennettu lippuina. Lippujen enimmäismäärä on %1 bittiä.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6088,8 +6088,8 @@ Veuillez sélectionner un format spécifique.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>Trop de valeurs de cette énumération sont stockées en tant que drapeaux. Le nombre maximal de bits de drapeaux est 32.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>Trop de valeurs de cette énumération sont stockées en tant que drapeaux. Le nombre maximal de bits de drapeaux est %1.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_he.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6050,7 +6050,7 @@ Please select specific format.</source>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_hu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6061,8 +6061,8 @@ Válasszon egy adott formátumot.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>Túl sok érték egy jelzőkként tárolt értékekkel rendelkező felsorolásnál. A bitjelzők legnagyobb száma 32.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>Túl sok érték egy jelzőkként tárolt értékekkel rendelkező felsorolásnál. A bitjelzők legnagyobb száma %1.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6061,7 +6061,7 @@ Seleziona un formato specifico.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6035,7 +6035,7 @@ Please select specific format.</source>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6033,7 +6033,7 @@ Please select specific format.</source>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_nb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6061,7 +6061,7 @@ Vennligst velgt et spesifikt format.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6061,7 +6061,7 @@ Kies een specifiek bestandsformaat.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6087,7 +6087,7 @@ Proszę wybrać konkretny format.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6061,8 +6061,8 @@ Por favor, selecione um formato específico.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>Muitos valores para enumeração com valores armazenados como sinalizadores. O número máximo de sinalizadores de bits é 32.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>Muitos valores para enumeração com valores armazenados como sinalizadores. O número máximo de sinalizadores de bits é %1.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_pt_PT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6061,8 +6061,8 @@ Por favor, selecione um formato específico.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>Muitos valores para enumeração com valores armazenados como sinalizadores. O número máximo de sinalizadores de bits é 32.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>Muitos valores para enumeração com valores armazenados como sinalizadores. O número máximo de sinalizadores de bits é %1.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6088,8 +6088,8 @@ Please select specific format.</source>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation type="unfinished">Слишком много значений для перечисления со значениями сохраненными как флаги. Максимальное количество бит-флагов - 32.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished">Слишком много значений для перечисления со значениями сохраненными как флаги. Максимальное количество бит-флагов - %1.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6061,8 +6061,8 @@ Var god ange det specifika formatet.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>För många värden för enum med värden lagrade som flaggor. Maximalt antal bitflaggor är 32.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>För många värden för enum med värden lagrade som flaggor. Maximalt antal bitflaggor är %1.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_th.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6033,7 +6033,7 @@ Please select specific format.</source>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6037,8 +6037,8 @@ Lütfen belirli bir biçim seçin.</translation>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>Bayrak olarak depolanan değerleri olan enum için çok fazla değer. En fazla bit bayrağı sayısı 32&apos;dir.</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>Bayrak olarak depolanan değerleri olan enum için çok fazla değer. En fazla bit bayrağı sayısı %1&apos;dir.</translation>
</message>
<message>
<location line="+69"/>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_uk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6086,7 +6086,7 @@ Please select specific format.</source>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
4 changes: 2 additions & 2 deletions translations/tiled_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6036,8 +6036,8 @@ Please select specific format.</source>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<translation>枚举值太多,其值存储为标志。位标志的最大数量为 32。</translation>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation>枚举值太多,其值存储为标志。位标志的最大数量为 %1。</translation>
</message>
<message>
<location line="+69"/>
Expand Down
2 changes: 1 addition & 1 deletion translations/tiled_zh_TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6034,7 +6034,7 @@ Please select specific format.</source>
</message>
<message>
<location line="+1"/>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is 32.</source>
<source>Too many values for enum with values stored as flags. Maximum number of bit flags is %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down

0 comments on commit e532e24

Please sign in to comment.