Search in sources :

Example 1 with RomAttribute

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)));
}
Also used : Rom(com.github.jakz.romlib.data.game.Rom) RomAttribute(com.github.jakz.romlib.data.game.attributes.RomAttribute) Handle(com.pixbits.lib.io.archive.handles.Handle)

Aggregations

Rom (com.github.jakz.romlib.data.game.Rom)1 RomAttribute (com.github.jakz.romlib.data.game.attributes.RomAttribute)1 Handle (com.pixbits.lib.io.archive.handles.Handle)1