- package net.minecraft.client.gui;
- import java.awt.Color;
- import java.io.IOException;
- import java.util.List;
- import net.minecraft.bp.Module.Module;
- import net.minecraft.bp.Module.render.Wings;
- import net.minecraft.bp.gui.ArrangeGui;
- import net.minecraft.bp.keystrokes.MouseButton;
- import net.minecraft.bp.manage.ModuleManager;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.audio.PositionedSoundRecord;
- import net.minecraft.client.audio.SoundCategory;
- import net.minecraft.client.audio.SoundEventAccessorComposite;
- import net.minecraft.client.audio.SoundHandler;
- import net.minecraft.client.entity.blazingpack.Main;
- import net.minecraft.client.entity.blazingpack.renderer.GuiIngameHook;
- import net.minecraft.client.multiplayer.WorldClient;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.client.settings.GameSettings;
- import net.minecraft.client.settings.GameSettings.Options;
- import net.minecraft.client.settings.KeyBinding;
- import net.minecraft.util.ChatComponentText;
- import net.minecraft.util.ChatComponentTranslation;
- import net.minecraft.world.EnumDifficulty;
- import net.minecraft.world.storage.WorldInfo;
- import org.lwjgl.input.Keyboard;
- public class GuiBpOptions extends GuiScreen implements GuiYesNoCallback
- {
- private static final GameSettings.Options[] field_146440_f = { GameSettings.Options.FOV };
- private final GuiScreen field_146441_g;
- public static GuiButton b;
- private static GuiButton bb;
- private final GameSettings game_settings_1;
- private GuiButton field_175357_i;
- public static GuiButton autosprintbutton;
- private GuiLockIconButton field_175356_r;
- protected String field_146442_a = "BlazingPack Options";
- private static final String __OBFID = "CL_00000700";
- public GuiBpOptions(GuiScreen p_i1046_1_, GameSettings p_i1046_2_)
- {
- field_146441_g = p_i1046_1_;
- game_settings_1 = p_i1046_2_;
- }
- public void initGui()
- {
- int var1 = 0;
- field_146442_a = I18n.format("BlazingPack Options", new Object[0]);
- GameSettings.Options[] var2 = field_146440_f;
- int var3 = var2.length;
- for (int var4 = 0; var4 < var3; var4++)
- {
- GameSettings.Options var5 = var2[var4];
- if (!var5.getEnumFloat())
- {
- GuiOptionButton localGuiOptionButton = new GuiOptionButton(var5.returnEnumOrdinal(), width / 2 - 155 + var1 % 2 * 160, height / 6 - 12 + 24 * (var1 >> 1), var5, game_settings_1.getKeyBinding(var5));
- }
- var1++;
- }
- buttonList.add(new GuiButton(110, width / 2 - 155, height / 6 + 48 - 6, 150, 20, I18n.format("Animations 1.7: NO", new Object[0])));
- buttonList.add(new GuiButton(8675309, width / 2 + 5, height / 6 + 24 - 6, 150, 20, MouseButton.ShowCPS ? "Show CPS counter: YES" : "Show CPS counter: NO")
- {
- private static final String __OBFID = "CL_00000701";
- public void playPressSound(SoundHandler soundHandlerIn) {
- SoundEventAccessorComposite var2 = soundHandlerIn.getRandomSoundFromCategories(new SoundCategory[] { SoundCategory.ANIMALS, SoundCategory.BLOCKS, SoundCategory.MOBS, SoundCategory.PLAYERS, SoundCategory.WEATHER });
- if (var2 != null)
- {
- soundHandlerIn.playSound(PositionedSoundRecord.createPositionedSoundRecord(var2.getSoundEventLocation(), 0.5F));
- }
- }
- });
- b = new GuiButton(107, width / 2 + 5, height / 6 + 72 - 6, 150, 20, I18n.format(GuiIngameHook.renderKeyStrokes ? "Keystrokes color: Rainbow" : "Keystrokes color: White", new Object[0]));
- buttonList.add(new GuiButton(106, width / 2 - 155, height / 6 + 72 - 6, 150, 20, I18n.format(GuiIngameHook.renderKeyStrokes ? "Show keystrokes: YES" : "Show keystrokes: NO", new Object[0])));
- buttonList.add(b);
- if (!GuiIngameHook.renderKeyStrokes) {
- benabled = false;
- }
- if (!GuiIngameHook.useRainbow.booleanValue()) {
- if (GuiIngameHook.keycolor == Color.white) {
- bdisplayString = "Keystrokes color: White";
- } else if (GuiIngameHook.keycolor == Color.GREEN) {
- bdisplayString = "Keystrokes color: Green";
- } else if (GuiIngameHook.keycolor == Color.blue) {
- bdisplayString = "Keystrokes color: Blue";
- } else if (GuiIngameHook.keycolor == Color.yellow) {
- bdisplayString = "Keystrokes color: Yellow";
- } else if (GuiIngameHook.keycolor == Color.MAGENTA) {
- bdisplayString = "Keystrokes color: Purple";
- } else if (GuiIngameHook.keycolor == Color.red) {
- bdisplayString = "Keystrokes color: Red";
- }
- } else {
- bdisplayString = "Keystrokes color: Rainbow";
- }
- buttonList.add(new GuiButton(101, width / 2 - 155, height / 6 + 96 - 6, 150, 20, I18n.format("Show less on F3: NO", new Object[0])));
- buttonList.add(new GuiButton(100, width / 2 + 5, height / 6 + 96 - 6, 150, 20, I18n.format("Show potion effects: YES", new Object[0])));
- String key = Keyboard.getKeyName(mc.gameSettings.keyBindSprint.getKeyCode());
- autosprintbutton = new GuiButton(102, width / 2 - 155, height / 6 + 120 - 6, 150, 20, I18n.format("Auto sprint: §2" + key, new Object[0]));
- buttonList.add(autosprintbutton);
- buttonList.add(new GuiButton(103, width / 2 + 5, height / 6 + 120 - 6, 150, 20, I18n.format("Unfocused FPS limit: NO", new Object[0])));
- buttonList.add(new GuiButton(104, width / 2 - 75, height / 6 + 149 - 6, 150, 20, I18n.format("Arrange GUI", new Object[0])));
- buttonList.add(new GuiButton(200, width / 2 - 100, height / 6 + 168, I18n.format("gui.done", new Object[0])));
- buttonList.add(new GuiButton(115, width / 2 - 155, height / 6 + 24 - 6, 150, 20, I18n.format(FakeBP.showWings ? "Show wings: YES" : "Show wings: NO", new Object[0])));
- buttonList.add(new GuiButton(116, width / 2 - 155, height / 6 - 6, 150, 20, I18n.format("Text background: YES", new Object[0])));
- buttonList.add(new GuiButton(117, width / 2 + 5, height / 6 - 6, 150, 20, I18n.format("Chunk animation: NO", new Object[0])));
- buttonList.add(new GuiButton(118, width / 2 + 5, height / 6 + 48 - 6, 150, 20, "BlazingPack Animations: NO"));
- }
- public String func_175355_a(EnumDifficulty p_175355_1_)
- {
- ChatComponentText var2 = new ChatComponentText("");
- var2.appendSibling(new ChatComponentTranslation("", new Object[0]));
- var2.appendText(": ");
- var2.appendSibling(new ChatComponentTranslation(p_175355_1_.getDifficultyResourceKey(), new Object[0]));
- return var2.getFormattedText();
- }
- public void confirmClicked(boolean result, int id)
- {
- mc.displayGuiScreen(this);
- if ((id == 109) && (result) && (Minecraft.theWorld != null))
- {
- Minecraft.theWorld.getWorldInfo().setDifficultyLocked(true);
- field_175356_r.func_175229_b(true);
- field_175356_r.enabled = false;
- field_175357_i.enabled = false;
- }
- }
- protected void actionPerformed(GuiButton button) throws IOException
- {
- if (enabled)
- {
- int id;
- if ((id == 102) && (!displayString.contains("?"))) {
- displayString = FakeBP.fixColor("Auto sprint: &c?");
- }
- if (id == 8675309) {
- if (displayString.contains("NO"))
- {
- displayString = "Show CPS counter: YES";
- MouseButton.ShowCPS = true;
- }
- else
- {
- displayString = "Show CPS counter: NO";
- MouseButton.ShowCPS = false;
- }
- }
- if (id == 110) {
- if (displayString.contains("NO")) {
- displayString = "Animations 1.7: YES";
- } else {
- displayString = "Animations 1.7: NO";
- }
- }
- if (id == 107) {
- if (displayString.contains("White"))
- {
- displayString = "Keystrokes color: Red";
- GuiIngameHook.useRainbow = Boolean.valueOf(false);
- GuiIngameHook.keycolor = Color.RED;
- }
- else if (displayString.contains("Red"))
- {
- displayString = "Keystrokes color: Green";
- GuiIngameHook.useRainbow = Boolean.valueOf(false);
- GuiIngameHook.keycolor = Color.green;
- }
- else if (displayString.contains("Green"))
- {
- displayString = "Keystrokes color: Blue";
- GuiIngameHook.useRainbow = Boolean.valueOf(false);
- GuiIngameHook.keycolor = Color.BLUE;
- }
- else if (displayString.contains("Blue"))
- {
- displayString = "Keystrokes color: Yellow";
- GuiIngameHook.useRainbow = Boolean.valueOf(false);
- GuiIngameHook.keycolor = Color.yellow;
- }
- else if (displayString.contains("Yellow"))
- {
- displayString = "Keystrokes color: Purple";
- GuiIngameHook.useRainbow = Boolean.valueOf(false);
- GuiIngameHook.keycolor = Color.MAGENTA;
- }
- else if (displayString.contains("Purple"))
- {
- displayString = "Keystrokes color: Rainbow";
- GuiIngameHook.useRainbow = Boolean.valueOf(true);
- }
- else if (displayString.contains("Rainbow"))
- {
- GuiIngameHook.useRainbow = Boolean.valueOf(false);
- GuiIngameHook.keycolor = Color.WHITE;
- displayString = "Keystrokes color: White";
- }
- }
- if (id == 100) {
- if (displayString.contains("NO")) {
- displayString = "Show potion effects: YES";
- } else {
- displayString = "Show potion effects: NO";
- }
- }
- if (id == 103) {
- if (displayString.contains("NO")) {
- displayString = "Unfocused FPS limit: YES";
- } else {
- displayString = "Unfocused FPS limit: NO";
- }
- }
- if (id == 101) {
- if (displayString.contains("NO")) {
- displayString = "Show less on F3: YES";
- } else {
- displayString = "Show less on F3: NO";
- }
- }
- if (id == 115) {
- if (displayString.contains("NO"))
- {
- displayString = "Show wings: YES";
- FakeBP.showWings = true;
- }
- else
- {
- FakeBP.showWings = false;
- displayString = "Show wings: NO";
- }
- }
- if (id == 106) {
- if (displayString.contains("NO"))
- {
- displayString = "Show keystrokes: YES";
- GuiIngameHook.renderKeyStrokes = true;
- benabled = true;
- }
- else
- {
- displayString = "Show keystrokes: NO";
- GuiIngameHook.renderKeyStrokes = false;
- benabled = false;
- }
- }
- if (id == 200)
- {
- mc.gameSettings.saveOptions();
- mc.displayGuiScreen(field_146441_g);
- }
- }
- }
- protected void keyTyped(char typedChar, int keyCode) throws IOException
- {
- super.keyTyped(typedChar, keyCode);
- if (autosprintbuttondisplayString.contains("?")) {
- String key = Keyboard.getKeyName(keyCode);
- autosprintbuttondisplayString = Main.fixColor("Auto sprint: &2" + key);
- getMinecraftgameSettings.keyBindSprint.setKeyCode(keyCode);
- }
- }
- public void drawScreen(int mouseX, int mouseY, float partialTicks)
- {
- drawDefaultBackground();
- drawCenteredString(fontRendererObj, field_146442_a, width / 2, 15, 16777215);
- super.drawScreen(mouseX, mouseY, partialTicks);
- }
- }