Search in sources :

Example 1 with AllGuiTextures

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;
}
Also used : ProcessingRecipe(com.simibubi.create.content.contraptions.processing.ProcessingRecipe) AllGuiTextures(com.simibubi.create.foundation.gui.AllGuiTextures) ProcessingOutput(com.simibubi.create.content.contraptions.processing.ProcessingOutput)

Example 2 with AllGuiTextures

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);
}
Also used : TextComponent(net.minecraft.network.chat.TextComponent) AllGuiTextures(com.simibubi.create.foundation.gui.AllGuiTextures)

Example 3 with AllGuiTextures

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);
}
Also used : AllGuiTextures(com.simibubi.create.foundation.gui.AllGuiTextures)

Example 4 with AllGuiTextures

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);
    }
}
Also used : AllGuiTextures(com.simibubi.create.foundation.gui.AllGuiTextures)

Example 5 with AllGuiTextures

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);
}
Also used : AllGuiTextures(com.simibubi.create.foundation.gui.AllGuiTextures)

Aggregations

AllGuiTextures (com.simibubi.create.foundation.gui.AllGuiTextures)11 TextComponent (net.minecraft.network.chat.TextComponent)2 Window (com.mojang.blaze3d.platform.Window)1 HeatCondition (com.simibubi.create.content.contraptions.processing.HeatCondition)1 ProcessingOutput (com.simibubi.create.content.contraptions.processing.ProcessingOutput)1 ProcessingRecipe (com.simibubi.create.content.contraptions.processing.ProcessingRecipe)1 Pair (com.simibubi.create.foundation.utility.Pair)1 LocalPlayer (net.minecraft.client.player.LocalPlayer)1 BlockPos (net.minecraft.core.BlockPos)1 CompoundTag (net.minecraft.nbt.CompoundTag)1 Component (net.minecraft.network.chat.Component)1 Player (net.minecraft.world.entity.player.Player)1