Search in sources :

Example 1 with ControlSpeciesBox

use of binnie.core.gui.database.ControlSpeciesBox in project Binnie by ForestryMC.

the class PageWood method onValueChanged.

@Override
public void onValueChanged(final ItemStack species) {
    this.deleteAllChildren();
    final WindowAbstractDatabase database = Window.get(this);
    new ControlText(this, new Area(0, 0, this.getSize().xPos(), 24), this.getValue().toString(), TextJustification.MIDDLE_CENTER);
    ITreeBreedingSystem breedingSystem = (ITreeBreedingSystem) database.getBreedingSystem();
    final Collection<IAlleleSpecies> trees = breedingSystem.getTreesThatHaveWood(species, database.isMaster(), database.getWorld(), database.getUsername());
    new ControlSpeciesBox(this, 4, 24, this.getSize().xPos() - 8, this.getSize().yPos() - 4 - 24).setOptions(trees);
}
Also used : ITreeBreedingSystem(binnie.genetics.api.ITreeBreedingSystem) Area(binnie.core.gui.geometry.Area) ControlText(binnie.core.gui.controls.ControlText) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) WindowAbstractDatabase(binnie.core.gui.database.WindowAbstractDatabase) ControlSpeciesBox(binnie.core.gui.database.ControlSpeciesBox)

Example 2 with ControlSpeciesBox

use of binnie.core.gui.database.ControlSpeciesBox in project Binnie by ForestryMC.

the class PageFruit method onValueChanged.

@Override
public void onValueChanged(final ItemStack species) {
    this.deleteAllChildren();
    final WindowAbstractDatabase database = Window.get(this);
    new ControlText(this, new Area(0, 0, this.getSize().xPos(), 24), I18N.localise("extratrees.gui.database.tab.fruit." + (this.treesThatBearFruit ? "natural" : "potential")), TextJustification.MIDDLE_CENTER);
    ITreeBreedingSystem breedingSystem = (ITreeBreedingSystem) database.getBreedingSystem();
    final Collection<IAlleleSpecies> trees;
    if (this.treesThatBearFruit) {
        trees = breedingSystem.getTreesThatBearFruit(species, database.isMaster(), database.getWorld(), database.getUsername());
    } else {
        trees = breedingSystem.getTreesThatCanBearFruit(species, database.isMaster(), database.getWorld(), database.getUsername());
    }
    new ControlSpeciesBox(this, 4, 24, this.getSize().xPos() - 8, this.getSize().yPos() - 4 - 24).setOptions(trees);
}
Also used : ITreeBreedingSystem(binnie.genetics.api.ITreeBreedingSystem) Area(binnie.core.gui.geometry.Area) ControlText(binnie.core.gui.controls.ControlText) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) WindowAbstractDatabase(binnie.core.gui.database.WindowAbstractDatabase) ControlSpeciesBox(binnie.core.gui.database.ControlSpeciesBox)

Example 3 with ControlSpeciesBox

use of binnie.core.gui.database.ControlSpeciesBox in project Binnie by ForestryMC.

the class PagePlanksTrees method onValueChanged.

@Override
public void onValueChanged(final ItemStack species) {
    this.deleteAllChildren();
    final WindowAbstractDatabase database = Window.get(this);
    new ControlText(this, new Area(0, 0, this.getSize().xPos(), 24), species.getDisplayName(), TextJustification.MIDDLE_CENTER);
    final Collection<IAlleleSpecies> trees = getTreesThatMakePlanks(species, database.isMaster(), database.getWorld(), database.getUsername());
    new ControlSpeciesBox(this, 4, 24, this.getSize().xPos() - 8, this.getSize().yPos() - 4 - 24).setOptions(trees);
}
Also used : Area(binnie.core.gui.geometry.Area) ControlText(binnie.core.gui.controls.ControlText) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) WindowAbstractDatabase(binnie.core.gui.database.WindowAbstractDatabase) ControlSpeciesBox(binnie.core.gui.database.ControlSpeciesBox)

Aggregations

ControlText (binnie.core.gui.controls.ControlText)3 ControlSpeciesBox (binnie.core.gui.database.ControlSpeciesBox)3 WindowAbstractDatabase (binnie.core.gui.database.WindowAbstractDatabase)3 Area (binnie.core.gui.geometry.Area)3 IAlleleSpecies (forestry.api.genetics.IAlleleSpecies)3 ITreeBreedingSystem (binnie.genetics.api.ITreeBreedingSystem)2