Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package a;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.GuiButton;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiTextField;
- import org.lwjgl.input.Keyboard;
- import org.lwjgl.input.Mouse;
- import cpw.mods.fml.client.config.GuiSlider;
- public class GUI
- extends GuiScreen
- {
- //id,xPos,yPos,width, height, String prefix, String suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr //
- private static GuiSlider velocitySlider = new GuiSlider(0, 50, 0, 125, 20, "", "", 70, 100, 96, false, true);
- private static GuiButton velocityToggle = new GuiButton(4, 180, 0, 20, 20, "On");
- // id, xpos, ypos, wid, hei, name
- private static GuiButton velocityLabel = new GuiButton(1, 8, 0, 0, 20, "KB");
- //private static GuiTextField velocBind = new GuiTextField(Minecraft.getMinecraft().fontRenderer, 200, 20, 20, 20);
- //5 - 17 cps
- private static GuiSlider cpsSlider = new GuiSlider(0, 50, 20, 125, 20, "", "", 5, 17, 8, false, true);
- private static GuiButton clickToggle = new GuiButton(4, 180, 20, 20, 20, "On");
- private static GuiButton clickLabel = new GuiButton(1,10,20,0,20,"CPS");
- private static GuiSlider reachSlider = new GuiSlider(0, 50, 40, 125, 20, "", "", 33, 60, 35, false, true);
- private static GuiButton reachToggle = new GuiButton(4, 180, 40, 20, 20, "On");
- private static GuiButton reachLabel1 = new GuiButton(1,10,40,0,20,"Rea");
- private static GuiButton reachLabel2 = new GuiButton(1,25,40,0,20,"ch");
- private static GuiSlider aimSlider = new GuiSlider(0, 60, 60, 125, 20, "", "", 5, 40, 15, false, true);
- private static GuiButton aimToggle = new GuiButton(4, 190, 60, 20, 20, "On");
- private static GuiButton aimLabel1 = new GuiButton(1,10,60,0,20,"Aim");
- private static GuiButton aimLabel2 = new GuiButton(1,27,60,0,20,"Ass");
- private static GuiButton aimLabel3 = new GuiButton(1,43,60,0,20,"ist");
- private static GuiButton aimDist = new GuiButton(1,10,80,0,20,"Dis");
- private static GuiButton aimDist2 = new GuiButton(1,24,80,0,20,"tan");
- private static GuiButton aimDist3 = new GuiButton(1,39,80,0,20,"ce:");
- private static GuiSlider aimDistSlider = new GuiSlider(0, 60, 80, 125, 20, "", "", 40, 70, 50, false, true);
- private static GuiButton showGui = new GuiButton(1,10,100,0,20,"Sho");
- private static GuiButton showGui2 = new GuiButton(1,27,100,0,20,"w G");
- private static GuiButton showGui3 = new GuiButton(1,40,100,0,20,"ui");
- private static GuiButton guiToggle = new GuiButton(4, 140, 100, 20, 20, "On");
- private static GuiButton dest = new GuiButton(1,10,120,0,20,"Des");
- private static GuiButton dest1 = new GuiButton(1,26,120,0,20,"tru");
- private static GuiButton dest2 = new GuiButton(1,41,120,0,20,"ct:");
- private static GuiButton selfDestruct = new GuiButton(4, 140, 120, 20, 20, "Go");
- public static EventManager em;
- public GUI(EventManager em){
- this.em = em;
- }
- @Override
- public void initGui(){
- this.buttonList.add(cpsSlider);
- this.buttonList.add(clickToggle);
- this.buttonList.add(clickLabel);
- this.buttonList.add(velocitySlider);
- this.buttonList.add(velocityToggle);
- this.buttonList.add(velocityLabel);
- this.buttonList.add(reachSlider);
- this.buttonList.add(reachToggle);
- this.buttonList.add(reachLabel1);
- this.buttonList.add(reachLabel2);
- this.buttonList.add(aimLabel1);
- this.buttonList.add(aimLabel2);
- this.buttonList.add(aimLabel3);
- this.buttonList.add(aimSlider);
- this.buttonList.add(aimToggle);
- this.buttonList.add(aimDist);
- this.buttonList.add(aimDist2);
- this.buttonList.add(aimDist3);
- this.buttonList.add(aimDistSlider);
- this.buttonList.add(guiToggle);
- this.buttonList.add(showGui);
- this.buttonList.add(showGui2);
- this.buttonList.add(showGui3);
- this.buttonList.add(dest);
- this.buttonList.add(dest1);
- this.buttonList.add(dest2);
- this.buttonList.add(selfDestruct);
- }
- @Override
- public void drawScreen(int mouseX, int mouseY, float partialTicks){
- this.drawDefaultBackground();
- super.drawScreen(mouseX, mouseX, partialTicks);
- }
- @Override
- public boolean doesGuiPauseGame(){
- return true;
- }
- @Override
- protected void actionPerformed(GuiButton button) {
- if(button == velocityToggle){
- toggleVelocity();
- }
- if(button == clickToggle){
- toggleAutoclicker();
- }
- if(button == reachToggle){
- toggleReach();
- }
- if(button == aimToggle){
- toggleAimAssist();
- }
- if(button == guiToggle){
- if(guiToggle.displayString.equalsIgnoreCase("on")){
- guiToggle.displayString = "Off";
- }else{
- guiToggle.displayString = "On";
- }
- em.toggleOverlay();
- }
- updateValues();
- if(button == selfDestruct){
- em.selfDestruct();
- }
- }
- public static void updateValues() {
- em.getAutoclicker().updateCps();
- em.getReach().updateReach();
- em.getVelocity().updateVelocity();
- em.getAimAssist().updateAimAssist();
- }
- public static double getReach(){
- return reachSlider.getValueInt()/10D;
- }
- public static int getCps(){
- return cpsSlider.getValueInt();
- }
- public static int getVelocity(){
- return velocitySlider.getValueInt();
- }
- public static double getAimAssist(){
- return aimSlider.getValueInt()/10D;
- }
- @Override
- public void onGuiClosed() {
- updateValues();
- super.onGuiClosed();
- }
- public static void toggleVelocity(){
- em.getVelocity().toggle();
- if(velocityToggle.displayString.equalsIgnoreCase("on")){
- velocityToggle.displayString = "Off";
- }else{
- velocityToggle.displayString = "On";
- }
- }
- public static void toggleAutoclicker(){
- if(clickToggle.displayString.equalsIgnoreCase("on")){
- clickToggle.displayString = "Off";
- }else{
- clickToggle.displayString = "On";
- if(Mouse.isButtonDown(0)){
- em.getAutoclicker().reset();
- }
- }
- em.getAutoclicker().toggle();
- }
- public static void toggleReach(){
- if(reachToggle.displayString.equalsIgnoreCase("on")){
- reachToggle.displayString = "Off";
- }else{
- reachToggle.displayString = "On";
- }
- em.getReach().toggle();
- }
- public static void toggleAimAssist(){
- if(aimToggle.displayString.equalsIgnoreCase("on")){
- aimToggle.displayString = "Off";
- }else{
- aimToggle.displayString = "On";
- }
- em.getAimAssist().toggle();
- }
- public static double getDist() {
- return aimDistSlider.getValueInt()/10;
- }
- public static void destroy() {
- if(Minecraft.getMinecraft().currentScreen instanceof GUI){
- Minecraft.getMinecraft().setIngameFocus();
- }
- velocitySlider = null;
- velocityLabel = null;
- velocityToggle = null;
- cpsSlider = null;
- clickLabel = null;
- clickToggle = null;
- reachSlider = null;
- reachLabel1 = null;
- reachLabel2 = null;
- reachToggle = null;
- aimDist = null;
- aimDist3 = null;
- aimDist2 = null;
- aimDistSlider = null;
- aimLabel1 = null;
- aimLabel2 = null;
- aimLabel3 = null;
- aimSlider = null;
- aimToggle = null;
- showGui = null;
- showGui2 = null;
- showGui3 = null;
- guiToggle = null;
- dest = null;
- dest1 = null;
- dest2 = null;
- selfDestruct = null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement