Fixed Raw editor does not select item in enum list

This commit is contained in:
Jindra Petřík
2022-11-13 16:25:07 +01:00
parent 1cd8327416
commit a29423134d
2 changed files with 8 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ All notable changes to this project will be documented in this file.
- Raw editing of DefineFontInfo/DefineFont2-3, KERNINGRECORD - proper switching wide codes
- Storing SWF configuration for files inside bundles and/or binarydata
- [#1846] blend modes with alpha
- Raw editor does not select item in enum list
### Changed
- Full path inside bundle is displayed as SWF name instead simple name

View File

@@ -90,7 +90,13 @@ public class EnumEditor extends JComboBox<ComboBoxItem<Integer>> implements Gene
public void reset() {
try {
int value = (int) (Integer) ReflectionTools.getValue(obj, field, index);
setSelectedItem(values.get(value));
for (int i = 0; i < getItemCount(); i++) {
ComboBoxItem<Integer> item = getItemAt(i);
if (item.getValue() == value) {
setSelectedItem(item);
break;
}
}
} catch (IllegalArgumentException | IllegalAccessException ex) {
// ignore
}