Search in sources :

Example 1 with ComponentRenderer

use of com.infinityraider.agricraft.gui.component.ComponentRenderer in project AgriCraft by AgriCraft.

the class GuiJournal method addNavArrows.

private void addNavArrows() {
    GuiComponent leftArrow = new GuiComponentBuilder<>(LEFT_ARROW, 1, 170, 32, 32).setRenderAction(ComponentRenderer::renderIconComponent).setMouseEnterAction((c, p) -> c.setVisable(this.currentPageNumber > 0)).setMouseLeaveAction((c, p) -> c.setVisable(false)).setMouseClickAction((c, p) -> incPage(-1)).setVisable(false).build();
    GuiComponent rightArrow = new GuiComponentBuilder<>(RIGHT_ARROW, 223, 170, 32, 32).setRenderAction(ComponentRenderer::renderIconComponent).setMouseEnterAction((c, p) -> c.setVisable(this.currentPageNumber < this.getNumberOfPages() - 1)).setMouseLeaveAction((c, p) -> c.setVisable(false)).setMouseClickAction((c, p) -> incPage(1)).setVisable(false).build();
    this.addComponent(leftArrow);
    this.addComponent(rightArrow);
}
Also used : GuiComponentBuilder(com.infinityraider.agricraft.gui.component.GuiComponentBuilder) IAgriPlant(com.infinityraider.agricraft.api.v1.plant.IAgriPlant) ComponentRenderer(com.infinityraider.agricraft.gui.component.ComponentRenderer) MathHelper(com.agricraft.agricore.util.MathHelper) ArrayList(java.util.ArrayList) GuiComponent(com.infinityraider.agricraft.gui.component.GuiComponent) ItemStack(net.minecraft.item.ItemStack) ItemJournal(com.infinityraider.agricraft.items.ItemJournal) List(java.util.List) Side(net.minecraftforge.fml.relauncher.Side) AgriGuiWrapper(com.infinityraider.agricraft.gui.AgriGuiWrapper) ResourceLocation(net.minecraft.util.ResourceLocation) ComponentGui(com.infinityraider.agricraft.gui.ComponentGui) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) GuiComponentBuilder(com.infinityraider.agricraft.gui.component.GuiComponentBuilder) GuiComponent(com.infinityraider.agricraft.gui.component.GuiComponent)

Aggregations

MathHelper (com.agricraft.agricore.util.MathHelper)1 IAgriPlant (com.infinityraider.agricraft.api.v1.plant.IAgriPlant)1 AgriGuiWrapper (com.infinityraider.agricraft.gui.AgriGuiWrapper)1 ComponentGui (com.infinityraider.agricraft.gui.ComponentGui)1 ComponentRenderer (com.infinityraider.agricraft.gui.component.ComponentRenderer)1 GuiComponent (com.infinityraider.agricraft.gui.component.GuiComponent)1 GuiComponentBuilder (com.infinityraider.agricraft.gui.component.GuiComponentBuilder)1 ItemJournal (com.infinityraider.agricraft.items.ItemJournal)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ItemStack (net.minecraft.item.ItemStack)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 Side (net.minecraftforge.fml.relauncher.Side)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1