diff --git a/common/src/main/java/net/irisshaders/iris/config/IrisConfig.java b/common/src/main/java/net/irisshaders/iris/config/IrisConfig.java index 1abb2256d2..4689477b79 100644 --- a/common/src/main/java/net/irisshaders/iris/config/IrisConfig.java +++ b/common/src/main/java/net/irisshaders/iris/config/IrisConfig.java @@ -218,4 +218,9 @@ public boolean shouldAllowUnknownShaders() { public boolean shouldSkip(ResourceLocation value) { return shadersToSkip.contains(value); // TODO } + + public void setUnknown(boolean b) throws IOException { + this.allowUnknownShaders = b; + save(); + } } diff --git a/common/src/main/java/net/irisshaders/iris/gui/screen/ShaderPackScreen.java b/common/src/main/java/net/irisshaders/iris/gui/screen/ShaderPackScreen.java index 0fe62e1b1f..c6d996b934 100644 --- a/common/src/main/java/net/irisshaders/iris/gui/screen/ShaderPackScreen.java +++ b/common/src/main/java/net/irisshaders/iris/gui/screen/ShaderPackScreen.java @@ -141,6 +141,20 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) Component.literal("No"))); } + if (Screen.hasControlDown() && InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_KEY_G)) { + Minecraft.getInstance().setScreen(new ConfirmScreen((option) -> { + try { + Iris.getIrisConfig().setUnknown(option); + } catch (IOException e) { + throw new RuntimeException(e); + } + Minecraft.getInstance().setScreen(this); + }, Component.literal("Unknown shader toggle"), + Component.literal("This allows unknown shaders to load in."), + Component.literal("Enable"), + Component.literal("Disable"))); + } + if (!this.guiHidden) { super.render(guiGraphics, mouseX, mouseY, delta);