aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md5
-rw-r--r--build.gradle.kts2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.java49
4 files changed, 57 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 538e92368..b7c4f6c34 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
# SkyHanni - Change Log
+## Version 0.12.2
+
+### Changes
++ Made the config button in the forge mod list work.
+
## Version 0.12.1
### Fixes
diff --git a/build.gradle.kts b/build.gradle.kts
index e1d9cd179..943d2c94a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -10,7 +10,7 @@ plugins {
}
group = "at.hannibal2.skyhanni"
-version = "0.12.1"
+version = "0.12.2"
// Toolchains:
java {
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();
+ }
+ }
+}