Facebook
From Thundering Cat, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 205
  1. package net.minecraft.client.gui;
  2.  
  3. import java.awt.Color;
  4. import java.io.IOException;
  5. import java.util.List;
  6. import net.minecraft.bp.Module.Module;
  7. import net.minecraft.bp.Module.render.Wings;
  8. import net.minecraft.bp.gui.ArrangeGui;
  9. import net.minecraft.bp.keystrokes.MouseButton;
  10. import net.minecraft.bp.manage.ModuleManager;
  11. import net.minecraft.client.Minecraft;
  12. import net.minecraft.client.audio.PositionedSoundRecord;
  13. import net.minecraft.client.audio.SoundCategory;
  14. import net.minecraft.client.audio.SoundEventAccessorComposite;
  15. import net.minecraft.client.audio.SoundHandler;
  16. import net.minecraft.client.entity.blazingpack.Main;
  17. import net.minecraft.client.entity.blazingpack.renderer.GuiIngameHook;
  18. import net.minecraft.client.multiplayer.WorldClient;
  19. import net.minecraft.client.resources.I18n;
  20. import net.minecraft.client.settings.GameSettings;
  21. import net.minecraft.client.settings.GameSettings.Options;
  22. import net.minecraft.client.settings.KeyBinding;
  23. import net.minecraft.util.ChatComponentText;
  24. import net.minecraft.util.ChatComponentTranslation;
  25. import net.minecraft.world.EnumDifficulty;
  26. import net.minecraft.world.storage.WorldInfo;
  27. import org.lwjgl.input.Keyboard;
  28.  
  29. public class GuiBpOptions extends GuiScreen implements GuiYesNoCallback
  30. {
  31.   private static final GameSettings.Options[] field_146440_f = { GameSettings.Options.FOV };
  32.  
  33.   private final GuiScreen field_146441_g;
  34.   public static GuiButton b;
  35.   private static GuiButton bb;
  36.   private final GameSettings game_settings_1;
  37.   private GuiButton field_175357_i;
  38.   public static GuiButton autosprintbutton;
  39.   private GuiLockIconButton field_175356_r;
  40.   protected String field_146442_a = "BlazingPack Options";
  41.   private static final String __OBFID = "CL_00000700";
  42.  
  43.   public GuiBpOptions(GuiScreen p_i1046_1_, GameSettings p_i1046_2_)
  44.   {
  45.     field_146441_g = p_i1046_1_;
  46.     game_settings_1 = p_i1046_2_;
  47.   }
  48.  
  49.  
  50.  
  51.  
  52.   public void initGui()
  53.   {
  54.     int var1 = 0;
  55.     field_146442_a = I18n.format("BlazingPack Options", new Object[0]);
  56.     GameSettings.Options[] var2 = field_146440_f;
  57.     int var3 = var2.length;
  58.    
  59.     for (int var4 = 0; var4 < var3; var4++)
  60.     {
  61.       GameSettings.Options var5 = var2[var4];
  62.      
  63.       if (!var5.getEnumFloat())
  64.       {
  65.  
  66.  
  67.  
  68.  
  69.         GuiOptionButton localGuiOptionButton = new GuiOptionButton(var5.returnEnumOrdinal(), width / 2 - 155 + var1 % 2 * 160, height / 6 - 12 + 24 * (var1 >> 1), var5, game_settings_1.getKeyBinding(var5));
  70.       }
  71.      
  72.  
  73.       var1++;
  74.     }
  75.    
  76.  
  77.  
  78.     buttonList.add(new GuiButton(110, width / 2 - 155, height / 6 + 48 - 6, 150, 20, I18n.format("Animations 1.7: NO", new Object[0])));
  79.     buttonList.add(new GuiButton(8675309, width / 2 + 5, height / 6 + 24 - 6, 150, 20, MouseButton.ShowCPS ? "Show CPS counter: YES" : "Show CPS counter: NO")
  80.     {
  81.       private static final String __OBFID = "CL_00000701";
  82.      
  83.       public void playPressSound(SoundHandler soundHandlerIn) {
  84.         SoundEventAccessorComposite var2 = soundHandlerIn.getRandomSoundFromCategories(new SoundCategory[] { SoundCategory.ANIMALS, SoundCategory.BLOCKS, SoundCategory.MOBS, SoundCategory.PLAYERS, SoundCategory.WEATHER });
  85.        
  86.         if (var2 != null)
  87.         {
  88.           soundHandlerIn.playSound(PositionedSoundRecord.createPositionedSoundRecord(var2.getSoundEventLocation(), 0.5F));
  89.         }
  90.       }
  91.     });
  92.     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]));
  93.     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])));
  94.     buttonList.add(b);
  95.     if (!GuiIngameHook.renderKeyStrokes) {
  96.       benabled = false;
  97.     }
  98.     if (!GuiIngameHook.useRainbow.booleanValue()) {
  99.       if (GuiIngameHook.keycolor == Color.white) {
  100.         bdisplayString = "Keystrokes color: White";
  101.       } else if (GuiIngameHook.keycolor == Color.GREEN) {
  102.         bdisplayString = "Keystrokes color: Green";
  103.       } else if (GuiIngameHook.keycolor == Color.blue) {
  104.         bdisplayString = "Keystrokes color: Blue";
  105.       } else if (GuiIngameHook.keycolor == Color.yellow) {
  106.         bdisplayString = "Keystrokes color: Yellow";
  107.       } else if (GuiIngameHook.keycolor == Color.MAGENTA) {
  108.         bdisplayString = "Keystrokes color: Purple";
  109.       } else if (GuiIngameHook.keycolor == Color.red) {
  110.         bdisplayString = "Keystrokes color: Red";
  111.       }
  112.     } else {
  113.       bdisplayString = "Keystrokes color: Rainbow";
  114.     }
  115.     buttonList.add(new GuiButton(101, width / 2 - 155, height / 6 + 96 - 6, 150, 20, I18n.format("Show less on F3: NO", new Object[0])));
  116.     buttonList.add(new GuiButton(100, width / 2 + 5, height / 6 + 96 - 6, 150, 20, I18n.format("Show potion effects: YES", new Object[0])));
  117.     String key = Keyboard.getKeyName(mc.gameSettings.keyBindSprint.getKeyCode());
  118.     autosprintbutton = new GuiButton(102, width / 2 - 155, height / 6 + 120 - 6, 150, 20, I18n.format("Auto sprint: §2" + key, new Object[0]));
  119.     buttonList.add(autosprintbutton);
  120.     buttonList.add(new GuiButton(103, width / 2 + 5, height / 6 + 120 - 6, 150, 20, I18n.format("Unfocused FPS limit: NO", new Object[0])));
  121.     buttonList.add(new GuiButton(104, width / 2 - 75, height / 6 + 149 - 6, 150, 20, I18n.format("Arrange GUI", new Object[0])));
  122.     buttonList.add(new GuiButton(200, width / 2 - 100, height / 6 + 168, I18n.format("gui.done", new Object[0])));
  123.     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])));
  124.     buttonList.add(new GuiButton(116, width / 2 - 155, height / 6 - 6, 150, 20, I18n.format("Text background: YES", new Object[0])));
  125.     buttonList.add(new GuiButton(117, width / 2 + 5, height / 6 - 6, 150, 20, I18n.format("Chunk animation: NO", new Object[0])));
  126.     buttonList.add(new GuiButton(118, width / 2 + 5, height / 6 + 48 - 6, 150, 20, "BlazingPack Animations: NO"));
  127.   }
  128.  
  129.  
  130.  
  131.  
  132.   public String func_175355_a(EnumDifficulty p_175355_1_)
  133.   {
  134.     ChatComponentText var2 = new ChatComponentText("");
  135.     var2.appendSibling(new ChatComponentTranslation("", new Object[0]));
  136.     var2.appendText(": ");
  137.     var2.appendSibling(new ChatComponentTranslation(p_175355_1_.getDifficultyResourceKey(), new Object[0]));
  138.     return var2.getFormattedText();
  139.   }
  140.  
  141.   public void confirmClicked(boolean result, int id)
  142.   {
  143.     mc.displayGuiScreen(this);
  144.     if ((id == 109) && (result) && (Minecraft.theWorld != null))
  145.     {
  146.       Minecraft.theWorld.getWorldInfo().setDifficultyLocked(true);
  147.       field_175356_r.func_175229_b(true);
  148.       field_175356_r.enabled = false;
  149.       field_175357_i.enabled = false;
  150.     }
  151.   }
  152.  
  153.   protected void actionPerformed(GuiButton button) throws IOException
  154.   {
  155.     if (enabled)
  156.     {
  157.         int id;
  158.                 if ((id == 102) && (!displayString.contains("?"))) {
  159.             displayString = FakeBP.fixColor("Auto sprint: &c?");
  160.           }
  161.           if (id == 8675309) {
  162.             if (displayString.contains("NO"))
  163.             {
  164.               displayString = "Show CPS counter: YES";
  165.               MouseButton.ShowCPS = true;
  166.             }
  167.             else
  168.             {
  169.               displayString = "Show CPS counter: NO";
  170.               MouseButton.ShowCPS = false;
  171.             }
  172.           }
  173.           if (id == 110) {
  174.             if (displayString.contains("NO")) {
  175.               displayString = "Animations 1.7: YES";
  176.             } else {
  177.               displayString = "Animations 1.7: NO";
  178.             }
  179.           }
  180.           if (id == 107) {
  181.             if (displayString.contains("White"))
  182.             {
  183.               displayString = "Keystrokes color: Red";
  184.               GuiIngameHook.useRainbow = Boolean.valueOf(false);
  185.               GuiIngameHook.keycolor = Color.RED;
  186.             }
  187.             else if (displayString.contains("Red"))
  188.             {
  189.               displayString = "Keystrokes color: Green";
  190.               GuiIngameHook.useRainbow = Boolean.valueOf(false);
  191.               GuiIngameHook.keycolor = Color.green;
  192.             }
  193.             else if (displayString.contains("Green"))
  194.             {
  195.               displayString = "Keystrokes color: Blue";
  196.               GuiIngameHook.useRainbow = Boolean.valueOf(false);
  197.               GuiIngameHook.keycolor = Color.BLUE;
  198.             }
  199.             else if (displayString.contains("Blue"))
  200.             {
  201.               displayString = "Keystrokes color: Yellow";
  202.               GuiIngameHook.useRainbow = Boolean.valueOf(false);
  203.               GuiIngameHook.keycolor = Color.yellow;
  204.             }
  205.             else if (displayString.contains("Yellow"))
  206.             {
  207.               displayString = "Keystrokes color: Purple";
  208.               GuiIngameHook.useRainbow = Boolean.valueOf(false);
  209.               GuiIngameHook.keycolor = Color.MAGENTA;
  210.             }
  211.             else if (displayString.contains("Purple"))
  212.             {
  213.               displayString = "Keystrokes color: Rainbow";
  214.               GuiIngameHook.useRainbow = Boolean.valueOf(true);
  215.             }
  216.             else if (displayString.contains("Rainbow"))
  217.             {
  218.               GuiIngameHook.useRainbow = Boolean.valueOf(false);
  219.               GuiIngameHook.keycolor = Color.WHITE;
  220.               displayString = "Keystrokes color: White";
  221.             }
  222.           }
  223.           if (id == 100) {
  224.             if (displayString.contains("NO")) {
  225.               displayString = "Show potion effects: YES";
  226.             } else {
  227.               displayString = "Show potion effects: NO";
  228.             }
  229.           }
  230.           if (id == 103) {
  231.             if (displayString.contains("NO")) {
  232.               displayString = "Unfocused FPS limit: YES";
  233.             } else {
  234.               displayString = "Unfocused FPS limit: NO";
  235.             }
  236.           }
  237.           if (id == 101) {
  238.             if (displayString.contains("NO")) {
  239.               displayString = "Show less on F3: YES";
  240.             } else {
  241.               displayString = "Show less on F3: NO";
  242.             }
  243.           }
  244.           if (id == 115) {
  245.             if (displayString.contains("NO"))
  246.             {
  247.               displayString = "Show wings: YES";
  248.               FakeBP.showWings = true;
  249.             }
  250.             else
  251.             {
  252.               FakeBP.showWings = false;
  253.               displayString = "Show wings: NO";
  254.             }
  255.           }
  256.           if (id == 106) {
  257.             if (displayString.contains("NO"))
  258.             {
  259.               displayString = "Show keystrokes: YES";
  260.               GuiIngameHook.renderKeyStrokes = true;
  261.               benabled = true;
  262.             }
  263.             else
  264.             {
  265.               displayString = "Show keystrokes: NO";
  266.               GuiIngameHook.renderKeyStrokes = false;
  267.               benabled = false;
  268.             }
  269.           }
  270.           if (id == 200)
  271.           {
  272.             mc.gameSettings.saveOptions();
  273.             mc.displayGuiScreen(field_146441_g);
  274.       }
  275.     }
  276.   }
  277.  
  278.   protected void keyTyped(char typedChar, int keyCode) throws IOException
  279.   {
  280.     super.keyTyped(typedChar, keyCode);
  281.     if (autosprintbuttondisplayString.contains("?")) {
  282.       String key = Keyboard.getKeyName(keyCode);
  283.       autosprintbuttondisplayString = Main.fixColor("Auto sprint: &2" + key);
  284.       getMinecraftgameSettings.keyBindSprint.setKeyCode(keyCode);
  285.     }
  286.   }
  287.  
  288.  
  289.  
  290.  
  291.   public void drawScreen(int mouseX, int mouseY, float partialTicks)
  292.   {
  293.     drawDefaultBackground();
  294.     drawCenteredString(fontRendererObj, field_146442_a, width / 2, 15, 16777215);
  295.     super.drawScreen(mouseX, mouseY, partialTicks);
  296.   }
  297. }
  298.