Search in sources :

Example 1 with ProfileSet

use of net.coderbot.iris.shaderpack.option.ProfileSet in project Iris by IrisShaders.

the class ProfileElementWidget method init.

@Override
public void init(ShaderPackScreen screen, NavigationController navigation) {
    super.init(screen, navigation);
    this.setLabel(PROFILE_LABEL);
    ProfileSet profiles = this.element.profiles;
    OptionSet options = this.element.options;
    OptionValues pendingValues = this.element.getPendingOptionValues();
    ProfileSet.ProfileResult result = profiles.scan(options, pendingValues);
    this.next = result.next;
    this.previous = result.previous;
    Optional<String> profileName = result.current.map(p -> p.name);
    this.profileLabel = profileName.map(name -> GuiUtil.translateOrDefault(new TextComponent(name), "profile." + name)).orElse(PROFILE_CUSTOM);
}
Also used : TextComponent(net.minecraft.network.chat.TextComponent) ProfileSet(net.coderbot.iris.shaderpack.option.ProfileSet) OptionValues(net.coderbot.iris.shaderpack.option.values.OptionValues) OptionSet(net.coderbot.iris.shaderpack.option.OptionSet)

Aggregations

OptionSet (net.coderbot.iris.shaderpack.option.OptionSet)1 ProfileSet (net.coderbot.iris.shaderpack.option.ProfileSet)1 OptionValues (net.coderbot.iris.shaderpack.option.values.OptionValues)1 TextComponent (net.minecraft.network.chat.TextComponent)1