diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2018-12-22 13:17:31 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2018-12-22 13:17:31 +0800 |
| commit | 15f6cc9eb567b6ef685bc6c1a6f3364270300914 (patch) | |
| tree | 3c2911284faccd10f97e3aa307719ec12efd4b53 /src/main/java/me/shedaniel/gui/widget/WidgetArrow.java | |
| parent | 449fc73beb20ceda44a12422129151a88306fac8 (diff) | |
| download | RoughlyEnoughItems-15f6cc9eb567b6ef685bc6c1a6f3364270300914.tar.gz RoughlyEnoughItems-15f6cc9eb567b6ef685bc6c1a6f3364270300914.tar.bz2 RoughlyEnoughItems-15f6cc9eb567b6ef685bc6c1a6f3364270300914.zip | |
from aei but like jei now
Diffstat (limited to 'src/main/java/me/shedaniel/gui/widget/WidgetArrow.java')
| -rwxr-xr-x | src/main/java/me/shedaniel/gui/widget/WidgetArrow.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/gui/widget/WidgetArrow.java b/src/main/java/me/shedaniel/gui/widget/WidgetArrow.java new file mode 100755 index 000000000..9cc76738d --- /dev/null +++ b/src/main/java/me/shedaniel/gui/widget/WidgetArrow.java @@ -0,0 +1,38 @@ +package me.shedaniel.gui.widget; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.ResourceLocation; + +public class WidgetArrow extends Control { + private static final ResourceLocation RECIPE_GUI = new ResourceLocation("almostenoughitems", "textures/gui/recipecontainer.png"); + private int progress = 0; + private int updateTick = 0; + private boolean animated; + + public WidgetArrow(int x, int y, boolean animated) { + super(x, y, 22, 18); + this.animated = animated; + } + + @Override + public void draw() { + Minecraft.getInstance().getTextureManager().bindTexture(RECIPE_GUI); + this.drawTexturedModalRect(rect.x, rect.y, 18, 222, 22, 18); + if (animated) { + int width = (int) ((progress / 10f) * 22); + this.drawTexturedModalRect(rect.x - 1, rect.y - 1, 40, 222, width, 18); + } + } + + @Override + public void tick() { + updateTick++; + if (updateTick >= 20) { + updateTick = 0; + + progress++; + if (progress > 10) + progress = 0; + } + } +} |
