You can now access the MineLP settings from the main menu (F3)

This commit is contained in:
Sollace 2019-05-30 21:25:20 +02:00
parent 0d5656685c
commit fed90010e0

View file

@ -9,6 +9,7 @@ import com.minelittlepony.settings.PonyConfig;
import net.minecraft.ChatFormat; import net.minecraft.ChatFormat;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.MainMenuScreen;
import net.minecraft.client.options.KeyBinding; import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.render.entity.EntityRenderDispatcher; import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.InputUtil; import net.minecraft.client.util.InputUtil;
@ -63,10 +64,18 @@ public class MineLPClient extends MineLittlePony {
} }
public void onTick(MinecraftClient minecraft, boolean inGame) { public void onTick(MinecraftClient minecraft, boolean inGame) {
if (inGame && minecraft.currentScreen == null) {
if (keyBinding.isPressed()) { inGame &= minecraft.currentScreen == null;
boolean mainMenu = minecraft.currentScreen instanceof MainMenuScreen;
if (!inGame && mainMenu) {
KeyBinding.updatePressedStates();
}
if ((mainMenu || inGame) && keyBinding.isPressed()) {
minecraft.openScreen(new GuiHost(new GuiPonySettings())); minecraft.openScreen(new GuiHost(new GuiPonySettings()));
} else { } else if (inGame) {
long handle = minecraft.window.getHandle(); long handle = minecraft.window.getHandle();
if ((SystemUtil.getMeasuringTimeMs() % 10) == 0) { if ((SystemUtil.getMeasuringTimeMs() % 10) == 0) {
@ -87,7 +96,6 @@ public class MineLPClient extends MineLittlePony {
} }
} }
} }
}
PonySkullRenderer.resolve(); PonySkullRenderer.resolve();
} }