Search in sources :

Example 1 with IAlleleFlowers

use of forestry.api.genetics.IAlleleFlowers in project ForestryMC by ForestryMC.

the class FlutterlyzerPlugin method drawAnalyticsPage1.

@SideOnly(Side.CLIENT)
@Override
public void drawAnalyticsPage1(GuiScreen gui, ItemStack itemStack) {
    if (gui instanceof GuiAlyzer) {
        GuiAlyzer guiAlyzer = (GuiAlyzer) gui;
        IButterfly butterfly = ButterflyManager.butterflyRoot.getMember(itemStack);
        if (butterfly == null) {
            return;
        }
        TextLayoutHelper textLayout = guiAlyzer.getTextLayout();
        textLayout.startPage(GuiAlyzer.COLUMN_0, GuiAlyzer.COLUMN_1, GuiAlyzer.COLUMN_2);
        textLayout.drawLine(Translator.translateToLocal("for.gui.active"), GuiAlyzer.COLUMN_1);
        textLayout.drawLine(Translator.translateToLocal("for.gui.inactive"), GuiAlyzer.COLUMN_2);
        textLayout.newLine();
        textLayout.newLine();
        guiAlyzer.drawSpeciesRow(Translator.translateToLocal("for.gui.species"), butterfly, EnumButterflyChromosome.SPECIES, null, null);
        textLayout.newLine();
        guiAlyzer.drawRow(Translator.translateToLocal("for.gui.size"), butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.SIZE).getAlleleName(), butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.SIZE).getAlleleName(), butterfly, EnumButterflyChromosome.SPEED);
        textLayout.newLine();
        guiAlyzer.drawRow(Translator.translateToLocal("for.gui.lifespan"), butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.LIFESPAN).getAlleleName(), butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.LIFESPAN).getAlleleName(), butterfly, EnumButterflyChromosome.LIFESPAN);
        textLayout.newLine();
        guiAlyzer.drawRow(Translator.translateToLocal("for.gui.speed"), butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.SPEED).getAlleleName(), butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.SPEED).getAlleleName(), butterfly, EnumButterflyChromosome.SPEED);
        textLayout.newLine();
        guiAlyzer.drawRow(Translator.translateToLocal("for.gui.metabolism"), GenericRatings.rateMetabolism(butterfly.getGenome().getMetabolism()), GenericRatings.rateMetabolism(((IAlleleInteger) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.METABOLISM)).getValue()), butterfly, EnumButterflyChromosome.METABOLISM);
        textLayout.newLine();
        textLayout.drawLine(Translator.translateToLocal("for.gui.fertility"), GuiAlyzer.COLUMN_0);
        guiAlyzer.drawFertilityInfo(butterfly.getGenome().getFertility(), GuiAlyzer.COLUMN_1, guiAlyzer.getColorCoding(butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.FERTILITY).isDominant()), 8);
        guiAlyzer.drawFertilityInfo(((IAlleleInteger) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.FERTILITY)).getValue(), GuiAlyzer.COLUMN_2, guiAlyzer.getColorCoding(butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.FERTILITY).isDominant()), 8);
        textLayout.newLine();
        guiAlyzer.drawRow(Translator.translateToLocal("for.gui.flowers"), butterfly.getGenome().getFlowerProvider().getDescription(), ((IAlleleFlowers) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.FLOWER_PROVIDER)).getProvider().getDescription(), butterfly, EnumButterflyChromosome.FLOWER_PROVIDER);
        textLayout.newLine();
        guiAlyzer.drawRow(Translator.translateToLocal("for.gui.effect"), butterfly.getGenome().getEffect().getAlleleName(), butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.EFFECT).getAlleleName(), butterfly, EnumButterflyChromosome.EFFECT);
        textLayout.newLine();
        textLayout.endPage();
    }
}
Also used : TextLayoutHelper(forestry.core.gui.TextLayoutHelper) IAlleleFlowers(forestry.api.genetics.IAlleleFlowers) IButterfly(forestry.api.lepidopterology.IButterfly) IAlleleInteger(forestry.api.genetics.IAlleleInteger) GuiAlyzer(forestry.core.gui.GuiAlyzer) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with IAlleleFlowers

use of forestry.api.genetics.IAlleleFlowers in project ForestryMC by ForestryMC.

the class AlleleFactory method createFlowers.

@Override
public IAlleleFlowers createFlowers(String modId, String category, String valueName, IFlowerProvider value, boolean isDominant, IChromosomeType... types) {
    IAlleleFlowers alleleFlowers = new AlleleFlowers(modId, category, valueName, value, isDominant);
    AlleleManager.alleleRegistry.registerAllele(alleleFlowers, types);
    return alleleFlowers;
}
Also used : IAlleleFlowers(forestry.api.genetics.IAlleleFlowers) IAlleleFlowers(forestry.api.genetics.IAlleleFlowers) AlleleFlowers(forestry.apiculture.genetics.alleles.AlleleFlowers)

Aggregations

IAlleleFlowers (forestry.api.genetics.IAlleleFlowers)2 IAlleleInteger (forestry.api.genetics.IAlleleInteger)1 IButterfly (forestry.api.lepidopterology.IButterfly)1 AlleleFlowers (forestry.apiculture.genetics.alleles.AlleleFlowers)1 GuiAlyzer (forestry.core.gui.GuiAlyzer)1 TextLayoutHelper (forestry.core.gui.TextLayoutHelper)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1