use of binnie.core.api.genetics.IBreedingSystem in project Binnie by ForestryMC.
the class ControlMutationSymbol method setValue.
public void setValue(final IMutation value) {
this.value = value;
final boolean isMaster = ((WindowAbstractDatabase) this.getTopParent()).isMaster();
final IBreedingSystem system = ((WindowAbstractDatabase) this.getTopParent()).getBreedingSystem();
this.discovered = (isMaster || system.isMutationDiscovered(value, Window.get(this).getWorld(), Window.get(this).getUsername()));
if (this.discovered) {
this.setColor(16777215);
} else {
this.setColor(7829367);
}
}
use of binnie.core.api.genetics.IBreedingSystem in project Binnie by ForestryMC.
the class PageBreeder method onPageRefresh.
public void onPageRefresh() {
this.deleteAllChildren();
final IBreedingSystem system = ((WindowAbstractDatabase) Window.get(this)).getBreedingSystem();
new ControlTextCentered(this, 8, TextFormatting.UNDERLINE + system.getDescriptor() + ' ' + I18N.localise(DatabaseConstants.BREEDER_KEY + ".profile"));
new ControlTextCentered(this, 75, system.getDiscoveredSpeciesCount() + '/' + system.getTotalSpeciesCount() + ' ' + I18N.localise(DatabaseConstants.BREEDER_KEY + ".species"));
new ControlBreedingProgress(this, 20, 87, 102, 14, system, system.getDiscoveredSpeciesPercentage());
new ControlTextCentered(this, 115, system.getDiscoveredBranchCount() + '/' + system.getTotalBranchCount() + ' ' + I18N.localise(DatabaseConstants.BREEDER_KEY + ".branches"));
new ControlBreedingProgress(this, 20, 127, 102, 14, system, system.getDiscoveredBranchPercentage());
if (system.getDiscoveredSecretCount() > 0) {
new ControlTextCentered(this, 155, system.getDiscoveredSecretCount() + '/' + system.getTotalSecretCount() + ' ' + I18N.localise(DatabaseConstants.BREEDER_KEY + ".species.secret"));
}
new ControlTextCentered(this, 32, this.player.getName());
new ControlTextCentered(this, 44, TextFormatting.ITALIC + system.getEpitome());
}
use of binnie.core.api.genetics.IBreedingSystem in project Binnie by ForestryMC.
the class GeneArrayItem method getInfo.
@Override
@SideOnly(Side.CLIENT)
public void getInfo(List<String> list) {
List<String> totalList = new ArrayList<>();
IBreedingSystem breedingSystem = getBreedingSystem();
if (breedingSystem != null) {
for (IGene gene : genes) {
String chromosomeName = breedingSystem.getChromosomeName(gene.getChromosome());
totalList.add(TextFormatting.GOLD + chromosomeName + TextFormatting.GRAY + ": " + gene.getName());
}
}
if (totalList.size() < 4 || GuiScreen.isShiftKeyDown()) {
list.addAll(totalList);
} else {
list.add(totalList.get(0));
list.add(totalList.get(1));
list.add((totalList.size() - 2) + " " + I18N.localise("genetics.item.gene.more.genes"));
}
}
use of binnie.core.api.genetics.IBreedingSystem in project Binnie by ForestryMC.
the class WindowAnalyst method initialiseClient.
@Override
@SideOnly(Side.CLIENT)
public void initialiseClient() {
setTitle(isDatabase ? (isMaster ? I18N.localise("genetics.gui.registry.master.title") : I18N.localise("genetics.gui.registry.title")) : I18N.localise("genetics.gui.analyst.title"));
getWindowInventory().createSlot(0);
baseWidget = new Widget(this);
int x = 16;
int y = 28;
Collection<IBreedingSystem> activeSystems = Binnie.GENETICS.getActiveSystems();
if (isDatabase) {
for (IBreedingSystem syst : activeSystems) {
new ControlSystemButton(x, y, this, syst);
x += 22;
}
} else {
new ControlSlot.Builder(this, x, y + 1).assign(InventoryType.WINDOW, 0);
x += 22;
new ControlSlot.Builder(this, x, y + 1).assign(InventoryType.WINDOW, 1);
x += 26;
setupValidators();
}
tabBar = new Control(this, x, 28, getWidth() - 16 - x, 20);
analystPanel = new AnalystPanel(this);
if (!isDatabase) {
slideUpInv = new ControlSlide(this, (getSize().xPos() - 244) / 2, getSize().yPos() - 80 + 1, 244, 80, Alignment.BOTTOM);
new ControlPlayerInventory(slideUpInv, true);
slideUpInv.setSlide(false);
}
addEventHandler(EventKey.Down.class, event -> {
if (event.getKey() == 205) {
shiftPages(true);
}
if (event.getKey() == 203) {
shiftPages(false);
}
});
if (!isDatabase) {
analystNone = new AnalystNoneControl(this);
}
setIndividual(null);
IBreedingSystem first = Binnie.GENETICS.getFirstActiveSystem();
setSystem(first);
}
use of binnie.core.api.genetics.IBreedingSystem in project Binnie by ForestryMC.
the class WindowAnalyst method initialiseServer.
@Override
public void initialiseServer() {
for (IBreedingSystem system : Binnie.GENETICS.getActiveSystems()) {
ISpeciesRoot root = system.getSpeciesRoot();
if (root != null) {
IBreedingTracker tracker = root.getBreedingTracker(getWorld(), getUsername());
if (tracker != null) {
tracker.synchToPlayer(getPlayer());
}
}
}
// create slots
getWindowInventory().createSlot(0);
getWindowInventory().createSlot(1);
setupValidators();
}
Aggregations