diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-12-07 19:00:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 19:00:24 -0500 |
commit | 0bd7c6336f5866ea5513f85a3cedf5c48e375ab2 (patch) | |
tree | c28066f2d9f819f57c42d8911f1e0046f48cdf60 /src/main/java/me/Danker/gui/ExperimentsGui.java | |
parent | 886402bdcd8d68e6d1076c86d53baab47070dd63 (diff) | |
parent | c5e8044e39f784798000b64bbece05eae0282d86 (diff) | |
download | SkyblockMod-0bd7c6336f5866ea5513f85a3cedf5c48e375ab2.tar.gz SkyblockMod-0bd7c6336f5866ea5513f85a3cedf5c48e375ab2.tar.bz2 SkyblockMod-0bd7c6336f5866ea5513f85a3cedf5c48e375ab2.zip |
1.8.4v1.8.4
Merge pull request #42 from bowser0000/development
Diffstat (limited to 'src/main/java/me/Danker/gui/ExperimentsGui.java')
-rw-r--r-- | src/main/java/me/Danker/gui/ExperimentsGui.java | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/gui/ExperimentsGui.java b/src/main/java/me/Danker/gui/ExperimentsGui.java new file mode 100644 index 0000000..b27ff16 --- /dev/null +++ b/src/main/java/me/Danker/gui/ExperimentsGui.java @@ -0,0 +1,76 @@ +package me.Danker.gui; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +public class ExperimentsGui extends GuiScreen { + + private GuiButton goBack; + private GuiButton ultrasequencer; + private GuiButton chronomatron; + private GuiButton superpairs; + private GuiButton pickBlock; + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + ultrasequencer = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Ultrasequencer Solver: " + Utils.getColouredBoolean(ToggleCommand.ultrasequencerToggled)); + chronomatron = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Chronomatron Solver: " + Utils.getColouredBoolean(ToggleCommand.chronomatronToggled)); + superpairs = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Superpairs Solver: " + Utils.getColouredBoolean(ToggleCommand.superpairsToggled)); + pickBlock = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockInExperimentsToggled)); + + + this.buttonList.add(goBack); + this.buttonList.add(ultrasequencer); + this.buttonList.add(chronomatron); + this.buttonList.add(superpairs); + this.buttonList.add(pickBlock); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + DankersSkyblockMod.guiToOpen = "dankergui1"; + } else if (button == ultrasequencer) { + ToggleCommand.ultrasequencerToggled = !ToggleCommand.ultrasequencerToggled; + ConfigHandler.writeBooleanConfig("toggles", "UltraSequencer", ToggleCommand.ultrasequencerToggled); + ultrasequencer.displayString = "Ultrasequencer Solver: " + Utils.getColouredBoolean(ToggleCommand.ultrasequencerToggled); + } else if (button == chronomatron) { + ToggleCommand.chronomatronToggled = !ToggleCommand.chronomatronToggled; + ConfigHandler.writeBooleanConfig("toggles", "Chronomatron", ToggleCommand.chronomatronToggled); + chronomatron.displayString = "Chronomatron Solver: " + Utils.getColouredBoolean(ToggleCommand.chronomatronToggled); + } else if (button == superpairs) { + ToggleCommand.superpairsToggled = !ToggleCommand.superpairsToggled; + ConfigHandler.writeBooleanConfig("toggles", "Superpairs", ToggleCommand.superpairsToggled); + superpairs.displayString = "Superpairs Solver: " + Utils.getColouredBoolean(ToggleCommand.superpairsToggled); + } else if (button == pickBlock) { + ToggleCommand.swapToPickBlockInExperimentsToggled = !ToggleCommand.swapToPickBlockInExperimentsToggled; + ConfigHandler.writeBooleanConfig("toggles", "PickBlockInExperiments", ToggleCommand.swapToPickBlockInExperimentsToggled); + pickBlock.displayString = "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockInExperimentsToggled); + } + } + +} |