this doesn't compile yet, but have something to peek at
This commit is contained in:
parent
973f1019a5
commit
5fcdd978d7
329 changed files with 3247 additions and 2953 deletions
|
@ -1,17 +1,13 @@
|
|||
package WayofTime.bloodmagic.client.hud;
|
||||
|
||||
import WayofTime.bloodmagic.util.handler.event.ClientHandler;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public abstract class HUDElement
|
||||
{
|
||||
|
||||
|
@ -52,12 +48,32 @@ public abstract class HUDElement
|
|||
float f = 0.00390625F;
|
||||
float f1 = 0.00390625F;
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
VertexBuffer vertexbuffer = tessellator.getBuffer();
|
||||
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||
vertexbuffer.pos((double) (x + 0), (double) (y + height), 0).tex((double) ((float) (textureX + 0) * f), (double) ((float) (textureY + height) * f1)).endVertex();
|
||||
vertexbuffer.pos((double) (x + width), (double) (y + height), 0).tex((double) ((float) (textureX + width) * f), (double) ((float) (textureY + height) * f1)).endVertex();
|
||||
vertexbuffer.pos((double) (x + width), (double) (y + 0), 0).tex((double) ((float) (textureX + width) * f), (double) ((float) (textureY + 0) * f1)).endVertex();
|
||||
vertexbuffer.pos((double) (x + 0), (double) (y + 0), 0).tex((double) ((float) (textureX + 0) * f), (double) ((float) (textureY + 0) * f1)).endVertex();
|
||||
BufferBuilder buffer = tessellator.getBuffer();
|
||||
buffer.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||
buffer.pos(x + 0, y + height, 0).tex((double) ((float) (textureX + 0) * f), (double) ((float) (textureY + height) * f1)).endVertex();
|
||||
buffer.pos(x + width, y + height, 0).tex((double) ((float) (textureX + width) * f), (double) ((float) (textureY + height) * f1)).endVertex();
|
||||
buffer.pos(x + width, y + 0, 0).tex((double) ((float) (textureX + width) * f), (double) ((float) (textureY + 0) * f1)).endVertex();
|
||||
buffer.pos(x + 0, y + 0, 0).tex((double) ((float) (textureX + 0) * f), (double) ((float) (textureY + 0) * f1)).endVertex();
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
public int getxOffset() {
|
||||
return xOffset;
|
||||
}
|
||||
|
||||
public int getyOffset() {
|
||||
return yOffset;
|
||||
}
|
||||
|
||||
public int getxOffsetDefault() {
|
||||
return xOffsetDefault;
|
||||
}
|
||||
|
||||
public int getyOffsetDefault() {
|
||||
return yOffsetDefault;
|
||||
}
|
||||
|
||||
public RenderGameOverlayEvent.ElementType getElementType() {
|
||||
return elementType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,15 +3,14 @@ package WayofTime.bloodmagic.client.hud;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.proxy.ClientProxy;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
@ -41,7 +40,7 @@ public class HUDElementDemonWillAura extends HUDElement
|
|||
return;
|
||||
}
|
||||
|
||||
minecraft.getTextureManager().bindTexture(new ResourceLocation(Constants.Mod.MODID, "textures/hud/bars.png"));
|
||||
minecraft.getTextureManager().bindTexture(new ResourceLocation(BloodMagic.MODID, "textures/hud/bars.png"));
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F);
|
||||
this.drawTexturedModalRect(getXOffset(), getYOffset(), 0, 105 * 2, 80, 46);
|
||||
|
||||
|
@ -52,7 +51,7 @@ public class HUDElementDemonWillAura extends HUDElement
|
|||
{
|
||||
i++;
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F);
|
||||
minecraft.getTextureManager().bindTexture(new ResourceLocation(Constants.Mod.MODID, "textures/hud/bars.png"));
|
||||
minecraft.getTextureManager().bindTexture(new ResourceLocation(BloodMagic.MODID, "textures/hud/bars.png"));
|
||||
int textureXOffset = (i > 3) ? (i - 3) : (3 - i);
|
||||
int maxBarSize = 30 - 2 * textureXOffset;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.bloodmagic.client.hud;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.item.sigil.ItemSigilHolding;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
import WayofTime.bloodmagic.registry.RegistrarBloodMagicItems;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
|
@ -28,15 +28,15 @@ public class HUDElementHolding extends HUDElement
|
|||
{
|
||||
ItemStack sigilHolding = minecraft.player.getHeldItemMainhand();
|
||||
// Check mainhand for Sigil of Holding
|
||||
if (!(sigilHolding.getItem() == ModItems.SIGIL_HOLDING))
|
||||
if (!(sigilHolding.getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING))
|
||||
sigilHolding = minecraft.player.getHeldItemOffhand();
|
||||
// Check offhand for Sigil of Holding
|
||||
if (!(sigilHolding.getItem() == ModItems.SIGIL_HOLDING))
|
||||
if (!(sigilHolding.getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING))
|
||||
return;
|
||||
|
||||
Gui ingameGui = minecraft.ingameGUI;
|
||||
|
||||
minecraft.getTextureManager().bindTexture(new ResourceLocation(Constants.Mod.MODID, "textures/gui/widgets.png"));
|
||||
minecraft.getTextureManager().bindTexture(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"));
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F);
|
||||
ingameGui.drawTexturedModalRect(resolution.getScaledWidth() / 2 + 100 + getXOffset(), resolution.getScaledHeight() - 22 + getYOffset(), 0, 0, 102, 22);
|
||||
int currentSlot = ItemSigilHolding.getCurrentItemOrdinal(sigilHolding);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue