use of forestry.api.genetics.IFilterLogic in project ForestryMC by ForestryMC.
the class RuleWidget method getToolTip.
@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
IFilterLogic logic = gui.getLogic();
IFilterRuleType rule = logic.getRule(facing);
ToolTip tooltip = new ToolTip();
tooltip.add(getName(rule));
return tooltip;
}
use of forestry.api.genetics.IFilterLogic in project ForestryMC by ForestryMC.
the class RuleWidget method draw.
@Override
public void draw(int startX, int startY) {
int x = xPos + startX;
int y = yPos + startY;
IFilterLogic logic = gui.getLogic();
IFilterRuleType rule = logic.getRule(facing);
draw(manager.gui, rule, x, y);
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
if (this.gui.selection.isSame(this)) {
textureManager.bindTexture(SelectionWidget.TEXTURE);
gui.drawTexturedModalRect(x - 1, y - 1, 212, 0, 18, 18);
}
}
use of forestry.api.genetics.IFilterLogic in project ForestryMC by ForestryMC.
the class SpeciesWidget method onSelect.
@Override
public void onSelect(@Nullable IAlleleSpecies selectable) {
IFilterLogic logic = gui.getLogic();
if (logic.setGenomeFilter(facing, index, active, selectable)) {
logic.sendToServer(facing, (short) index, active, selectable);
}
if (gui.selection.isSame(this)) {
gui.onModuleClick(this);
}
SoundUtil.playButtonClick();
}
use of forestry.api.genetics.IFilterLogic in project ForestryMC by ForestryMC.
the class SpeciesWidget method getToolTip.
@Nullable
@Override
public ToolTip getToolTip(int mouseX, int mouseY) {
IFilterLogic logic = gui.getLogic();
IAlleleSpecies allele = (IAlleleSpecies) logic.getGenomeFilter(facing, index, active);
if (allele == null) {
return null;
}
ToolTip tooltip = new ToolTip();
tooltip.add(getName(allele));
return tooltip;
}
use of forestry.api.genetics.IFilterLogic in project ForestryMC by ForestryMC.
the class RuleWidget method onSelect.
@Override
public void onSelect(IFilterRuleType selectable) {
IFilterLogic logic = gui.getLogic();
if (logic.setRule(facing, selectable)) {
logic.sendToServer(facing, selectable);
}
if (gui.selection.isSame(this)) {
gui.onModuleClick(this);
}
SoundUtil.playButtonClick();
}
Aggregations