From 208b1f1e0d5faf601b53818b04f6699b2e6cb6bc Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Tue, 5 May 2015 22:07:10 +0100 Subject: - Working on a GUI showing what curses you get with a description on them - Added a search bar in the Liquids Tab for easier searching - Fixed an issue with golden objects giving errors due to missing default texture - Improved the Infamy Mask to have less parts, thus causing less lag - Improved ingots and ore detection - Fixed certain ores when smelted outputting a different ingot - Necklaces and Rings now render as well - Updated the guide at the Guide item to have the proper link to the mod as well as mention the right people who helped with it - Added a list of the ores that work in the guide - Added a new tab to the guide regarding the ores and the ingots they create - Changed the stun effect caused by rings with feathers as modifiers to be a potion effect instead --- .../jewelrycraft/client/gui/GuiCurseInfo.java | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java (limited to 'src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java') diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java new file mode 100644 index 0000000..5489911 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java @@ -0,0 +1,58 @@ +package darkknight.jewelrycraft.client.gui; + +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.api.Curse; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketSendServerPlayersInfo; +import darkknight.jewelrycraft.util.PlayerUtils; +import darkknight.jewelrycraft.util.Variables; + +public class GuiCurseInfo extends GuiScreen +{ + World world; + EntityPlayer player; + + public GuiCurseInfo(Container container, World world, EntityPlayer player) + { + super(); + this.world = world; + this.player = player; + } + + public void drawScreen(int x, int y, float size) + { + super.drawScreen(x, y, size); + this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680); + int ind = 0; + if (player != null){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); + if (!playerInfo.hasNoTags()){ + for(Curse curse: Curse.getCurseList()) + if (playerInfo.getInteger(curse.getName()) > 0){ + int halfDescrSize = fontRendererObj.getStringWidth(curse.getDescription()) / 2; + mc.renderEngine.bindTexture(Variables.MISC_TEXTURE); + this.drawRect(0, 12 + ind * 34, this.width, 10 + (ind + 1) * 34, 0xff000000); + mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png")); + int tag = curse.getTextureID(); + GL11.glColor3f(1F, 1F, 1F); + drawTexturedModalRect(this.width/2 - halfDescrSize - 35, 12 + ind * 34, tag % 8 * 32, tag / 8 * 32, 32, 32); + this.drawString(fontRendererObj, curse.getName().substring(curse.getName().indexOf(':') + 1), this.width/2 - halfDescrSize, 20 + ind * 34, 0xffff00); + this.drawCenteredString(fontRendererObj, curse.getDescription(), this.width/2, 30 + ind * 34, 0xffffff); + ind++; + } + } + } + } +} \ No newline at end of file -- cgit v1.2.3