コード例 #1
0
  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]);
  }
コード例 #2
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);
 }
コード例 #3
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);
  }
コード例 #4
0
  /** Gets a key binding. */
  public String getKeyBinding(EnumOptions par1EnumOptions) {
    StringTranslate stringtranslate = StringTranslate.getInstance();
    String s =
        (new StringBuilder())
            .append(stringtranslate.translateKey(par1EnumOptions.getEnumString()))
            .append(": ")
            .toString();

    if (par1EnumOptions.getEnumFloat()) {
      float f = getOptionFloatValue(par1EnumOptions);

      if (par1EnumOptions == EnumOptions.SENSITIVITY) {
        if (f == 0.0F) {
          return (new StringBuilder())
              .append(s)
              .append(stringtranslate.translateKey("options.sensitivity.min"))
              .toString();
        }

        if (f == 1.0F) {
          return (new StringBuilder())
              .append(s)
              .append(stringtranslate.translateKey("options.sensitivity.max"))
              .toString();
        } else {
          return (new StringBuilder()).append(s).append((int) (f * 200F)).append("%").toString();
        }
      }

      if (par1EnumOptions == EnumOptions.FOV) {
        if (f == 0.0F) {
          return (new StringBuilder())
              .append(s)
              .append(stringtranslate.translateKey("options.fov.min"))
              .toString();
        }

        if (f == 1.0F) {
          return (new StringBuilder())
              .append(s)
              .append(stringtranslate.translateKey("options.fov.max"))
              .toString();
        } else {
          return (new StringBuilder()).append(s).append((int) (70F + f * 40F)).toString();
        }
      }

      if (par1EnumOptions == EnumOptions.GAMMA) {
        if (f == 0.0F) {
          return (new StringBuilder())
              .append(s)
              .append(stringtranslate.translateKey("options.gamma.min"))
              .toString();
        }

        if (f == 1.0F) {
          return (new StringBuilder())
              .append(s)
              .append(stringtranslate.translateKey("options.gamma.max"))
              .toString();
        } else {
          return (new StringBuilder())
              .append(s)
              .append("+")
              .append((int) (f * 100F))
              .append("%")
              .toString();
        }
      }

      if (f == 0.0F) {
        return (new StringBuilder())
            .append(s)
            .append(stringtranslate.translateKey("options.off"))
            .toString();
      } else {
        return (new StringBuilder()).append(s).append((int) (f * 100F)).append("%").toString();
      }
    }

    if (par1EnumOptions.getEnumBoolean()) {
      boolean flag = getOptionOrdinalValue(par1EnumOptions);

      if (flag) {
        return (new StringBuilder())
            .append(s)
            .append(stringtranslate.translateKey("options.on"))
            .toString();
      } else {
        return (new StringBuilder())
            .append(s)
            .append(stringtranslate.translateKey("options.off"))
            .toString();
      }
    }

    if (par1EnumOptions == EnumOptions.RENDER_DISTANCE) {
      return (new StringBuilder())
          .append(s)
          .append(func_48571_a(RENDER_DISTANCES, renderDistance))
          .toString();
    }

    if (par1EnumOptions == EnumOptions.DIFFICULTY) {
      return (new StringBuilder())
          .append(s)
          .append(func_48571_a(DIFFICULTIES, difficulty))
          .toString();
    }

    if (par1EnumOptions == EnumOptions.GUI_SCALE) {
      return (new StringBuilder()).append(s).append(func_48571_a(GUISCALES, guiScale)).toString();
    }

    if (par1EnumOptions == EnumOptions.PARTICLES) {
      return (new StringBuilder())
          .append(s)
          .append(func_48571_a(PARTICLES, particleSetting))
          .toString();
    }

    if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT) {
      return (new StringBuilder())
          .append(s)
          .append(func_48571_a(LIMIT_FRAMERATES, limitFramerate))
          .toString();
    }

    if (par1EnumOptions == EnumOptions.GRAPHICS) {
      if (fancyGraphics) {
        return (new StringBuilder())
            .append(s)
            .append(stringtranslate.translateKey("options.graphics.fancy"))
            .toString();
      } else {
        return (new StringBuilder())
            .append(s)
            .append(stringtranslate.translateKey("options.graphics.fast"))
            .toString();
      }
    } else {
      return s;
    }
  }
コード例 #5
0
 public String getKeyBindingDescription(int par1) {
   StringTranslate stringtranslate = StringTranslate.getInstance();
   return stringtranslate.translateKey(keyBindings[par1].keyDescription);
 }