use of com.simibubi.create.foundation.gui.AllGuiTextures in project Create by Creators-of-Create.
the class CreateRecipeCategory method getRenderedSlot.
public static AllGuiTextures getRenderedSlot(Recipe<?> recipe, int index) {
AllGuiTextures jeiSlot = AllGuiTextures.JEI_SLOT;
if (!(recipe instanceof ProcessingRecipe))
return jeiSlot;
ProcessingRecipe<?> processingRecipe = (ProcessingRecipe<?>) recipe;
List<ProcessingOutput> rollableResults = processingRecipe.getRollableResults();
if (rollableResults.size() <= index)
return jeiSlot;
if (processingRecipe.getRollableResults().get(index).getChance() == 1)
return jeiSlot;
return AllGuiTextures.JEI_CHANCE_SLOT;
}
use of com.simibubi.create.foundation.gui.AllGuiTextures in project Create by Creators-of-Create.
the class SequencedGearshiftScreen method renderWindow.
@Override
protected void renderWindow(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
int x = guiLeft;
int y = guiTop;
background.render(ms, x, y, this);
for (int row = 0; row < instructions.capacity(); row++) {
AllGuiTextures toDraw = AllGuiTextures.SEQUENCER_EMPTY;
int yOffset = toDraw.height * row;
if (row >= instructions.size()) {
toDraw.render(ms, x, y + 14 + yOffset, this);
continue;
}
Instruction instruction = instructions.get(row);
SequencerInstructions def = instruction.instruction;
def.background.render(ms, x, y + 14 + yOffset, this);
label(ms, 36, yOffset - 3, Lang.translate(def.translationKey));
if (def.hasValueParameter) {
String text = def.formatValue(instruction.value);
int stringWidth = font.width(text);
label(ms, 90 + (12 - stringWidth / 2), yOffset - 3, new TextComponent(text));
}
if (def.hasSpeedParameter)
label(ms, 127, yOffset - 3, instruction.speedModifier.label);
}
drawCenteredString(ms, font, title, x + (background.width - 8) / 2, y + 3, 0xFFFFFF);
GuiGameElement.of(renderedItem).<GuiGameElement.GuiRenderBuilder>at(x + background.width + 6, y + background.height - 56, -200).scale(5).render(ms);
}
use of com.simibubi.create.foundation.gui.AllGuiTextures in project Create by Creators-of-Create.
the class StockpileSwitchScreen method renderWindow.
@Override
protected void renderWindow(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
int x = guiLeft;
int y = guiTop;
background.render(ms, x, y, this);
AllGuiTextures.STOCKSWITCH_POWERED_LANE.render(ms, x + 36, y + (te.isInverted() ? 18 : 40), this);
AllGuiTextures.STOCKSWITCH_UNPOWERED_LANE.render(ms, x + 36, y + (te.isInverted() ? 40 : 18), this);
drawCenteredString(ms, font, title, x + (background.width - 8) / 2, y + 3, 0xFFFFFF);
AllGuiTextures sprite = AllGuiTextures.STOCKSWITCH_INTERVAL;
float lowerBound = offBelow.getState();
float upperBound = onAbove.getState();
sprite.bind();
blit(ms, (int) (x + upperBound) + 37, y + 18, (int) (sprite.startX + upperBound), sprite.startY, (int) (sprite.width - upperBound), sprite.height);
blit(ms, x + 37, y + 40, sprite.startX, sprite.startY, (int) (lowerBound), sprite.height);
AllGuiTextures.STOCKSWITCH_ARROW_UP.render(ms, (int) (x + lowerBound + 36) - 2, y + 35, this);
AllGuiTextures.STOCKSWITCH_ARROW_DOWN.render(ms, (int) (x + upperBound + 36) - 3, y + 17, this);
if (te.currentLevel != -1) {
AllGuiTextures cursor = AllGuiTextures.STOCKSWITCH_CURSOR;
ms.pushPose();
ms.translate(Math.min(99, this.cursor.getValue(partialTicks) * sprite.width), cursorLane.getValue(partialTicks) * 22, 0);
cursor.render(ms, x + 34, y + 19, this);
ms.popPose();
}
GuiGameElement.of(renderedItem).<GuiGameElement.GuiRenderBuilder>at(x + background.width + 6, y + background.height - 56, -200).scale(5).render(ms);
}
use of com.simibubi.create.foundation.gui.AllGuiTextures in project Create by Creators-of-Create.
the class IconButton method renderButton.
@Override
public void renderButton(@Nonnull PoseStack matrixStack, int mouseX, int mouseY, float partialTicks) {
if (visible) {
isHovered = mouseX >= x && mouseY >= y && mouseX < x + width && mouseY < y + height;
AllGuiTextures button = !active ? AllGuiTextures.BUTTON_DOWN : isHoveredOrFocused() ? AllGuiTextures.BUTTON_HOVER : AllGuiTextures.BUTTON;
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
AllGuiTextures.BUTTON.bind();
blit(matrixStack, x, y, button.startX, button.startY, button.width, button.height);
icon.render(matrixStack, x + 1, y + 1, this);
}
}
use of com.simibubi.create.foundation.gui.AllGuiTextures in project Create by Creators-of-Create.
the class Indicator method render.
@Override
public void render(@Nonnull PoseStack matrixStack, int mouseX, int mouseY, float partialTicks) {
AllGuiTextures toDraw;
switch(state) {
case ON:
toDraw = AllGuiTextures.INDICATOR_WHITE;
break;
case OFF:
toDraw = AllGuiTextures.INDICATOR;
break;
case RED:
toDraw = AllGuiTextures.INDICATOR_RED;
break;
case YELLOW:
toDraw = AllGuiTextures.INDICATOR_YELLOW;
break;
case GREEN:
toDraw = AllGuiTextures.INDICATOR_GREEN;
break;
default:
toDraw = AllGuiTextures.INDICATOR;
break;
}
toDraw.render(matrixStack, x, y, this);
}
Aggregations