Search in sources :

Example 1 with SOUND_OPTION

use of eidolons.system.options.SoundOptions.SOUND_OPTION in project Eidolons by IDemiurge.

the class OptionsMaster method applySoundOptions_.

private static void applySoundOptions_(SoundOptions soundOptions) {
    for (Object sub : soundOptions.getValues().keySet()) {
        new EnumMaster<SOUND_OPTION>().retrieveEnumConst(SOUND_OPTION.class, soundOptions.getValues().get(sub).toString());
        SOUND_OPTION key = soundOptions.getKey((sub.toString()));
        String value = soundOptions.getValue(key);
        if (!StringMaster.isInteger(value)) {
            switch(key) {
                case SOUNDS_OFF:
                    SoundMaster.setOn(false);
                    // MusicMaster.resetSwitcher();
                    break;
                case MUSIC_OFF:
                    MusicMaster.resetSwitcher();
                    break;
                case MUSIC_VARIANT:
                    MusicMaster.getInstance().setVariant(new EnumMaster<MUSIC_VARIANT>().retrieveEnumConst(MUSIC_VARIANT.class, soundOptions.getValue(key)));
                    break;
            }
        } else {
            Integer integer = Integer.valueOf(value.toLowerCase());
            Float v = new Float(integer) / 100;
            switch(key) {
                case MASTER_VOLUME:
                    SoundMaster.setMasterVolume(integer);
                    MusicMaster.resetVolume();
                    break;
                case MUSIC_VOLUME:
                    MusicMaster.resetVolume();
                    // auto
                    break;
            }
        }
    }
}
Also used : SOUND_OPTION(eidolons.system.options.SoundOptions.SOUND_OPTION) EnumMaster(main.system.auxiliary.EnumMaster) MUSIC_VARIANT(eidolons.system.audio.MusicMaster.MUSIC_VARIANT)

Aggregations

MUSIC_VARIANT (eidolons.system.audio.MusicMaster.MUSIC_VARIANT)1 SOUND_OPTION (eidolons.system.options.SoundOptions.SOUND_OPTION)1 EnumMaster (main.system.auxiliary.EnumMaster)1