use of net.coderbot.iris.gui.screen.ShaderPackScreen in project Iris by IrisShaders.
the class MixinSodiumOptionsGUI method iris$onSetPage.
@Inject(method = "setPage", at = @At("HEAD"), remap = false, cancellable = true)
private void iris$onSetPage(OptionPage page, CallbackInfo ci) {
if (page == shaderPacks) {
minecraft.setScreen(new ShaderPackScreen(this));
ci.cancel();
}
}
use of net.coderbot.iris.gui.screen.ShaderPackScreen in project Iris by IrisShaders.
the class Iris method handleKeybinds.
public static void handleKeybinds(Minecraft minecraft) {
if (reloadKeybind.consumeClick()) {
try {
reload();
if (minecraft.player != null) {
minecraft.player.displayClientMessage(new TranslatableComponent("iris.shaders.reloaded"), false);
}
} catch (Exception e) {
logger.error("Error while reloading Shaders for Iris!", e);
if (minecraft.player != null) {
minecraft.player.displayClientMessage(new TranslatableComponent("iris.shaders.reloaded.failure", Throwables.getRootCause(e).getMessage()).withStyle(ChatFormatting.RED), false);
}
}
} else if (toggleShadersKeybind.consumeClick()) {
IrisConfig config = getIrisConfig();
try {
config.setShadersEnabled(!config.areShadersEnabled());
config.save();
reload();
if (minecraft.player != null) {
minecraft.player.displayClientMessage(new TranslatableComponent("iris.shaders.toggled", config.areShadersEnabled() ? currentPackName : "off"), false);
}
} catch (Exception e) {
logger.error("Error while toggling shaders!", e);
if (minecraft.player != null) {
minecraft.player.displayClientMessage(new TranslatableComponent("iris.shaders.toggled.failure", Throwables.getRootCause(e).getMessage()).withStyle(ChatFormatting.RED), false);
}
setShadersDisabled();
currentPackName = "(off) [fallback, check your logs for errors]";
}
} else if (shaderpackScreenKeybind.consumeClick()) {
minecraft.setScreen(new ShaderPackScreen(null));
}
}
Aggregations