protected TAS(IWidgetIcon icon) { super(icon.getMap().getTexture().toString()); setIconWidth(icon.getWidth()); setIconHeight(icon.getHeight()); initSprite(icon.getMap().getSize(), icon.getMap().getSize(), icon.getX(), icon.getY(), false); }
@Override public void apply(@Nonnull Vertex vertex) { for (VertexTransform xform : xforms) { xform.apply(vertex); } } });
private static IProbeInfo addIcon(IProbeInfo probeInfo, IWidgetIcon icon, int border) { ResourceLocation texture = icon.getMap().getTexture(); int x = icon.getX(); int y = icon.getY(); int width = icon.getWidth(); int height = icon.getHeight(); return probeInfo.icon(texture, x, y, width, height, probeInfo.defaultIconStyle().width(width + border).height(height + border)); }
@Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { if (alloyFront != null) { alloyFront.draw(minecraft, 129 - xOff, 40 - yOff - 5); IconEIO.map.render(IconEIO.GENERIC_VERBOTEN, 135 - xOff, 34 - yOff - 5, true); } }
public MultiIconButton(@Nonnull IGuiScreen gui, int id, int x, int y, @Nonnull IWidgetIcon unpressed, @Nonnull IWidgetIcon pressed, @Nonnull IWidgetIcon hover) { super(gui, id, x, y, null); this.unpressed = unpressed; this.pressed = pressed; this.hover = hover; setSize(unpressed.getWidth(), unpressed.getHeight()); }
@Override @SideOnly(Side.CLIENT) public @Nonnull ResourceLocation getBackgroundLocation() { return IconEIO.TRASHCAN.getMap().getTexture(); }
@Override @SideOnly(Side.CLIENT) public void render(@Nonnull IWidgetIcon widget, double x, double y) { render(widget, x, y, false); }
@Override public void applyToNormal(@Nonnull Vector3f vec) { for (VertexTransform xform : xforms) { xform.applyToNormal(vec); } }
private void renderTabPart(@Nonnull BufferBuilder tes, int x, int y, int u, int v, int w, int h) { double minU = (double) u / IconEIO.map.getSize(); double maxU = (double) (u + w) / IconEIO.map.getSize(); double minV = (double) v / IconEIO.map.getSize(); double maxV = (double) (v + h) / IconEIO.map.getSize(); tes.pos(x, y + h, 0).tex(minU, maxV).endVertex(); tes.pos(x + w, y + h, 0).tex(maxU, maxV).endVertex(); tes.pos(x + w, y + 0, 0).tex(maxU, minV).endVertex(); tes.pos(x, y + 0, 0).tex(minU, minV).endVertex(); }
@Nonnull @SideOnly(Side.CLIENT) default TextureAtlasSprite getAsTextureAtlasSprite() { return new TAS(this); }
@Override public void apply(@Nonnull Vertex vertex) { for (VertexTransform xform : xforms) { xform.apply(vertex); } }
@Override @SideOnly(Side.CLIENT) public @Nonnull ResourceLocation getBackgroundLocation() { return IconEIO.CAPACITOR.getMap().getTexture(); }
@Override @SideOnly(Side.CLIENT) public void render(@Nonnull IWidgetIcon widget, double x, double y, double width, double height, double zLevel, boolean doDraw) { render(widget, x, y, width, height, zLevel, doDraw, false); }
@Override public void apply(@Nonnull Vector3d vec) { for (VertexTransform xform : xforms) { xform.apply(vec); } }
@Override @SideOnly(Side.CLIENT) public void render(@Nonnull IWidgetIcon widget, double x, double y, double width, double height, double zLevel, boolean doDraw, boolean flipY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); super.render(widget, x, y, width, height, zLevel, doDraw, flipY); } };
void setupVertices(BoundingBox bound, VertexTransform xForm) { verts[0].set(bound.minX, bound.minY, bound.minZ); verts[1].set(bound.maxX, bound.minY, bound.minZ); verts[2].set(bound.maxX, bound.maxY, bound.minZ); verts[3].set(bound.minX, bound.maxY, bound.minZ); verts[4].set(bound.minX, bound.minY, bound.maxZ); verts[5].set(bound.maxX, bound.minY, bound.maxZ); verts[6].set(bound.maxX, bound.maxY, bound.maxZ); verts[7].set(bound.minX, bound.maxY, bound.maxZ); if (xForm != null) { for (Vector3d vec : verts) { if (vec != null) { xForm.apply(vec); } } } }