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 | 6f6ce67dc5a32488a5c7f80a540a3a841c7fcadb (patch) | |
tree | 4c11d3ac1fa2ae8dcc322fbf9a863bfbc4ed85f5 /src/main/java/at/hannibal2 | |
parent | 41a2931ca1dbb33bfed61d95bdc4ce70f73a5cbb (diff) | |
download | skyhanni-6f6ce67dc5a32488a5c7f80a540a3a841c7fcadb.tar.gz skyhanni-6f6ce67dc5a32488a5c7f80a540a3a841c7fcadb.tar.bz2 skyhanni-6f6ce67dc5a32488a5c7f80a540a3a841c7fcadb.zip |
updated to 0.12.2 and made forge mod list button work
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.java | 49 |
2 files changed, 51 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 57e23487f..47122a9dc 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -57,11 +57,11 @@ import org.apache.logging.log4j.Logger; import java.util.ArrayList; import java.util.List; -@Mod(modid = SkyHanniMod.MODID, version = SkyHanniMod.VERSION) +@Mod(modid = SkyHanniMod.MODID, version = SkyHanniMod.VERSION, clientSideOnly = true, useMetadata = true, guiFactory = "at.hannibal2.skyhanni.config.ConfigGuiForgeInterop") public class SkyHanniMod { public static final String MODID = "skyhanni"; - public static final String VERSION = "0.12.1"; + public static final String VERSION = "0.12.2"; public static Features feature; 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(); + } + } +} |