示例#1
0
  /** Draws the screen and all the components in it. */
  public void drawScreen(int x, int y, float z) {
    drawDefaultBackground();
    drawCenteredString(fontRenderer, screenTitle, width / 2, 40, 0xffffff);

    // Spout Start
    if (org.spoutcraft.client.config.ConfigReader.showChatColors) {
      for (int c = 0; c < 16; c++) {
        ChatColor value = ChatColor.getByCode(c);
        String name = value.name().toLowerCase();
        boolean lastUnderscore = true;
        String parsedName = "";
        for (int chr = 0; chr < name.length(); chr++) {
          char ch = name.charAt(chr);
          if (lastUnderscore) {
            ch = Character.toUpperCase(ch);
          }
          if (ch == '_') {
            lastUnderscore = true;
            ch = ' ';
          } else {
            lastUnderscore = false;
          }
          parsedName += ch;
        }
        char code = (char) ('0' + c);
        if (c >= 10) {
          code = (char) ('a' + c - 10);
        }
        fontRenderer.drawStringWithShadow(
            "&" + code + " - " + value + parsedName, width - 90, 70 + c * 10, 0xffffffff);
      }
    }
    // Spout end

    GL11.glPushMatrix();
    GL11.glTranslatef(width / 2, 0.0F, 50F);
    float f = 93.75F;
    GL11.glScalef(-f, -f, -f);
    GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
    Block block = entitySign.getBlockType();

    if (block == Block.signPost) {
      float f1 = (float) (entitySign.getBlockMetadata() * 360) / 16F;
      GL11.glRotatef(f1, 0.0F, 1.0F, 0.0F);
      GL11.glTranslatef(0.0F, -1.0625F, 0.0F);
    } else {
      int i = entitySign.getBlockMetadata();
      float f2 = 0.0F;

      if (i == 2) {
        f2 = 180F;
      }

      if (i == 4) {
        f2 = 90F;
      }

      if (i == 5) {
        f2 = -90F;
      }

      GL11.glRotatef(f2, 0.0F, 1.0F, 0.0F);
      GL11.glTranslatef(0.0F, -1.0625F, 0.0F);
    }

    // Spout start
    // if(this.updateCounter / 6 % 2 == 0) {
    this.entitySign.lineBeingEdited = this.editLine;
    entitySign.columnBeingEdited = editColumn;
    // }
    // Spout end

    TileEntityRenderer.instance.renderTileEntityAt(entitySign, -0.5D, -0.75D, -0.5D, 0.0F);
    // Spout start
    this.entitySign.lineBeingEdited = -1;
    entitySign.columnBeingEdited = -1;
    // Spout end
    GL11.glPopMatrix();
    super.drawScreen(x, y, z);
    // Spout start
    if (unicode.enabled
        && isInBoundingRect(
            unicode.xPosition,
            unicode.yPosition,
            unicode.field_52007_b,
            unicode.field_52008_a,
            x,
            y)) {
      this.drawTooltip(
          "Some servers censor unicode characters. \nIf yours does, try sending as plain text.",
          x,
          y);
    }
    // Spout end
  }