Reimplement the in-game options menu (oops)

This commit is contained in:
Sollace 2018-06-20 23:21:21 +02:00
parent 87e94819b3
commit caee032cb2
2 changed files with 14 additions and 1 deletions

View file

@ -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<? extends ConfigPanel> getConfigPanelClass() {
return PonySettingsPanel.class;

View file

@ -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.
*/