From caee032cb2465bcc501922062eb99aaad16f2a7d Mon Sep 17 00:00:00 2001 From: Sollace Date: Wed, 20 Jun 2018 23:21:21 +0200 Subject: [PATCH] Reimplement the in-game options menu (oops) --- .../java/com/minelittlepony/LiteModMineLittlePony.java | 8 +++++++- src/main/java/com/minelittlepony/MineLittlePony.java | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/LiteModMineLittlePony.java b/src/main/java/com/minelittlepony/LiteModMineLittlePony.java index cc40502a..3bf014c9 100644 --- a/src/main/java/com/minelittlepony/LiteModMineLittlePony.java +++ b/src/main/java/com/minelittlepony/LiteModMineLittlePony.java @@ -3,6 +3,7 @@ package com.minelittlepony; import com.minelittlepony.gui.PonySettingsPanel; import com.mumfrey.liteloader.Configurable; import com.mumfrey.liteloader.InitCompleteListener; +import com.mumfrey.liteloader.Tickable; import com.mumfrey.liteloader.core.LiteLoader; import com.mumfrey.liteloader.modconfig.ConfigPanel; @@ -10,7 +11,7 @@ import net.minecraft.client.Minecraft; import java.io.File; -public class LiteModMineLittlePony implements InitCompleteListener, Configurable { +public class LiteModMineLittlePony implements InitCompleteListener, Tickable, Configurable { private MineLittlePony mlp; @@ -38,6 +39,11 @@ public class LiteModMineLittlePony implements InitCompleteListener, Configurable mlp.postInit(minecraft); } + @Override + public void onTick(Minecraft minecraft, float partialTicks, boolean inGame, boolean clock) { + mlp.onTick(minecraft, inGame); + } + @Override public Class getConfigPanelClass() { return PonySettingsPanel.class; diff --git a/src/main/java/com/minelittlepony/MineLittlePony.java b/src/main/java/com/minelittlepony/MineLittlePony.java index 9b7786e2..a031beff 100644 --- a/src/main/java/com/minelittlepony/MineLittlePony.java +++ b/src/main/java/com/minelittlepony/MineLittlePony.java @@ -1,5 +1,6 @@ package com.minelittlepony; +import com.minelittlepony.gui.GuiPonySettings; import com.minelittlepony.hdskins.gui.GuiSkinsMineLP; import com.minelittlepony.pony.data.IPonyData; import com.minelittlepony.pony.data.PonyDataSerialzier; @@ -77,6 +78,12 @@ public class MineLittlePony { renderManager.initializeMobRenderers(rm, config); } + void onTick(Minecraft minecraft, boolean inGame) { + if (inGame && minecraft.currentScreen == null && SETTINGS_GUI.isPressed()) { + minecraft.displayGuiScreen(new GuiPonySettings()); + } + } + /** * Gets the global MineLP instance. */