Search in sources :

Example 1 with EnumFlowerChromosome

use of binnie.botany.api.genetics.EnumFlowerChromosome in project Binnie by ForestryMC.

the class FlowerAlyzerPlugin method drawAnalyticsPage2.

@SideOnly(Side.CLIENT)
@Override
public void drawAnalyticsPage2(GuiScreen gui, ItemStack itemStack) {
    lastTopOffset = 0;
    guiLeft = (gui.width - 246) / 2;
    guiTop = (gui.height - 238) / 2;
    IFlower flower = BotanyAPI.flowerRoot.getMember(itemStack);
    if (flower == null) {
        return;
    }
    for (EnumFlowerChromosome chromosome : secondPageColorChromosome) {
        drawChromosome(gui, chromosome, flower);
        RenderUtil.drawSolidRect(new Area(guiLeft + COLUMN_1, guiTop + lastTopOffset + MARGIN, 50, 10), ((IAlleleInteger) flower.getGenome().getActiveAllele(chromosome)).getValue());
        RenderUtil.drawSolidRect(new Area(guiLeft + COLUMN_2, guiTop + lastTopOffset + MARGIN, 50, 10), ((IAlleleInteger) flower.getGenome().getInactiveAllele(chromosome)).getValue());
        newLine();
    }
    for (EnumFlowerChromosome chromosome : secondPageToleranceChromosome) {
        drawChromosome(gui, chromosome, flower);
        newLine();
    }
}
Also used : Area(binnie.core.gui.geometry.Area) IFlower(binnie.botany.api.genetics.IFlower) EnumFlowerChromosome(binnie.botany.api.genetics.EnumFlowerChromosome) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with EnumFlowerChromosome

use of binnie.botany.api.genetics.EnumFlowerChromosome in project Binnie by ForestryMC.

the class FlowerAlyzerPlugin method drawAnalyticsPage1.

@SideOnly(Side.CLIENT)
@Override
public void drawAnalyticsPage1(GuiScreen gui, ItemStack itemStack) {
    lastTopOffset = 10;
    guiLeft = (gui.width - 246) / 2;
    guiTop = (gui.height - 238) / 2;
    IFlower flower = BotanyAPI.flowerRoot.getMember(itemStack);
    if (flower == null) {
        return;
    }
    ItemStack renderP = getIconStacks().get(flower.getGenome().getPrimary().getUID());
    ItemStack renderS = getIconStacks().get(flower.getGenome().getSecondary().getUID());
    gui.mc.fontRenderer.drawString("Active", guiLeft + 10 + COLUMN_1, guiTop + 10, 0xffffff);
    gui.mc.fontRenderer.drawString("Inactive", guiLeft + 10 + COLUMN_2, guiTop + 10, 0xffffff);
    if (renderP != null && renderS != null) {
        RenderItem itemRender = Minecraft.getMinecraft().getRenderItem();
        itemRender.renderItemAndEffectIntoGUI(renderP, guiLeft + 10 + COLUMN_1, guiTop + 10 + 12);
        itemRender.renderItemOverlayIntoGUI(gui.mc.fontRenderer, renderP, guiLeft + 10 + COLUMN_1, guiTop + 10 + 12, null);
        itemRender.renderItemAndEffectIntoGUI(renderS, guiLeft + 10 + COLUMN_2, guiTop + 10 + 12);
        itemRender.renderItemOverlayIntoGUI(gui.mc.fontRenderer, renderS, guiLeft + 10 + COLUMN_1, guiTop + 10 + 12, null);
    }
    guiTop += ROW_SIZE * 3;
    for (EnumFlowerChromosome chromosom : firstPageChromosome) {
        drawChromosome(gui, chromosom, flower);
    }
}
Also used : RenderItem(net.minecraft.client.renderer.RenderItem) IFlower(binnie.botany.api.genetics.IFlower) ItemStack(net.minecraft.item.ItemStack) EnumFlowerChromosome(binnie.botany.api.genetics.EnumFlowerChromosome) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

EnumFlowerChromosome (binnie.botany.api.genetics.EnumFlowerChromosome)2 IFlower (binnie.botany.api.genetics.IFlower)2 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2 Area (binnie.core.gui.geometry.Area)1 RenderItem (net.minecraft.client.renderer.RenderItem)1 ItemStack (net.minecraft.item.ItemStack)1