@Override
  public void drawScreen(int x, int y, float par3) {
    if (!isActive) {
      super.drawScreen(x, y, par3);

      if (isPointInRegion(7, 46, 162, 18, x, y)) {
        List<String> str = new ArrayList<String>();
        str.add(
            portalModifier.upgradeHandler.hasUpgrade(new UpgradeDialDevice())
                ? Strings.UniqueIdentifier.toString()
                : Strings.Network.toString());
        str.add(
            EnumChatFormatting.GRAY
                + (portalModifier.upgradeHandler.hasUpgrade(new UpgradeDialDevice())
                    ? Strings.ClickToSetIdentifier.toString()
                    : Strings.ClickToSetNetwork.toString()));
        drawText(str, x, y);
      }
    } else {
      drawDefaultBackground();
      fontRenderer.drawString(
          Strings.ModifierActive.toString(),
          width / 2 - fontRenderer.getStringWidth(Strings.ModifierActive.toString()) / 2,
          guiTop,
          0xFFFFFF);
      okayButton.drawButton(mc, 0, 0);
    }
  }
예제 #2
0
  public void draw(int mx, int my) {
    // GL11.glBindTexture(GL11.GL_TEXTURE_2D,
    // mc.renderEngine.getTexture("/nbtedit_textures/nbteditwindow.png"));
    mc.renderEngine.bindTexture(WINDOW_TEXTURE);

    GL11.glColor4f(1, 1, 1, 1);
    drawTexturedModalRect(x, y, 0, 0, WIDTH, HEIGHT);
    if (!canEditText) drawRect(x + 42, y + 15, x + 169, y + 31, 0x80000000);
    if (!canEditValue) drawRect(x + 42, y + 41, x + 169, y + 57, 0x80000000);
    key.drawTextBox();
    value.drawTextBox();

    save.drawButton(mc, mx, my);
    cancel.drawButton(mc, mx, my);

    if (kError != null)
      drawCenteredString(mc.fontRendererObj, kError, x + WIDTH / 2, y + 4, 0xFF0000);
    if (vError != null)
      drawCenteredString(mc.fontRendererObj, vError, x + WIDTH / 2, y + 32, 0xFF0000);

    newLine.draw(mx, my);
    section.draw(mx, my);
  }
예제 #3
0
 private void switchTab(int newTab) {
   GuiButton button;
   for (int i = 0; i < this.buttonList.size(); i++) {
     button = (GuiButton) this.buttonList.get(i);
     if (button.id != 000
         && button.id != 100
         && button.id != 200
         && button.id != 300
         && button.id != 400
         && button.id != 999) // Make sure we're not removing an important button.
     {
       if ((button.id / 100.00F) > (newTab + 0.99F) || (button.id / 100.00F) < (newTab - 0.01F)) {
         button.drawButton = false;
       } else {
         button.drawButton = true;
       }
     }
     if (button.id == (newTab * 100)) {
       button.enabled = false;
     } else {
       button.enabled = true;
     }
   }
 }
  @SuppressWarnings("unchecked")
  @Override
  public void initGui() {
    super.initGui();

    okayButton =
        new GuiButton(100, width / 2 - 50, height / 2 - 10, 100, 20, Strings.Accept.toString());
    buttonList.add(okayButton);
    okayButton.drawButton = isActive;

    List<String> strList = new ArrayList<String>();
    strList.add(Strings.RedstoneControl.toString());
    strList.add(EnumChatFormatting.GRAY + Strings.Normal.toString());
    buttonList.add(
        new GuiItemStackButton(
            10,
            guiLeft + xSize + 4,
            guiTop + 4,
            new ItemStack(Block.torchRedstoneActive),
            portalModifier.redstoneSetting == 0,
            strList,
            false,
            !portalModifier.upgradeHandler.hasUpgrade(new UpgradeDialDevice())));

    strList = new ArrayList<String>();
    strList.add(Strings.RedstoneControl.toString());
    strList.add(EnumChatFormatting.GRAY + Strings.Inverted.toString());
    buttonList.add(
        new GuiItemStackButton(
            11,
            guiLeft + xSize + 4,
            guiTop + 24,
            new ItemStack(Block.torchRedstoneIdle),
            portalModifier.redstoneSetting == 1,
            strList,
            false,
            !portalModifier.upgradeHandler.hasUpgrade(new UpgradeDialDevice())));

    strList = new ArrayList<String>();
    strList.add(Strings.RedstoneControl.toString());
    strList.add(EnumChatFormatting.GRAY + Strings.Precise.toString());
    buttonList.add(
        new GuiItemStackButton(
            12,
            guiLeft + xSize + 4,
            guiTop + 44,
            new ItemStack(Item.redstone),
            portalModifier.redstoneSetting > 1,
            strList,
            "" + (portalModifier.redstoneSetting > 2 ? portalModifier.redstoneSetting - 2 : 0),
            !portalModifier.upgradeHandler.hasUpgrade(new UpgradeDialDevice())));

    strList = new ArrayList<String>();
    strList.add(Strings.RedstoneControl.toString());
    strList.add(EnumChatFormatting.GRAY + Strings.Disabled.toString());
    buttonList.add(
        new GuiItemStackButton(
            14,
            guiLeft + xSize + 4,
            guiTop + 64,
            new ItemStack(Item.gunpowder),
            portalModifier.redstoneSetting == -1
                || portalModifier.upgradeHandler.hasUpgrade(new UpgradeDialDevice()),
            strList,
            false,
            true));

    strList = new ArrayList<String>();
    strList.add(Strings.Thickness.toString());
    strList.add("");
    buttonList.add(
        new GuiItemStackButton(
            13,
            guiLeft + xSize - 42,
            guiTop + 15,
            new ItemStack(Block.portal),
            true,
            strList,
            true));
    ((GuiItemStackButton) buttonList.get(5)).displayString = "" + (portalModifier.thickness + 1);
    ((GuiItemStackButton) buttonList.get(5))
        .hoverText.set(
            1,
            EnumChatFormatting.GRAY
                + (portalModifier.thickness == 0
                    ? Strings.Normal.toString()
                    : portalModifier.thickness == 1
                        ? Strings.Thick.toString()
                        : portalModifier.thickness == 2
                            ? Strings.Thicker.toString()
                            : Strings.FullBlock.toString()));

    for (int i = portalModifier.upgradeHandler.getUpgrades().size() - 1; i >= 0; i--) {
      buttonList.add(
          new GuiItemStackButton(
              50,
              guiLeft + 8 + i * 18,
              guiTop + 15,
              portalModifier.upgradeHandler.getUpgrade(i).getDisplayItemStack(),
              false,
              portalModifier.upgradeHandler.getUpgrade(i).getText(true),
              true));
    }
  }
예제 #5
0
  @Override
  public void drawScreen(int par1, int par2, float par3) {
    this.mc.func_110434_K().func_110577_a(texture);

    int var4 = this.guiLeft;
    int var5 = this.guiTop;

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    int l = (width - xSize) / 2;
    int i1 = (height - ySize) / 2;
    drawTexturedModalRect(l, i1, 0, 0, xSize, ySize);

    drawCenteredString(
        fontRenderer, StringUtil.localize("gui.Calendar.Calendar"), l + 87, i1 + 16, 0xFFFFFF);
    drawCenteredString(
        fontRenderer,
        StringUtil.localize("gui.Calendar.Season") + " : " + TFC_Time.seasons[TFC_Time.getMonth()],
        l + 87,
        i1 + 26,
        0x000000);

    drawCenteredString(
        fontRenderer,
        StringUtil.localize("gui.Calendar.Day") + " : " + TFC_Time.Days[TFC_Time.getDayOfWeek()],
        l + 87,
        i1 + 36,
        0x000000);
    int dom = TFC_Time.getDayOfMonth();
    int month = TFC_Time.currentMonth;

    if (dom == 7 && month == 4) {
      drawCenteredString(
          fontRenderer,
          StringUtil.localize("gui.Calendar.DateBioxx") + ", " + (1000 + TFC_Time.getYear()),
          l + 87,
          i1 + 46,
          0x000000);
    } else {
      drawCenteredString(
          fontRenderer,
          StringUtil.localize("gui.Calendar.Date")
              + " : "
              + dom
              + " "
              + TFC_Time.months[month]
              + ", "
              + (1000 + TFC_Time.getYear()),
          l + 87,
          i1 + 46,
          0x000000);
    }

    float temp =
        Math.round(
            (TFC_Climate.getHeightAdjustedTemp(
                (int) player.posX, (int) player.posY, (int) player.posZ)));

    // drawCenteredString(fontRenderer,"Temperature : " + (int)temp + "C", l + 87, i1+56, 0x000000);
    // drawCenteredString(fontRenderer,"Month : " + , l + 87, i1+36, 0x000000);

    long h = TFC_Time.getHour();
    String hour = "";
    if (h == 0) {
      hour = StringUtil.localize("gui.Calendar.WitchHour");
    } else {
      hour += h;
    }
    drawCenteredString(
        fontRenderer,
        StringUtil.localize("gui.Calendar.Hour") + " : " + hour,
        l + 87,
        i1 + 56,
        0x000000);
    // drawCenteredString(fontRenderer,"EVT : " +
    // ((TFCWorldChunkManager)world.provider.worldChunkMgr).getEVTLayerAt((int) player.posX, (int)
    // player.posZ).floatdata1, l + 87, i1+76, 0x000000);

    // int rain = (int) TFC_Climate.getRainfall((int) player.posX,(int) player.posY, (int)
    // player.posZ);
    // drawCenteredString(fontRenderer,"Rain : " + rain, l + 87, i1+86, 0x000000);

    for (int var6 = 0; var6 < this.buttonList.size(); ++var6) {
      GuiButton var7 = (GuiButton) this.buttonList.get(var6);
      var7.drawButton(this.mc, par1, par2);
    }
  }
예제 #6
0
  @Override
  public void drawScreen(int par1, int par2, float par3) {
    drawDefaultBackground();

    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc
        .getTextureManager()
        .bindTexture(us.ichun.mods.hats.client.gui.GuiHatSelection.texChooser);
    int k = this.guiLeft;
    int l = this.guiTop;
    this.drawTexturedModalRect(k, l, 0, 0, xSize, ySize);

    this.mc.getTextureManager().bindTexture(us.ichun.mods.hats.client.gui.GuiHatSelection.texIcons);

    for (int k1 = 0; k1 < this.buttonList.size(); ++k1) {
      GuiButton btn = (GuiButton) this.buttonList.get(k1);

      String disp = btn.displayString;

      if (btn.id >= ID_HAT_START_ID) {
        int id = btn.id - ID_HAT_START_ID;
        if (!((pageNumber) * 6 <= id && (pageNumber + 1) * 6 > id)) {
          continue;
        }

        if (btn.displayString.length() > 16) {
          btn.displayString = btn.displayString.substring(0, 13) + "...";
        }
      }
      btn.drawButton(this.mc, par1, par2);

      if (!(btn instanceof GuiSlider)) {
        btn.displayString = disp;
      }

      if (btn.id == ID_HAT_COLOUR_SWAP || btn.id == ID_NONE || btn.id == ID_RANDOM) {
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

        this.mc
            .getTextureManager()
            .bindTexture(us.ichun.mods.hats.client.gui.GuiHatSelection.texIcons);

        if (btn.visible) {
          if (btn.id == ID_HAT_COLOUR_SWAP) {
            drawTexturedModalRect(
                btn.xPosition + 2, btn.yPosition + 2, (view == VIEW_HATS ? 176 : 0), 0, 16, 16);
          } else if (btn.id == ID_NONE) {
            drawTexturedModalRect(btn.xPosition + 2, btn.yPosition + 2, 32, 0, 16, 16);
          } else if (btn.id == ID_RANDOM) {
            drawTexturedModalRect(btn.xPosition + 2, btn.yPosition + 2, 80, 0, 16, 16);
          }
        }

        GlStateManager.disableBlend();
      }
    }

    drawString(
        fontRendererObj, "Viewing: " + currentDisplay, this.guiLeft, this.guiTop - 9, 0xffffff);

    this.mouseX = (float) par1;
    this.mouseY = (float) par2;

    drawSearchBar();

    drawPlayerOnGui(
        k + 42,
        l + 155,
        55,
        (float) (k + 42) - (float) mouseX,
        (float) (l + 155 - 42) - (float) mouseY);

    drawForeground(par1, par2, par3);
  }