mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-17 19:15:05 +00:00
Fully Fleshed out Functionality and GUI. Having some small issues with the paritcleFX, but not huge deal right now. Would be nice to have, but crashes make people even sadder.
This commit is contained in:
1 parent
e5cea4e3dd
commit
729908b1b0
6 files changed
+542
-82
No files matched your search
@@ -3,26 +3,38 @@ package magicbees.client.gui;
|
||||
import magicbees.item.ItemBeeRing;
|
||||
import magicbees.itemInventories.InventoryBeeRing;
|
||||
import magicbees.main.CommonProxy;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GUIEffectRing extends GuiContainer {
|
||||
|
||||
|
||||
public static final String BACKGROUND_FILE = "jarScreen.png";
|
||||
public static final ResourceLocation BACKGROUND_LOCATION = new ResourceLocation(
|
||||
CommonProxy.DOMAIN,
|
||||
CommonProxy.GUI_TEXTURE + "jarScreen.png");
|
||||
CommonProxy.DOMAIN,
|
||||
CommonProxy.GUI_TEXTURE + "jarScreen.png");
|
||||
|
||||
private static final int WIDTH = 176;
|
||||
private static final int HEIGHT = 156;
|
||||
|
||||
private static final int BAR_DEST_X = 117;
|
||||
private static final int BAR_DEST_Y = 10;
|
||||
|
||||
private static final int BAR_SRC_X = 176;
|
||||
private static final int BAR_SRC_Y = 0;
|
||||
|
||||
private static final int BAR_WIDTH = 10;
|
||||
private static final int BAR_HEIGHT = 40;
|
||||
|
||||
public GUIEffectRing(ItemStack itemStack, EntityPlayer player) {
|
||||
super(new ContainerEffectRing((InventoryBeeRing) ItemBeeRing.getInventory(player, itemStack), player));
|
||||
super(
|
||||
new ContainerEffectRing(
|
||||
ItemBeeRing.getInventory(player, itemStack, player.inventory.currentItem, false),
|
||||
player));
|
||||
this.xSize = WIDTH;
|
||||
this.ySize = HEIGHT;
|
||||
}
|
||||
@@ -39,5 +51,21 @@ public class GUIEffectRing extends GuiContainer {
|
||||
this.mc.getTextureManager().bindTexture(BACKGROUND_LOCATION);
|
||||
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
InventoryBeeRing IBR = ((ContainerEffectRing) this.inventorySlots).IBR;
|
||||
float r = ((IBR.currentBeeColour >> 16) & 255) / 255f;
|
||||
float g = ((IBR.currentBeeColour >> 8) & 255) / 255f;
|
||||
float b = (IBR.currentBeeColour & 255) / 255f;
|
||||
|
||||
GL11.glColor3f(r, g, b);
|
||||
|
||||
int value = BAR_HEIGHT - (IBR.currentBeeHealth * BAR_HEIGHT) / 100;
|
||||
this.drawTexturedModalRect(
|
||||
this.guiLeft + BAR_DEST_X,
|
||||
this.guiTop + value + BAR_DEST_Y,
|
||||
BAR_SRC_X,
|
||||
BAR_SRC_Y,
|
||||
BAR_WIDTH,
|
||||
BAR_HEIGHT - value);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user