diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-10-04 18:26:58 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-10-04 18:26:58 +0200 |
| commit | be73b8573a54c0b3fecd62af3b1e2d7fda4a068a (patch) | |
| tree | 4c11d3ac1fa2ae8dcc322fbf9a863bfbc4ed85f5 /src/main/java/at/hannibal2/skyhanni/config | |
| parent | dfe579a9c3b2aff280577f87992b5a99758acbad (diff) | |
| download | SkyHanni-be73b8573a54c0b3fecd62af3b1e2d7fda4a068a.tar.gz SkyHanni-be73b8573a54c0b3fecd62af3b1e2d7fda4a068a.tar.bz2 SkyHanni-be73b8573a54c0b3fecd62af3b1e2d7fda4a068a.zip | |
updated to 0.12.2 and made forge mod list button work
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.java b/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.java new file mode 100644 index 000000000..0633f09de --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.java @@ -0,0 +1,49 @@ +package at.hannibal2.skyhanni.config; + +import at.hannibal2.skyhanni.config.core.GuiScreenElementWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.fml.client.IModGuiFactory; +import org.lwjgl.input.Keyboard; + +import java.io.IOException; +import java.util.Set; + +public class ConfigGuiForgeInterop implements IModGuiFactory { + @Override + public void initialize(Minecraft minecraft) {} + + @Override + public Class<? extends GuiScreen> mainConfigGuiClass() { + return WrappedSkyHanniConfig.class; + } + + @Override + public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() { + return null; + } + + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement runtimeOptionCategoryElement) { + return null; + } + + public static class WrappedSkyHanniConfig extends GuiScreenElementWrapper { + + private final GuiScreen parent; + + public WrappedSkyHanniConfig(GuiScreen parent) { + super(ConfigEditor.editor); + this.parent = parent; + } + + @Override + public void handleKeyboardInput() throws IOException { + if (Keyboard.getEventKeyState() && Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { + Minecraft.getMinecraft().displayGuiScreen(parent); + return; + } + super.handleKeyboardInput(); + } + } +} |
