Search in sources :

Example 1 with IFilterLogic

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;
}
Also used : ToolTip(forestry.core.gui.tooltips.ToolTip) IFilterRuleType(forestry.api.genetics.IFilterRuleType) IFilterLogic(forestry.api.genetics.IFilterLogic)

Example 2 with IFilterLogic

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);
    }
}
Also used : IFilterRuleType(forestry.api.genetics.IFilterRuleType) TextureManager(net.minecraft.client.renderer.texture.TextureManager) IFilterLogic(forestry.api.genetics.IFilterLogic)

Example 3 with IFilterLogic

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();
}
Also used : IFilterLogic(forestry.api.genetics.IFilterLogic)

Example 4 with IFilterLogic

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;
}
Also used : ToolTip(forestry.core.gui.tooltips.ToolTip) IFilterLogic(forestry.api.genetics.IFilterLogic) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) Nullable(javax.annotation.Nullable)

Example 5 with IFilterLogic

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();
}
Also used : IFilterLogic(forestry.api.genetics.IFilterLogic)

Aggregations

IFilterLogic (forestry.api.genetics.IFilterLogic)6 IAlleleSpecies (forestry.api.genetics.IAlleleSpecies)2 IFilterRuleType (forestry.api.genetics.IFilterRuleType)2 ToolTip (forestry.core.gui.tooltips.ToolTip)2 TextureManager (net.minecraft.client.renderer.texture.TextureManager)2 Nullable (javax.annotation.Nullable)1