コード例 #1
0
  /** Draw the foreground layer for the GuiContainer (everythin in front of the items) */
  protected void drawGuiContainerForegroundLayer() {
    String name = "";
    String author = "";
    String notes = "";
    boolean recolor = false;

    if ((isRunes() && getRunePage() == 0) || (!isRunes() && getInsPage() == 0)) {
      name = "Legend";
      notes =
          "\n\n\n"
              + "Meat: Pork, Beef, or Chicken raw or cooked.\n---\n"
              + "Drops: Any item corresponding to a particular mob.\n---\n"
              + "Variable: The dust is interchangable and allows you to set traits of the rune.\n---\n"
              + "Powered: If the name is red, then it requires fueling via smeltables.";

      author = derp[randAuthor];
    } else {
      if (isRunes()) {
        DustShape shape = DustManager.getShape(getRunePage() - 1);
        name = shape.getRuneName();
        notes = showSacrifices ? shape.getNotes() : shape.getDescription();
        author = "by " + shape.getAuthor();
        if (shape.isPower) {
          recolor = true;
        }
        Random rand = new Random();
        randAuthor = (int) (rand.nextInt(derp.length));
      } else {
        InscriptionEvent event = InscriptionManager.getEventInOrder(getInsPage() - 1);
        name = event.getInscriptionName();
        notes = showSacrifices ? event.getNotes() : event.getDescription();
        author = "by " + event.getAuthor();
        Random rand = new Random();
        randAuthor = (int) (rand.nextInt(derp.length));
      }
    }

    GL11.glColor3f(255, 0, 0);
    fontRenderer.drawString(
        name,
        (width - xSize) / 2 - offX,
        (height - ySize) / 2 - fontRenderer.FONT_HEIGHT - 2,
        recolor ? 0xFF0000 : 0xEEEEEE);
    fontRenderer.drawSplitString(
        notes,
        (width + xSize) / 2 + 2 - offX,
        (height - ySize) / 2 + 2,
        (width - xSize) / 2 + offX,
        0xffa0a0a0);
    GL11.glPushMatrix();
    float scale = 0.6666F;
    GL11.glTranslated((width - xSize) / 2 - offX, (height - ySize) / 2 + ySize, 0);
    GL11.glScalef(scale, scale, scale);
    fontRenderer.drawString(author, 0, 0, 0xffa0a0a0);
    GL11.glPopMatrix();
  }
コード例 #2
0
  private void advancePage() {
    if (isRunes()) {
      //        itemstack.setItemDamage(itemstack.getItemDamage() + 1);
      setRunePage(getRunePage() + 1);

      if (getRunePage() >= DustManager.getShapes().size() - DustMod.numSec + 1) {
        setRunePage(0);
      }
    } else {

      setInsPage(getInsPage() + 1);

      if (getInsPage() >= InscriptionManager.getEvents().size() + 1) {
        setInsPage(0);
      }
    }
  }
コード例 #3
0
  private void retreatPage() {
    if (isRunes()) {
      setRunePage(getRunePage() - 1);

      if (getRunePage() < 0) {
        setRunePage(DustManager.getShapes().size() - DustMod.numSec);
        //        	itemstack.setItemDamage(DustManager.getShapes().size() - DustMod.numSec);
        //            page = DustManager.getShapes().size() - DustMod.numSec;
      }
    } else {
      setInsPage(getInsPage() - 1);

      if (getInsPage() < 0) {
        setInsPage(InscriptionManager.getEvents().size());
        //        	itemstack.setItemDamage(DustManager.getShapes().size() - DustMod.numSec);
        //            page = DustManager.getShapes().size() - DustMod.numSec;
      }
    }
  }
コード例 #4
0
  /** Draw the background layer for the GuiContainer (everything behind the items) */
  protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
    //    	System.out.println("RAWR " + DustManager.isEmpty() + " " + InscriptionManager.isEmpty());
    int i = mc.renderEngine.getTexture(DustMod.path + "/tomeGui.png");
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(i);
    //
    // mc.renderEngine.bindTexture(mc.renderEngine.getTexture(RenderDustTable.getPagePath(page)));
    int j = (width - xSize) / 2 - offX;
    int k = (height - ySize) / 2;
    xStart = j;
    yStart = k;
    int pageWidth = 70;
    int pageHeight = 56;
    int ox = 4;
    int oy = 4;
    float scalex = (float) (xSize - ox * 2) / 256F;
    float scaley = (float) (ySize - oy * 2) / 256F;
    float res = xSize / ySize;
    drawTexturedModalRect(j, k, 24, 0, xSize, ySize);
    GL11.glPushMatrix();
    GL11.glScalef(1 / res, res, 1);
    GL11.glTranslatef(j + ox, k + oy, 0);
    GL11.glScalef(scalex, scaley, 1f);
    //        System.out.println("Scale " + scalex + " " + scaley);
    if (isRunes()) {
      if (getRunePage() == 0) {
        if (DustManager.isEmpty()) {
          mc.renderEngine.bindTexture(
              mc.renderEngine.getTexture(DustMod.path + "/pages" + "/no_runes.png"));
        } else {
          mc.renderEngine.bindTexture(mc.renderEngine.getTexture(DustMod.path + "/pages/info.png"));
        }
      } else
        PageHelper.bindExternalTexture(
            PageHelper.runeFolder + RenderDustTable.getRunePageName(getRunePage()) + ".png");
    } else {
      if (getInsPage() == 0) {
        if (InscriptionManager.isEmpty()) {
          mc.renderEngine.bindTexture(
              mc.renderEngine.getTexture(DustMod.path + "/pages" + "/no_inscriptions.png"));
        } else {
          mc.renderEngine.bindTexture(
              mc.renderEngine.getTexture(DustMod.path + "/pages" + "/info.png"));
        }
      } else
        PageHelper.bindExternalTexture(
            PageHelper.insFolder
                + InscriptionManager.getEventInOrder(getInsPage() - 1).getIDName()
                + ".png");
    }
    drawTexturedModalRect(0, 0, 0, 0, 256, 256);

    GL11.glPopMatrix();

    if (isRunes()) {
      mc.renderEngine.bindTexture(i);
      drawTexturedModalRect(j - 6, k, 12, 0, 12, ySize);
    } else {
      mc.renderEngine.bindTexture(i);
      drawTexturedModalRect(j - 6, k, 0, 0, 12, ySize);
    }
  }