Tidy up
This commit is contained in:
@@ -28,6 +28,13 @@ public class WizardTradeTweaksHandler {
|
|||||||
|
|
||||||
private static final ResourceLocation NEW_SPELL_ICON = new ResourceLocation(Wizardry.MODID, "textures/gui/container/new_spell_indicator.png");
|
private static final ResourceLocation NEW_SPELL_ICON = new ResourceLocation(Wizardry.MODID, "textures/gui/container/new_spell_indicator.png");
|
||||||
|
|
||||||
|
private static final int ICON_WIDTH = 8;
|
||||||
|
private static final int ICON_HEIGHT = 8;
|
||||||
|
|
||||||
|
private static final int ANIMATION_FRAMES = 4;
|
||||||
|
private static final int ANIMATION_FRAME_TIME = 2; // In ticks
|
||||||
|
private static final int ANIMATION_PERIOD = 40; // In frame durations
|
||||||
|
|
||||||
private static int tradeIndex; // Mirrors GuiMerchant#selectedMerchantRecipe (don't want to reflect into it every frame)
|
private static int tradeIndex; // Mirrors GuiMerchant#selectedMerchantRecipe (don't want to reflect into it every frame)
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||||
@@ -93,13 +100,14 @@ public class WizardTradeTweaksHandler {
|
|||||||
|
|
||||||
int x = gui.inventorySlots.getSlot(2).xPos + 14;
|
int x = gui.inventorySlots.getSlot(2).xPos + 14;
|
||||||
int y = gui.inventorySlots.getSlot(2).yPos - 17;
|
int y = gui.inventorySlots.getSlot(2).yPos - 17;
|
||||||
int w = 8;
|
|
||||||
int h = 8;
|
|
||||||
|
|
||||||
RenderHelper.enableGUIStandardItemLighting();
|
RenderHelper.enableGUIStandardItemLighting();
|
||||||
GlStateManager.color(1, 1, 1);
|
GlStateManager.color(1, 1, 1);
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(NEW_SPELL_ICON);
|
Minecraft.getMinecraft().renderEngine.bindTexture(NEW_SPELL_ICON);
|
||||||
DrawingUtils.drawTexturedRect(x, y, 0, Math.max(player.ticksExisted/2 % 40 - 36, 0) * 8, w, h, 8, 32);
|
|
||||||
|
int frame = Math.max(player.ticksExisted/ANIMATION_FRAME_TIME % ANIMATION_PERIOD - (ANIMATION_PERIOD - ANIMATION_FRAMES), 0);
|
||||||
|
DrawingUtils.drawTexturedRect(x, y, 0, frame * ICON_HEIGHT, ICON_WIDTH, ICON_HEIGHT, ICON_WIDTH, ICON_HEIGHT * ANIMATION_FRAMES);
|
||||||
|
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
|
|
||||||
// int mouseX = event.getMouseX() - gui.getGuiLeft();
|
// int mouseX = event.getMouseX() - gui.getGuiLeft();
|
||||||
|
|||||||
Reference in New Issue
Block a user