コード例 #1
0
ファイル: GuiAnvilButton.java プロジェクト: Jaryt23/TFCraft
  @Override
  public void drawButton(Minecraft mc, int x, int y) {
    if (this.drawButton) {

      int k = this.getHoverState(this.field_82253_i) - 1;
      if (icon == null) {
        k = 0;
        if (screen.AnvilEntity != null && screen.AnvilEntity.workRecipe != null) {
          PlanRecipe p = AnvilManager.getInstance().getPlan(screen.AnvilEntity.craftingPlan);
          if (p == null) return;
          RuleEnum[] Rules = p.rules;
          int[] ItemRules = screen.AnvilEntity.getItemRules();
          this.displayString = StringUtil.localize(Rules[ruleIndex].Name);
        }
      }

      TFC_Core.bindTexture(GuiAnvil.texture);
      GL11.glColor4ub(red, green, blue, (byte) 255);
      this.drawTexturedModalRect(
          this.xPosition,
          this.yPosition,
          this.bX + k * 16,
          this.bY + (ruleIndex * 22),
          this.bW,
          this.bH);

      this.field_82253_i =
          x >= this.xPosition
              && y >= this.yPosition
              && x < this.xPosition + this.width
              && y < this.yPosition + this.height;

      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      if (icon != null) {
        TFC_Core.bindTexture(TextureMap.locationBlocksTexture);
        this.drawTexturedModelRectFromIcon(
            this.xPosition, this.yPosition, icon, this.width, this.height);
      }

      this.mouseDragged(mc, x, y);

      if (field_82253_i) {
        FontRenderer fontrenderer = Minecraft.getMinecraft().fontRenderer;
        screen.drawTooltip(x, y, this.displayString);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      }
    }
  }
コード例 #2
0
ファイル: GuiMold.java プロジェクト: emris/TFCraft
  @Override
  protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    TFC_Core.bindTexture(
        new ResourceLocation(Reference.ModID, Reference.AssetPathGui + "gui_mold.png"));
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    int w = (width - xSize) / 2;
    int h = (height - ySize) / 2;
    drawTexturedModalRect(w, h, 0, 0, xSize, ySize);

    drawTexturedModalRect(w + 85, h + 17, 176, 0, drawArrowScaled(22) + 1, 15);

    PlayerInventory.drawInventory(this, width, height, ySize - PlayerInventory.invYSize);
  }