コード例 #1
0
  @Override
  public void drawGuiContainerForegroundLayer(int i, int j) {
    String s1 = "Usage: 80 RF/T";
    String s2 =
        Integer.toString(tileAim.getEnergyStored())
            + "/"
            + Integer.toString(this.tileAim.MAXENERGY);
    String s3 = "Progress: " + Integer.toString((100 - tileAim.processedPercent)) + "%";
    this.fontRendererObj.drawString(
        s1, this.xSize / 2 - this.fontRendererObj.getStringWidth(s1) / 2, 6, 0x000000);

    int k = (this.width - this.xSize) / 2;
    int l = (this.height - this.ySize) / 2;
    if (mouseX > guiLeft + 10 && mouseX < guiLeft + 28) {
      if (mouseY > guiTop + 15 && mouseY < guiTop + 71) {
        List list = new ArrayList();
        list.add(s2);
        this.drawHoveringText(list, (int) mouseX - k, (int) mouseY - l, this.fontRendererObj);
      }
    }
    if (tileAim.processedPercent != 0) {
      if (mouseX > guiLeft + 80 && mouseX < guiLeft + 100) {
        if (mouseY > guiTop + 32 && mouseY < guiTop + 50) {
          List list = new ArrayList();
          list.add(s3);
          this.drawHoveringText(list, (int) mouseX - k, (int) mouseY - l, this.fontRendererObj);
        }
      }
    }
  }
コード例 #2
0
  public GuiAim(InventoryPlayer invPlayer, TileAim entity) {
    super(new ContainerAim(invPlayer, entity));

    xSize = 176;
    ySize = 166;
    float test = entity.getPowerScaled();
    this.tileAim = entity;
  }