@Override
  protected void drawGuiContainerForegroundLayer(int par1, int par2) {
    super.drawGuiContainerForegroundLayer(par1, par2);

    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    int minx = 120;
    int miny = 24;
    int w = 36;
    int maxx = minx + w;
    int maxy = miny + w;

    if (mode == AspectMode.DEMAND) {
      // api.drawRectFrame(minx, miny, w, w, ReikaColorAPI.mixColors(this.getActive().getColor(),
      // 0x1e1e1e, clickDelay/90F));
      // Color.HSBtoRGB(hsb[0], Math.min(clickDelay/90F, hsb[1]), Math.min(bright/255F, hsb[2]))
      int color = ReikaColorAPI.mixColors(0x010101, 0xffffff, 1 - bright / 255F - clickDelay / 90F);
      color = ReikaColorAPI.mixColors(color, this.getActive().getColor(), 1 - clickDelay / 90F);
      api.drawRectFrame(minx, miny, w, w, color);
      if (api.isMouseInBox(j + minx, j + maxx, k + miny, k + maxy)) {
        bright = Math.min(bright + 12, 255);
      } else {
        bright = Math.max(bright - 4, 30);
      }
      if (clickDelay > 0) {
        clickDelay = Math.max(clickDelay - 4, 0);
      }

      ElementTagCompound tag = TileEntityAspectFormer.getAspectCost(this.getActive());
      int dx = 18;
      int dy = 21;
      boolean text =
          GuiScreen.isCtrlKeyDown()
              && api.isMouseInBox(
                  j + dx + 32 - 20, j + dx + 32 + 20, k + dy + 20 - 20, k + dy + 20 + 20);
      Proportionality<CrystalElement> p = text ? null : new Proportionality();
      HashMap<CrystalElement, Integer> colors = text ? null : new HashMap();
      for (CrystalElement e : tag.elementSet()) {
        if (text) {
          String s = e.displayName + ": " + tag.getValue(e) + " L/Vis";
          fontRendererObj.drawString(
              s, dx, dy, ReikaColorAPI.mixColors(e.getColor(), 0xffffff, 0.75F));
          dy += fontRendererObj.FONT_HEIGHT;
        } else {
          p.addValue(e, tag.getValue(e));
          colors.put(e, e.getColor());
        }
      }
      if (!text) {
        p.renderAsPie(dx + 32, dy + 20, 20, 0, colors);
        api.drawCircle(dx + 32, dy + 20, 20.25, 0x000000);
      }
    }
  }
Ejemplo n.º 2
0
 @Override
 public Object[] invoke(TileEntity te, Object[] args) throws LuaException, InterruptedException {
   ElementTagCompound tag = ((LumenTile) te).getEnergy();
   Object[] o = new Object[16];
   for (int i = 0; i < CrystalElement.elements.length; i++) {
     CrystalElement e = CrystalElement.elements[i];
     o[i] = tag.getValue(e);
   }
   return o;
 }