use of forestry.api.core.IGuiElementLayout in project ForestryMC by ForestryMC.
the class GuiElementFactory method createToleranceInfo.
private IGuiElementLayout createToleranceInfo(IAlleleTolerance toleranceAllele, int x) {
int textColor = getColorCoding(toleranceAllele.isDominant());
EnumTolerance tolerance = toleranceAllele.getValue();
String text = "(" + toleranceAllele.getAlleleName() + ")";
IGuiElementLayout layout = createHorizontal(x, 0, 0).setDistance(2);
switch(tolerance) {
case BOTH_1:
case BOTH_2:
case BOTH_3:
case BOTH_4:
case BOTH_5:
layout.addElement(createBothSymbol(0, -1));
layout.addElement(new GuiElementText(0, 0, 12, text, textColor));
break;
case DOWN_1:
case DOWN_2:
case DOWN_3:
case DOWN_4:
case DOWN_5:
layout.addElement(createDownSymbol(0, -1));
layout.addElement(new GuiElementText(0, 0, 12, text, textColor));
break;
case UP_1:
case UP_2:
case UP_3:
case UP_4:
case UP_5:
layout.addElement(createUpSymbol(0, -1));
layout.addElement(new GuiElementText(0, 0, 12, text, textColor));
break;
default:
layout.addElement(createNoneSymbol(0, -1));
layout.addElement(new GuiElementText(0, 0, 12, "(0)", textColor));
break;
}
return layout;
}
use of forestry.api.core.IGuiElementLayout in project ForestryMC by ForestryMC.
the class GuiElementFactory method createToleranceInfo.
public IGuiElement createToleranceInfo(IAlleleTolerance toleranceAllele, IAlleleSpecies species, String text) {
IGuiElementLayout layout = createHorizontal(0, 0, 0).setDistance(0);
layout.addElement(new GuiElementText(0, 0, 12, text, getColorCoding(species.isDominant())));
layout.addElement(createToleranceInfo(toleranceAllele, 0));
return layout;
}
use of forestry.api.core.IGuiElementLayout in project ForestryMC by ForestryMC.
the class GuiElementFactory method createFertilityInfo.
public IGuiElement createFertilityInfo(IAlleleInteger fertilityAllele, int x, int texOffset) {
String fertilityString = Integer.toString(fertilityAllele.getValue()) + " x";
IGuiElementLayout layout = createHorizontal(x, 0, 0).setDistance(2);
layout.addElement(new GuiElementText(0, 0, 12, fertilityString, getColorCoding(fertilityAllele.isDominant())));
layout.addElement(new GuiElementDrawable(0, -1, new Drawable(TEXTURE, 60, 240 + texOffset, 12, 8)));
return layout;
}
use of forestry.api.core.IGuiElementLayout in project ForestryMC by ForestryMC.
the class GuiElementFactory method createMutationResultant.
public IGuiElementLayout createMutationResultant(int x, int y, int width, int height, IMutation mutation, IBreedingTracker breedingTracker) {
if (breedingTracker.isDiscovered(mutation)) {
IGuiElementLayout element = new GuiElementPanel(x, y, width, height);
IAlyzerPlugin plugin = mutation.getRoot().getAlyzerPlugin();
Map<String, ItemStack> iconStacks = plugin.getIconStacks();
ItemStack firstPartner = iconStacks.get(mutation.getAllele0().getUID());
ItemStack secondPartner = iconStacks.get(mutation.getAllele1().getUID());
element.addElements(new GuiElementItemStack(0, 0, firstPartner), createProbabilityAdd(mutation, 21, 4), new GuiElementItemStack(33, 0, secondPartner));
return element;
}
// Do not display secret undiscovered mutations.
if (mutation.isSecret()) {
return null;
}
return createUnknownMutationGroup(x, y, width, height, mutation);
}
Aggregations