/** the element in the slot that was clicked, boolean for wether it was double clicked or not */
 protected void elementClicked(int par1, boolean par2) {
   StringTranslate.getInstance().setLanguage((String) this.field_77251_g.get(par1), false);
   this.languageGui.mc.fontRenderer.setUnicodeFlag(StringTranslate.getInstance().isUnicode());
   GuiLanguage.getGameSettings(this.languageGui).language = (String) this.field_77251_g.get(par1);
   this.languageGui.fontRenderer.setBidiFlag(
       StringTranslate.isBidirectional(GuiLanguage.getGameSettings(this.languageGui).language));
   GuiLanguage.getDoneButton(this.languageGui).displayString =
       StringTranslate.getInstance().translateKey("gui.done");
   GuiLanguage.getGameSettings(this.languageGui).saveOptions();
 }
 /** Draws the screen and all the components in it. */
 public void drawScreen(int par1, int par2, float par3) {
   StringTranslate var4 = StringTranslate.getInstance();
   this.drawDefaultBackground();
   this.drawCenteredString(
       this.fontRenderer,
       var4.translateKey("mco.configure.world.subscription.title"),
       this.width / 2,
       17,
       16777215);
   this.drawString(
       this.fontRenderer,
       var4.translateKey("mco.configure.world.subscription.start"),
       this.width / 2 - 100,
       53,
       10526880);
   this.drawString(this.fontRenderer, this.field_98069_o, this.width / 2 - 100, 66, 16777215);
   this.drawString(
       this.fontRenderer,
       var4.translateKey("mco.configure.world.subscription.daysleft"),
       this.width / 2 - 100,
       85,
       10526880);
   this.drawString(
       this.fontRenderer, String.valueOf(this.field_98068_n), this.width / 2 - 100, 98, 16777215);
   super.drawScreen(par1, par2, par3);
 }
  public void initGui() {
    StringTranslate stringtranslate = StringTranslate.getInstance();
    field_22107_a = stringtranslate.translateKey("options.videoTitle");
    int i = 0;
    EnumOptions aenumoptions[] = field_22108_k;
    int j = aenumoptions.length;
    for (int k = 0; k < j; k++) {
      EnumOptions enumoptions = aenumoptions[k];
      if (!enumoptions.getEnumFloat()) {
        controlList.add(
            new GuiSmallButton(
                enumoptions.returnEnumOrdinal(),
                (width / 2 - 155) + (i % 2) * 160,
                height / 6 + 24 * (i >> 1),
                enumoptions,
                guiGameSettings.getKeyBinding(enumoptions)));
      } else {
        controlList.add(
            new GuiSlider(
                enumoptions.returnEnumOrdinal(),
                (width / 2 - 155) + (i % 2) * 160,
                height / 6 + 24 * (i >> 1),
                enumoptions,
                guiGameSettings.getKeyBinding(enumoptions),
                guiGameSettings.getOptionFloatValue(enumoptions)));
      }
      i++;
    }

    controlList.add(
        new GuiButton(
            200, width / 2 - 100, height / 6 + 168, stringtranslate.translateKey("gui.done")));
  }
  private static String func_48571_a(String par0ArrayOfStr[], int par1) {
    if (par1 < 0 || par1 >= par0ArrayOfStr.length) {
      par1 = 0;
    }

    StringTranslate stringtranslate = StringTranslate.getInstance();
    return stringtranslate.translateKey(par0ArrayOfStr[par1]);
  }
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   this.func_98063_a(this.field_98065_b.field_96408_a);
   StringTranslate var1 = StringTranslate.getInstance();
   Keyboard.enableRepeatEvents(true);
   this.buttonList.add(
       new GuiButton(
           0, this.width / 2 - 100, this.height / 4 + 120 + 12, var1.translateKey("gui.cancel")));
 }
예제 #6
0
  /**
   * Returns the translation of the given index in the given String array. If the index is smaller
   * than 0 or greater than/equal to the length of the String array, it is changed to 0.
   */
  private static String getTranslation(String[] par0ArrayOfStr, int par1) {
    if (par1 < 0 || par1 >= par0ArrayOfStr.length) {
      par1 = 0;
    }

    StringTranslate var2 = StringTranslate.getInstance();
    return var2.translateKey(par0ArrayOfStr[par1]);
  }
예제 #7
0
 public void initGui() {
   StringTranslate var1 = StringTranslate.getInstance();
   this.controlList.clear();
   this.controlList.add(
       new GuiButton(
           0,
           this.width / 2 - 100,
           this.height / 4 + 120 + 12,
           var1.translateKey("Back to server list"))); // Spout
 }
예제 #8
0
  /** Gets a key binding. */
  public String getKeyBinding(EnumOptions par1EnumOptions) {
    StringTranslate var2 = StringTranslate.getInstance();
    String var3 = var2.translateKey(par1EnumOptions.getEnumString()) + ": ";

    if (par1EnumOptions.getEnumFloat()) {
      float var5 = this.getOptionFloatValue(par1EnumOptions);
      return par1EnumOptions == EnumOptions.SENSITIVITY
          ? (var5 == 0.0F
              ? var3 + var2.translateKey("options.sensitivity.min")
              : (var5 == 1.0F
                  ? var3 + var2.translateKey("options.sensitivity.max")
                  : var3 + (int) (var5 * 200.0F) + "%"))
          : (par1EnumOptions == EnumOptions.FOV
              ? (var5 == 0.0F
                  ? var3 + var2.translateKey("options.fov.min")
                  : (var5 == 1.0F
                      ? var3 + var2.translateKey("options.fov.max")
                      : var3 + (int) (70.0F + var5 * 40.0F)))
              : (par1EnumOptions == EnumOptions.GAMMA
                  ? (var5 == 0.0F
                      ? var3 + var2.translateKey("options.gamma.min")
                      : (var5 == 1.0F
                          ? var3 + var2.translateKey("options.gamma.max")
                          : var3 + "+" + (int) (var5 * 100.0F) + "%"))
                  : (par1EnumOptions == EnumOptions.CHAT_OPACITY
                      ? var3 + (int) (var5 * 90.0F + 10.0F) + "%"
                      : (var5 == 0.0F
                          ? var3 + var2.translateKey("options.off")
                          : var3 + (int) (var5 * 100.0F) + "%"))));
    } else if (par1EnumOptions.getEnumBoolean()) {
      boolean var4 = this.getOptionOrdinalValue(par1EnumOptions);
      return var4
          ? var3 + var2.translateKey("options.on")
          : var3 + var2.translateKey("options.off");
    } else {
      return par1EnumOptions == EnumOptions.RENDER_DISTANCE
          ? var3 + getTranslation(RENDER_DISTANCES, this.renderDistance)
          : (par1EnumOptions == EnumOptions.DIFFICULTY
              ? var3 + getTranslation(DIFFICULTIES, this.difficulty)
              : (par1EnumOptions == EnumOptions.GUI_SCALE
                  ? var3 + getTranslation(GUISCALES, this.guiScale)
                  : (par1EnumOptions == EnumOptions.CHAT_VISIBILITY
                      ? var3 + getTranslation(CHAT_VISIBILITIES, this.chatVisibility)
                      : (par1EnumOptions == EnumOptions.PARTICLES
                          ? var3 + getTranslation(PARTICLES, this.particleSetting)
                          : (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT
                              ? var3 + getTranslation(LIMIT_FRAMERATES, this.limitFramerate)
                              : (par1EnumOptions == EnumOptions.GRAPHICS
                                  ? (this.fancyGraphics
                                      ? var3 + var2.translateKey("options.graphics.fancy")
                                      : var3 + var2.translateKey("options.graphics.fast"))
                                  : var3))))));
    }
  }
예제 #9
0
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   StringTranslate stringtranslate = StringTranslate.getInstance();
   screenTitle = stringtranslate.translateKey("selectWorld.title");
   localizedWorldText = stringtranslate.translateKey("selectWorld.world");
   localizedMustConvertText = stringtranslate.translateKey("selectWorld.conversion");
   localizedGameModeText[0] = stringtranslate.translateKey("gameMode.survival");
   localizedGameModeText[1] = stringtranslate.translateKey("gameMode.creative");
   loadSaves();
   worldSlotContainer = new GuiWorldSlot(this);
   worldSlotContainer.registerScrollButtons(controlList, 4, 5);
   initButtons();
 }
예제 #10
0
 public void initGui() {
   synchronized (serverInfo) {
     this.serverInfo.status = "Done";
   }
   StringTranslate var1 = StringTranslate.getInstance();
   this.screenTitle = var1.translateKey("Select server");
   this.field_22098_o = var1.translateKey("Unknown");
   this.field_22097_p = var1.translateKey("aaa");
   this.loadSaves();
   this.worldSlotContainer = new GuiServerSlot(this);
   this.worldSlotContainer.registerScrollButtons(this.controlList, 4, 5);
   this.initButtons();
 }
예제 #11
0
  public GuiConnectFailed(String var1, String var2, Object... var3) {
    StringTranslate var4 = StringTranslate.getInstance();
    this.errorMessage = var4.translateKey(var1);
    if (var3 != null) {
      this.errorDetail = var4.translateKeyFormat(var2, var3);
    } else {
      this.errorDetail = var4.translateKey(var2);
    }

    // Spout Start
    ReconnectManager.detectKick(var1, var2, var3);
    // Spout End
  }
예제 #12
0
  /** returns the name of the saved game */
  protected String getSaveName(int par1) {
    String s = ((SaveFormatComparator) saveList.get(par1)).getDisplayName();

    if (s == null || MathHelper.stringNullOrLengthZero(s)) {
      StringTranslate stringtranslate = StringTranslate.getInstance();
      s =
          (new StringBuilder())
              .append(stringtranslate.translateKey("selectWorld.world"))
              .append(" ")
              .append(par1 + 1)
              .toString();
    }

    return s;
  }
예제 #13
0
 public void initGui() {
   StringTranslate stringtranslate = StringTranslate.getInstance();
   controlList.add(
       new GuiSmallButton(
           5,
           width / 2 - 154,
           height - 48,
           stringtranslate.translateKey("texturePack.openFolder")));
   controlList.add(
       new GuiSmallButton(
           6, width / 2 + 4, height - 48, stringtranslate.translateKey("gui.done")));
   mc.texturePackList.updateAvaliableTexturePacks();
   fileLocation = (new File(Minecraft.getMinecraftDir(), "texturepacks")).getAbsolutePath();
   guiTexturePackSlot = new GuiTexturePackSlot(this);
   guiTexturePackSlot.registerScrollButtons(controlList, 7, 8);
 }
  @Override

  /** Adds the buttons (and other controls) to the screen in question. */
  public void initGui() {
    for (ModContainer mod : mods) {
      listWidth = Math.max(listWidth, getFontRenderer().getStringWidth(mod.getName()) + 10);
      listWidth = Math.max(listWidth, getFontRenderer().getStringWidth(mod.getVersion()) + 10);
    }
    listWidth = Math.min(listWidth, 150);
    StringTranslate translations = StringTranslate.getInstance();
    this.controlList.add(
        new GuiSmallButton(
            6, this.width / 2 - 75, this.height - 38, translations.translateKey("gui.done")));
    this.modList = new GuiSlotModList(this, mods, listWidth);
    this.modList.registerScrollButtons(this.controlList, 7, 8);
  }
예제 #15
0
 public void drawScreen(int i, int j, float f) {
   guiTexturePackSlot.drawScreen(i, j, f);
   if (field_6454_o <= 0) {
     mc.texturePackList.updateAvaliableTexturePacks();
     field_6454_o += 20;
   }
   StringTranslate stringtranslate = StringTranslate.getInstance();
   drawCenteredString(
       fontRenderer, stringtranslate.translateKey("texturePack.title"), width / 2, 16, 0xffffff);
   drawCenteredString(
       fontRenderer,
       stringtranslate.translateKey("texturePack.folderInfo"),
       width / 2 - 77,
       height - 26,
       0x808080);
   super.drawScreen(i, j, f);
 }
예제 #16
0
  /** Adds the buttons (and other controls) to the screen in question. */
  public void initGui() {
    this.viewportTexture =
        this.mc.renderEngine.allocateAndSetupTexture(new BufferedImage(256, 256, 2));
    Calendar var1 = Calendar.getInstance();
    var1.setTime(new Date());

    if (var1.get(2) + 1 == 11 && var1.get(5) == 9) {
      this.splashText = "Happy birthday, ez!";
    } else if (var1.get(2) + 1 == 6 && var1.get(5) == 1) {
      this.splashText = "Happy birthday, Notch!";
    } else if (var1.get(2) + 1 == 12 && var1.get(5) == 24) {
      this.splashText = "Merry X-mas!";
    } else if (var1.get(2) + 1 == 1 && var1.get(5) == 1) {
      this.splashText = "Happy new year!";
    }

    StringTranslate var2 = StringTranslate.getInstance();
    int var4 = this.height / 4 + 48;
    this.controlList.add(
        new GuiButton(1, this.width / 2 - 100, var4, var2.translateKey("menu.singleplayer")));
    this.controlList.add(
        this.multiplayerButton =
            new GuiButton(
                2, this.width / 2 - 100, var4 + 24, var2.translateKey("menu.multiplayer")));
    this.controlList.add(
        new GuiButton(3, this.width / 2 - 100, var4 + 48, var2.translateKey("menu.mods")));

    if (this.mc.hideQuitButton) {
      this.controlList.add(
          new GuiButton(0, this.width / 2 - 100, var4 + 72, var2.translateKey("menu.options")));
    } else {
      this.controlList.add(
          new GuiButton(
              0, this.width / 2 - 100, var4 + 72 + 12, 98, 20, var2.translateKey("menu.options")));
      this.controlList.add(
          new GuiButton(
              4, this.width / 2 + 2, var4 + 72 + 12, 98, 20, var2.translateKey("menu.quit")));
    }

    this.controlList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var4 + 72 + 12));

    if (this.mc.session == null) {
      this.multiplayerButton.enabled = false;
    }
  }
예제 #17
0
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   StringTranslate var1 = StringTranslate.getInstance();
   this.buttonList.add(
       new GuiFancyButton(
           5,
           this.width / 2 - 74,
           this.height - 48,
           var1.translateKey("texturePack.openFolder"),
           3));
   this.buttonList.add(
       new GuiFancyButton(
           6, this.width / 2 + 74, this.height - 48, var1.translateKey("gui.done"), 3));
   this.mc.texturePackList.updateAvaliableTexturePacks();
   this.fileLocation = (new File(Minecraft.getMinecraftDir(), "texturepacks")).getAbsolutePath();
   this.guiTexturePackSlot = new GuiFancyTexturePackSlot(this);
   this.guiTexturePackSlot.registerScrollButtons(this.buttonList, 7, 8);
   bg = new GuiFancyRotatingBackground(mc, width, height, zLevel);
 }
예제 #18
0
 /** Draws the screen and all the components in it. */
 public void drawScreen(int par1, int par2, float par3) {
   StringTranslate var4 = StringTranslate.getInstance();
   this.drawDefaultBackground();
   this.drawCenteredString(
       this.fontRenderer,
       var4.translateKey("selectServer.direct"),
       this.width / 2,
       this.height / 4 - 60 + 20,
       16777215);
   this.drawString(
       this.fontRenderer,
       var4.translateKey("addServer.enterIp"),
       this.width / 2 - 100,
       100,
       10526880);
   this.serverTextField.drawTextBox();
   super.drawScreen(par1, par2, par3);
 }
  public GuiSlotLanguage(GuiLanguage par1GuiLanguage) {
    super(
        par1GuiLanguage.mc,
        par1GuiLanguage.width,
        par1GuiLanguage.height,
        32,
        par1GuiLanguage.height - 65 + 4,
        18);
    this.languageGui = par1GuiLanguage;
    this.field_77253_h = StringTranslate.getInstance().getLanguageList();
    this.field_77251_g = new ArrayList();
    Iterator var2 = this.field_77253_h.keySet().iterator();

    while (var2.hasNext()) {
      String var3 = (String) var2.next();
      this.field_77251_g.add(var3);
    }
  }
예제 #20
0
 /** intilize the buttons for this GUI */
 public void initButtons() {
   StringTranslate stringtranslate = StringTranslate.getInstance();
   controlList.add(
       buttonSelect =
           new GuiButton(
               1,
               width / 2 - 154,
               height - 52,
               150,
               20,
               stringtranslate.translateKey("selectWorld.select")));
   controlList.add(
       buttonDelete =
           new GuiButton(
               6,
               width / 2 - 154,
               height - 28,
               70,
               20,
               stringtranslate.translateKey("selectWorld.rename")));
   controlList.add(
       buttonRename =
           new GuiButton(
               2,
               width / 2 - 74,
               height - 28,
               70,
               20,
               stringtranslate.translateKey("selectWorld.delete")));
   controlList.add(
       new GuiButton(
           3,
           width / 2 + 4,
           height - 52,
           150,
           20,
           stringtranslate.translateKey("selectWorld.create")));
   controlList.add(
       new GuiButton(
           0, width / 2 + 4, height - 28, 150, 20, stringtranslate.translateKey("gui.cancel")));
   buttonSelect.enabled = false;
   buttonRename.enabled = false;
   buttonDelete.enabled = false;
 }
예제 #21
0
  public void initGui() {
    StringTranslate stringtranslate = StringTranslate.getInstance();
    int i = func_20080_j();
    for (int j = 0; j < options.keyBindings.length; j++) {
      controlList.add(
          new GuiSmallButton(
              j,
              i + (j % 2) * 160,
              height / 6 + 24 * (j >> 1),
              70,
              20,
              options.getOptionDisplayString(j)));
    }

    controlList.add(
        new GuiButton(
            200, width / 2 - 100, height / 6 + 168, stringtranslate.translateKey("gui.done")));
    screenTitle = stringtranslate.translateKey("controls.title");
  }
  /** Creates the buttons that appear at the top of the Stats GUI. */
  public void addHeaderButtons() {
    StringTranslate stringtranslate = StringTranslate.getInstance();
    controlList.add(
        new GuiButton(
            0, width / 2 + 4, height - 28, 150, 20, stringtranslate.translateKey("gui.done")));
    controlList.add(
        new GuiButton(
            1,
            width / 2 - 154,
            height - 52,
            100,
            20,
            stringtranslate.translateKey("stat.generalButton")));
    GuiButton guibutton;
    controlList.add(
        guibutton =
            new GuiButton(
                2,
                width / 2 - 46,
                height - 52,
                100,
                20,
                stringtranslate.translateKey("stat.blocksButton")));
    GuiButton guibutton1;
    controlList.add(
        guibutton1 =
            new GuiButton(
                3,
                width / 2 + 62,
                height - 52,
                100,
                20,
                stringtranslate.translateKey("stat.itemsButton")));

    if (slotBlock.getSize() == 0) {
      guibutton.enabled = false;
    }

    if (slotItem.getSize() == 0) {
      guibutton1.enabled = false;
    }
  }
예제 #23
0
  /** Draws the screen and all the components in it. */
  public void drawScreen(int par1, int par2, float par3) {
    bg.RenderBackground(par1, par2, par3);
    this.guiTexturePackSlot.drawScreen(par1, par2, par3);

    if (this.refreshTimer <= 0) {
      this.mc.texturePackList.updateAvaliableTexturePacks();
      this.refreshTimer += 20;
    }

    StringTranslate var4 = StringTranslate.getInstance();
    this.drawCenteredString(
        this.fontRenderer, var4.translateKey("texturePack.title"), this.width / 2, 16, 16777215);
    this.drawCenteredString(
        this.fontRenderer,
        var4.translateKey("texturePack.folderInfo"),
        this.width / 2 - 77,
        this.height - 26,
        8421504);
    super.drawScreen(par1, par2, par3);
  }
예제 #24
0
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   StringTranslate var1 = StringTranslate.getInstance();
   Keyboard.enableRepeatEvents(true);
   this.controlList.clear();
   this.controlList.add(
       new GuiButton(
           0,
           this.width / 2 - 100,
           this.height / 4 + 96 + 12,
           var1.translateKey("selectServer.select")));
   this.controlList.add(
       new GuiButton(
           1, this.width / 2 - 100, this.height / 4 + 120 + 12, var1.translateKey("gui.cancel")));
   this.serverTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 116, 200, 20);
   this.serverTextField.setMaxStringLength(128);
   this.serverTextField.setFocused(true);
   this.serverTextField.setText(lastServerName);
   ((GuiButton) this.controlList.get(0)).enabled =
       this.serverTextField.getText().length() > 0
           && this.serverTextField.getText().split(":").length > 0;
 }
  /** Adds the buttons (and other controls) to the screen in question. */
  public void initGui() {
    this.viewportTexture =
        this.mc.renderEngine.allocateAndSetupTexture(new BufferedImage(256, 256, 2));
    Calendar var1 = Calendar.getInstance();
    var1.setTime(new Date());

    if (var1.get(2) + 1 == 11 && var1.get(5) == 9) {
      this.splashText = "Happy birthday, ez!";
    } else if (var1.get(2) + 1 == 6 && var1.get(5) == 1) {
      this.splashText = "Happy birthday, Notch!";
    } else if (var1.get(2) + 1 == 12 && var1.get(5) == 24) {
      this.splashText = "Merry X-mas!";
    } else if (var1.get(2) + 1 == 1 && var1.get(5) == 1) {
      this.splashText = "Happy new year!";
    }

    StringTranslate var2 = StringTranslate.getInstance();
    int var4 = this.height / 4 + 48;

    if (this.mc.isDemo()) {
      this.func_73972_b(var4, 24, var2);
    } else {
      this.func_73969_a(var4, 24, var2);
    }

    if (this.mc.hideQuitButton) {
      this.controlList.add(
          new GuiButton(0, this.width / 2 - 100, var4 + 24, var2.translateKey("menu.options")));
    } else {
      this.controlList.add(
          new GuiButton(
              0, this.width / 2 - 100, var4 + 24 + 12, 98, 20, var2.translateKey("menu.options")));
      this.controlList.add(
          new GuiButton(
              4, this.width / 2 + 2, var4 + 24 + 12, 98, 20, var2.translateKey("menu.quit")));
    }

    this.controlList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var4 + 24 + 12));
  }
예제 #26
0
  /**
   * Fired when a control is clicked. This is the equivalent of
   * ActionListener.actionPerformed(ActionEvent e).
   */
  protected void actionPerformed(GuiButton par1GuiButton) {
    if (!par1GuiButton.enabled) {
      return;
    }

    if (par1GuiButton.id == 2) {
      String s = getSaveName(selectedWorld);

      if (s != null) {
        deleting = true;
        StringTranslate stringtranslate = StringTranslate.getInstance();
        String s1 = stringtranslate.translateKey("selectWorld.deleteQuestion");
        String s2 =
            (new StringBuilder())
                .append("'")
                .append(s)
                .append("' ")
                .append(stringtranslate.translateKey("selectWorld.deleteWarning"))
                .toString();
        String s3 = stringtranslate.translateKey("selectWorld.deleteButton");
        String s4 = stringtranslate.translateKey("gui.cancel");
        GuiYesNo guiyesno = new GuiYesNo(this, s1, s2, s3, s4, selectedWorld);
        mc.displayGuiScreen(guiyesno);
      }
    } else if (par1GuiButton.id == 1) {
      selectWorld(selectedWorld);
    } else if (par1GuiButton.id == 3) {
      mc.displayGuiScreen(new GuiCreateWorld(this));
    } else if (par1GuiButton.id == 6) {
      mc.displayGuiScreen(new GuiRenameWorld(this, getSaveFileName(selectedWorld)));
    } else if (par1GuiButton.id == 0) {
      mc.displayGuiScreen(parentScreen);
    } else {
      worldSlotContainer.actionPerformed(par1GuiButton);
    }
  }
예제 #27
0
  /** Adds the buttons (and other controls) to the screen in question. */
  public void initGui() {
    StringTranslate var1 = StringTranslate.getInstance();
    int var2 = 0;
    this.field_73888_d = var1.translateKey("options.chat.title");
    EnumOptions[] var3 = field_73891_a;
    int var4 = var3.length;

    for (int var5 = 0; var5 < var4; ++var5) {
      EnumOptions var6 = var3[var5];

      if (var6.getEnumFloat()) {
        this.controlList.add(
            new GuiSlider(
                var6.returnEnumOrdinal(),
                this.width / 2 - 155 + var2 % 2 * 160,
                this.height / 6 + 24 * (var2 >> 1),
                var6,
                this.field_73890_c.getKeyBinding(var6),
                this.field_73890_c.getOptionFloatValue(var6)));
      } else {
        this.controlList.add(
            new GuiSmallButton(
                var6.returnEnumOrdinal(),
                this.width / 2 - 155 + var2 % 2 * 160,
                this.height / 6 + 24 * (var2 >> 1),
                var6,
                this.field_73890_c.getKeyBinding(var6)));
      }

      ++var2;
    }

    this.controlList.add(
        new GuiButton(
            200, this.width / 2 - 100, this.height / 6 + 168, var1.translateKey("gui.done")));
  }
예제 #28
0
  @Override
  public void initGui() {
    mods = UpdateManager.sortMods(UpdateManager.loadedModsSet, UpdateManager.loadedModsMap);
    for (UpdateManagerMod mod : mods)
      listWidth = Math.max(listWidth, fontRenderer.getStringWidth(mod.getModName()) + 20);
    StringTranslate.getInstance();
    int shiftx = 10;
    int shifty = 40;

    controlList.add(
        new GuiButton(0, shiftx, height - 30, fontRenderer.getStringWidth("Back") + 8, 20, "Back"));
    shiftx += fontRenderer.getStringWidth("Back") + 12;
    controlList.add(
        new GuiButton(
            1,
            shiftx,
            height - 30,
            fontRenderer.getStringWidth("Update Manager Forum Topic") + 8,
            20,
            "Update Manager Forum Topic"));
    shiftx += fontRenderer.getStringWidth("Update Manager Forum Topic") + 12;
    controlList.add(
        new GuiButton(2, shiftx, height - 30, fontRenderer.getStringWidth("MotW") + 8, 20, "MotW"));
    shiftx += fontRenderer.getStringWidth("MotW") + 12;
    controlList.add(
        new GuiButton(
            3, shiftx, height - 30, fontRenderer.getStringWidth("Settings") + 8, 20, "Settings"));
    shiftx += fontRenderer.getStringWidth("Settings") + 12;
    controlList.add(
        new GuiButton(
            4,
            width - fontRenderer.getStringWidth("Website") - 12,
            shifty,
            fontRenderer.getStringWidth("Website") + 8,
            20,
            "Website"));
    shifty += 22;
    controlList.add(
        new GuiButton(
            5,
            width - fontRenderer.getStringWidth("Changelog") - 12,
            shifty,
            fontRenderer.getStringWidth("Changelog") + 8,
            20,
            "Changelog"));
    shifty += 22;
    controlList.add(
        new GuiButton(
            6,
            width - fontRenderer.getStringWidth("Download") - 12,
            shifty,
            fontRenderer.getStringWidth("Download") + 8,
            20,
            "Download"));
    controlList.add(
        new GuiButton(
            7,
            shiftx,
            height - 30,
            fontRenderer.getStringWidth("View Downloaded Mods") + 8,
            20,
            "View Downloaded Mods"));
    for (int i = UpdateManager.online ? 4 : 1; i <= 6; i++)
      ((GuiButton) controlList.get(i)).enabled = i == 3;

    if (selected >= 0) selectModIndex(selected);

    modList = new GuiUMModSlot(this, listWidth);
    modList.registerScrollButtons(controlList, 7, 8);
  }
 /** returns true if the element passed in is currently selected */
 protected boolean isSelected(int par1) {
   return ((String) this.field_77251_g.get(par1))
       .equals(StringTranslate.getInstance().getCurrentLanguage());
 }
예제 #30
0
 public void addChatMessageTranslate(String var1) {
   StringTranslate var2 = StringTranslate.getInstance();
   String var3 = var2.translateKey(var1);
   this.addChatMessage(var3);
 }