From e532e24a18de55b971bff9e85aec42f09f990e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Tue, 18 Apr 2023 16:37:26 +0200 Subject: [PATCH] Fixed the entry limit for enums used as flags to be 30 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 --- NEWS.md | 4 ++++ src/tiled/propertytypeseditor.cpp | 4 ++-- translations/tiled_ar_DZ.ts | 2 +- translations/tiled_bg.ts | 4 ++-- translations/tiled_cs.ts | 4 ++-- translations/tiled_de.ts | 4 ++-- translations/tiled_en.ts | 4 ++-- translations/tiled_es.ts | 2 +- translations/tiled_fi.ts | 4 ++-- translations/tiled_fr.ts | 4 ++-- translations/tiled_he.ts | 2 +- translations/tiled_hu.ts | 4 ++-- translations/tiled_it.ts | 2 +- translations/tiled_ja.ts | 2 +- translations/tiled_ko.ts | 2 +- translations/tiled_nb.ts | 2 +- translations/tiled_nl.ts | 2 +- translations/tiled_pl.ts | 2 +- translations/tiled_pt.ts | 4 ++-- translations/tiled_pt_PT.ts | 4 ++-- translations/tiled_ru.ts | 4 ++-- translations/tiled_sv.ts | 4 ++-- translations/tiled_th.ts | 2 +- translations/tiled_tr.ts | 4 ++-- translations/tiled_uk.ts | 2 +- translations/tiled_zh_CN.ts | 4 ++-- translations/tiled_zh_TW.ts | 2 +- 27 files changed, 44 insertions(+), 40 deletions(-) diff --git a/NEWS.md b/NEWS.md index 63fd58793a5..e6499e345f9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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) diff --git a/src/tiled/propertytypeseditor.cpp b/src/tiled/propertytypeseditor.cpp index d0cae9c5e85..1142ee15009 100644 --- a/src/tiled/propertytypeseditor.cpp +++ b/src/tiled/propertytypeseditor.cpp @@ -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; diff --git a/translations/tiled_ar_DZ.ts b/translations/tiled_ar_DZ.ts index 146bacd6726..e2b87b72081 100644 --- a/translations/tiled_ar_DZ.ts +++ b/translations/tiled_ar_DZ.ts @@ -6165,7 +6165,7 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_bg.ts b/translations/tiled_bg.ts index 36361c39bda..886c6e86227 100644 --- a/translations/tiled_bg.ts +++ b/translations/tiled_bg.ts @@ -6061,8 +6061,8 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Твърде много стойности за изброен тип, чийто стойности се съхраняват като флагове. Максималния брой на флаговете в този вид е 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Твърде много стойности за изброен тип, чийто стойности се съхраняват като флагове. Максималния брой на флаговете в този вид е %1. diff --git a/translations/tiled_cs.ts b/translations/tiled_cs.ts index 6acb64ed7ea..0ffd1f2399a 100644 --- a/translations/tiled_cs.ts +++ b/translations/tiled_cs.ts @@ -6091,8 +6091,8 @@ Prosím vyberte formát ručně. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Příliš mnoho hodnot pro výčet uložený po bitech. Maximální počet takových hodnot je 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Příliš mnoho hodnot pro výčet uložený po bitech. Maximální počet takových hodnot je %1. diff --git a/translations/tiled_de.ts b/translations/tiled_de.ts index 0f930da1292..f1e35bec7f0 100644 --- a/translations/tiled_de.ts +++ b/translations/tiled_de.ts @@ -6061,8 +6061,8 @@ Bitte Format angeben. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Zu viele Werte für einen Enum, in dem die Werte als Flag gespeichert werden. Maximale Anzahl: 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Zu viele Werte für einen Enum, in dem die Werte als Flag gespeichert werden. Maximale Anzahl: %1. diff --git a/translations/tiled_en.ts b/translations/tiled_en.ts index 0ae83536ff6..22d1c4eb825 100644 --- a/translations/tiled_en.ts +++ b/translations/tiled_en.ts @@ -6050,8 +6050,8 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_es.ts b/translations/tiled_es.ts index d1d0eaf9e6e..1b440ec6577 100644 --- a/translations/tiled_es.ts +++ b/translations/tiled_es.ts @@ -6058,7 +6058,7 @@ Por favor seleccione un formato específico. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_fi.ts b/translations/tiled_fi.ts index da4a826a784..780a426fd4f 100644 --- a/translations/tiled_fi.ts +++ b/translations/tiled_fi.ts @@ -6061,8 +6061,8 @@ Ole hyvä ja valitse tietty tiedostomuoto. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Liian monta arvoa enumille, jonka arvot on tallennettu lippuina. Lippujen enimmäismäärä on 32 bittiä. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Liian monta arvoa enumille, jonka arvot on tallennettu lippuina. Lippujen enimmäismäärä on %1 bittiä. diff --git a/translations/tiled_fr.ts b/translations/tiled_fr.ts index fafcd4b75da..f64105ba5b5 100644 --- a/translations/tiled_fr.ts +++ b/translations/tiled_fr.ts @@ -6088,8 +6088,8 @@ Veuillez sélectionner un format spécifique. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Trop de valeurs de cette énumération sont stockées en tant que drapeaux. Le nombre maximal de bits de drapeaux est 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Trop de valeurs de cette énumération sont stockées en tant que drapeaux. Le nombre maximal de bits de drapeaux est %1. diff --git a/translations/tiled_he.ts b/translations/tiled_he.ts index ff7f2fee418..3e0db568bfa 100644 --- a/translations/tiled_he.ts +++ b/translations/tiled_he.ts @@ -6050,7 +6050,7 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_hu.ts b/translations/tiled_hu.ts index 0db2472aa1f..03afa15366e 100644 --- a/translations/tiled_hu.ts +++ b/translations/tiled_hu.ts @@ -6061,8 +6061,8 @@ Válasszon egy adott formátumot. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Túl sok érték egy jelzőkként tárolt értékekkel rendelkező felsorolásnál. A bitjelzők legnagyobb száma 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Túl sok érték egy jelzőkként tárolt értékekkel rendelkező felsorolásnál. A bitjelzők legnagyobb száma %1. diff --git a/translations/tiled_it.ts b/translations/tiled_it.ts index a9a463c037d..490b7efbbbf 100644 --- a/translations/tiled_it.ts +++ b/translations/tiled_it.ts @@ -6061,7 +6061,7 @@ Seleziona un formato specifico. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_ja.ts b/translations/tiled_ja.ts index 787be9130d8..ac02100f89b 100644 --- a/translations/tiled_ja.ts +++ b/translations/tiled_ja.ts @@ -6035,7 +6035,7 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_ko.ts b/translations/tiled_ko.ts index 24e922a9779..dcbffd5d656 100644 --- a/translations/tiled_ko.ts +++ b/translations/tiled_ko.ts @@ -6033,7 +6033,7 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_nb.ts b/translations/tiled_nb.ts index f9af9da2d50..86e8692461e 100644 --- a/translations/tiled_nb.ts +++ b/translations/tiled_nb.ts @@ -6061,7 +6061,7 @@ Vennligst velgt et spesifikt format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_nl.ts b/translations/tiled_nl.ts index 1588619d4bf..251215f611a 100644 --- a/translations/tiled_nl.ts +++ b/translations/tiled_nl.ts @@ -6061,7 +6061,7 @@ Kies een specifiek bestandsformaat. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_pl.ts b/translations/tiled_pl.ts index 8a7df3af234..dccaab44406 100644 --- a/translations/tiled_pl.ts +++ b/translations/tiled_pl.ts @@ -6087,7 +6087,7 @@ Proszę wybrać konkretny format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_pt.ts b/translations/tiled_pt.ts index 69aac3731b5..1e6fa5a13d3 100644 --- a/translations/tiled_pt.ts +++ b/translations/tiled_pt.ts @@ -6061,8 +6061,8 @@ Por favor, selecione um formato específico. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Muitos valores para enumeração com valores armazenados como sinalizadores. O número máximo de sinalizadores de bits é 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Muitos valores para enumeração com valores armazenados como sinalizadores. O número máximo de sinalizadores de bits é %1. diff --git a/translations/tiled_pt_PT.ts b/translations/tiled_pt_PT.ts index f0e914b76eb..6837ae33a06 100644 --- a/translations/tiled_pt_PT.ts +++ b/translations/tiled_pt_PT.ts @@ -6061,8 +6061,8 @@ Por favor, selecione um formato específico. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Muitos valores para enumeração com valores armazenados como sinalizadores. O número máximo de sinalizadores de bits é 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Muitos valores para enumeração com valores armazenados como sinalizadores. O número máximo de sinalizadores de bits é %1. diff --git a/translations/tiled_ru.ts b/translations/tiled_ru.ts index 78f7a407744..2da5edbe9d8 100644 --- a/translations/tiled_ru.ts +++ b/translations/tiled_ru.ts @@ -6088,8 +6088,8 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Слишком много значений для перечисления со значениями сохраненными как флаги. Максимальное количество бит-флагов - 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Слишком много значений для перечисления со значениями сохраненными как флаги. Максимальное количество бит-флагов - %1. diff --git a/translations/tiled_sv.ts b/translations/tiled_sv.ts index 5f2ab22b17f..55e1b99b7eb 100644 --- a/translations/tiled_sv.ts +++ b/translations/tiled_sv.ts @@ -6061,8 +6061,8 @@ Var god ange det specifika formatet. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - För många värden för enum med värden lagrade som flaggor. Maximalt antal bitflaggor är 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + För många värden för enum med värden lagrade som flaggor. Maximalt antal bitflaggor är %1. diff --git a/translations/tiled_th.ts b/translations/tiled_th.ts index 80744977067..65f0ea97449 100644 --- a/translations/tiled_th.ts +++ b/translations/tiled_th.ts @@ -6033,7 +6033,7 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_tr.ts b/translations/tiled_tr.ts index 9130c61041b..58251f95b69 100644 --- a/translations/tiled_tr.ts +++ b/translations/tiled_tr.ts @@ -6037,8 +6037,8 @@ Lütfen belirli bir biçim seçin. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - Bayrak olarak depolanan değerleri olan enum için çok fazla değer. En fazla bit bayrağı sayısı 32'dir. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + Bayrak olarak depolanan değerleri olan enum için çok fazla değer. En fazla bit bayrağı sayısı %1'dir. diff --git a/translations/tiled_uk.ts b/translations/tiled_uk.ts index 1b93ad9dc31..15ecabdca59 100644 --- a/translations/tiled_uk.ts +++ b/translations/tiled_uk.ts @@ -6086,7 +6086,7 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. diff --git a/translations/tiled_zh_CN.ts b/translations/tiled_zh_CN.ts index 572b02676c4..4411cd958d8 100644 --- a/translations/tiled_zh_CN.ts +++ b/translations/tiled_zh_CN.ts @@ -6036,8 +6036,8 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. - 枚举值太多,其值存储为标志。位标志的最大数量为 32。 + Too many values for enum with values stored as flags. Maximum number of bit flags is %1. + 枚举值太多,其值存储为标志。位标志的最大数量为 %1。 diff --git a/translations/tiled_zh_TW.ts b/translations/tiled_zh_TW.ts index 81d751b5049..07eefbab583 100644 --- a/translations/tiled_zh_TW.ts +++ b/translations/tiled_zh_TW.ts @@ -6034,7 +6034,7 @@ Please select specific format. - Too many values for enum with values stored as flags. Maximum number of bit flags is 32. + Too many values for enum with values stored as flags. Maximum number of bit flags is %1.