use of com.github.jakz.romlib.data.game.attributes.RomAttribute in project rom-manager by Jakz.
the class TextAttributeField method setValue.
void setValue(Game game) {
deleteButton.setVisible(this.infoPanel.mode == Mode.EDIT && game.hasCustomAttribute(attrib));
if (attrib == GameAttribute.PATH) {
Handle handle = game.rom().handle();
String handleValue = handle == null ? "" : handle.toString();
value.setText(handleValue);
} else if (attrib instanceof RomAttribute) {
Rom rom = game.rom();
value.setText(attrib.prettyValue(rom.getAttribute((RomAttribute) attrib)));
} else
value.setText(attrib.prettyValue(game.getAttribute(attrib)));
}
Aggregations