2211
This commit is contained in:
parent
abb9b5102f
commit
92ca6548c6
49 changed files with 405 additions and 332 deletions
|
@ -14,6 +14,8 @@ import techreborn.init.ModBlocks;
|
|||
import techreborn.init.ModItems;
|
||||
import techreborn.pda.pages.*;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiManual extends GuiScreen {
|
||||
|
||||
|
@ -149,8 +151,8 @@ public class GuiManual extends GuiScreen {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void mouseMovedOrUp(int par1, int par2, int par3) {
|
||||
root.mouseMovedOrUp(par1, par2, par3);
|
||||
protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) {
|
||||
root.mouseMovedOrUp(mouseX, mouseY, clickedMouseButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -159,7 +161,7 @@ public class GuiManual extends GuiScreen {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void handleInput() {
|
||||
public void handleInput() throws IOException {
|
||||
super.handleInput();
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ import net.minecraft.util.ResourceLocation;
|
|||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.pda.PageCollection;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class BasePage extends GuiScreen {
|
||||
|
||||
//Name used to reference the page
|
||||
|
@ -90,12 +92,7 @@ public class BasePage extends GuiScreen {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void mouseMovedOrUp(int par1, int par2, int par3) {
|
||||
super.mouseMovedOrUp(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int par1, int par2, int par3) {
|
||||
public void mouseClicked(int par1, int par2, int par3) throws IOException {
|
||||
super.mouseClicked(par1, par2, par3);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.resources.model.ModelManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.*;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
@ -25,7 +26,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
public class CraftingInfoPage extends TitledPage {
|
||||
protected static RenderItem itemRenderer = new RenderItem();
|
||||
protected static RenderItem itemRenderer = new RenderItem(Minecraft.getMinecraft().getTextureManager(), new ModelManager(Minecraft.getMinecraft().getTextureMapBlocks()));
|
||||
public ItemStack result;
|
||||
private boolean isSmelting = false;
|
||||
private ItemStack[] recipe = new ItemStack[9];
|
||||
|
@ -160,7 +161,7 @@ public class CraftingInfoPage extends TitledPage {
|
|||
|
||||
protected void drawItemStackTooltip(ItemStack stack, int x, int y) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
FontRenderer font = Objects.firstNonNull(stack.getItem().getFontRenderer(stack), mc.fontRenderer);
|
||||
FontRenderer font = Objects.firstNonNull(stack.getItem().getFontRenderer(stack), mc.fontRendererObj);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> list = stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips);
|
||||
|
@ -183,9 +184,9 @@ public class CraftingInfoPage extends TitledPage {
|
|||
GL11.glEnable(GL11.GL_NORMALIZE);
|
||||
FontRenderer font = null;
|
||||
if (par1ItemStack != null) font = par1ItemStack.getItem().getFontRenderer(par1ItemStack);
|
||||
if (font == null) font = Minecraft.getMinecraft().fontRenderer;
|
||||
itemRenderer.renderItemAndEffectIntoGUI(font, Minecraft.getMinecraft().getTextureManager(), par1ItemStack, par2, par3);
|
||||
itemRenderer.renderItemOverlayIntoGUI(font, Minecraft.getMinecraft().getTextureManager(), par1ItemStack, par2, par3, par4Str);
|
||||
if (font == null) font = Minecraft.getMinecraft().fontRendererObj;
|
||||
itemRenderer.renderItemAndEffectIntoGUI(par1ItemStack, par2, par3);
|
||||
itemRenderer.renderItemOverlayIntoGUI(font, par1ItemStack, par2, par3, par4Str);
|
||||
this.zLevel = 0.0F;
|
||||
itemRenderer.zLevel = 0.0F;
|
||||
}
|
||||
|
@ -208,7 +209,7 @@ public class CraftingInfoPage extends TitledPage {
|
|||
|
||||
}
|
||||
|
||||
Iterator iterator = FurnaceRecipes.smelting().getSmeltingList().entrySet().iterator();
|
||||
Iterator iterator = FurnaceRecipes.instance().getSmeltingList().entrySet().iterator();
|
||||
Map.Entry entry;
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
|
|
|
@ -17,6 +17,6 @@ public class TitledPage extends BasePage {
|
|||
@Override
|
||||
public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
if (title == null) title = INDEX_NAME;
|
||||
if (drawTitle) drawCenteredString(minecraft.fontRenderer, ttl(title), offsetX + 128, offsetY + 5, colour);
|
||||
if (drawTitle) drawCenteredString(minecraft.fontRendererObj, ttl(title), offsetX + 128, offsetY + 5, colour);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,14 +35,14 @@ public class VersionPage extends TitledPage {
|
|||
|
||||
public void addDescription(Minecraft minecraft, int offsetX, int offsetY) {
|
||||
GL11.glPushMatrix();
|
||||
this.drawCenteredString(minecraft.fontRenderer, "INSTALLED VERSION " + ModInfo.MOD_VERSION, offsetX + 120, offsetY + 20, 7777777);
|
||||
this.drawCenteredString(minecraft.fontRenderer, "LATEST VERSION " + "TODO", offsetX + 120, offsetY + 40, 7777777);
|
||||
this.drawCenteredString(minecraft.fontRendererObj, "INSTALLED VERSION " + ModInfo.MOD_VERSION, offsetX + 120, offsetY + 20, 7777777);
|
||||
this.drawCenteredString(minecraft.fontRendererObj, "LATEST VERSION " + "TODO", offsetX + 120, offsetY + 40, 7777777);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void addChangelog(Minecraft minecraft, int offsetX, int offsetY) {
|
||||
GL11.glPushMatrix();
|
||||
this.drawCenteredString(minecraft.fontRenderer, "CHANGELOG", offsetX + 120, getYMin() + 50, 7777777);
|
||||
this.drawCenteredString(minecraft.fontRendererObj, "CHANGELOG", offsetX + 120, getYMin() + 50, 7777777);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class VersionPage extends TitledPage {
|
|||
|
||||
int y = offsetY + 105;
|
||||
for (String change : changeLog) {
|
||||
drawCenteredString(minecraft.fontRenderer, change, offsetX + 230, y, Color.white.getRGB());
|
||||
drawCenteredString(minecraft.fontRendererObj, change, offsetX + 230, y, Color.white.getRGB());
|
||||
y += 10;
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
|
|
@ -15,11 +15,11 @@ public class GuiButtonAHeight extends GuiButton {
|
|||
@Override
|
||||
public void drawButton(Minecraft minecraft, int mouseX, int mouseY) {
|
||||
if (this.visible) {
|
||||
FontRenderer fontrenderer = minecraft.fontRenderer;
|
||||
FontRenderer fontrenderer = minecraft.fontRendererObj;
|
||||
minecraft.getTextureManager().bindTexture(buttonTextures);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
int k = this.getHoverState(this.field_146123_n);
|
||||
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
int k = this.getHoverState(this.hovered);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
@ -39,7 +39,7 @@ public class GuiButtonAHeight extends GuiButton {
|
|||
l = packedFGColour;
|
||||
} else if (!this.enabled) {
|
||||
l = 10526880;
|
||||
} else if (this.field_146123_n) {
|
||||
} else if (this.hovered) {
|
||||
l = 16777120;
|
||||
}
|
||||
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
|
||||
|
|
|
@ -46,13 +46,13 @@ public class GuiButtonCustomTexture extends GuiButtonExt {
|
|||
GL11.glEnable(32826);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, itemstack, this.xPosition, this.yPosition);
|
||||
this.drawString(mc.fontRenderer, this.NAME, this.xPosition + 20, this.yPosition + 3, Color.white.getRGB());
|
||||
//RenderItem.getInstance().renderItemIntoGUI(mc.fontRendererObj, mc.renderEngine, itemstack, this.xPosition, this.yPosition); //TODO 1.8
|
||||
this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3, Color.white.getRGB());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getIsHovering() {
|
||||
return field_146123_n;
|
||||
return hovered;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@ public class GuiButtonTextOnly extends GuiButton {
|
|||
@Override
|
||||
public void drawButton(Minecraft minecraft, int mouseX, int mouseY) {
|
||||
if (this.visible) {
|
||||
FontRenderer fontrenderer = minecraft.fontRenderer;
|
||||
FontRenderer fontrenderer = minecraft.fontRendererObj;
|
||||
minecraft.getTextureManager().bindTexture(buttonTextures);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
@ -33,7 +33,7 @@ public class GuiButtonTextOnly extends GuiButton {
|
|||
this.mouseDragged(minecraft, mouseX, mouseY);
|
||||
|
||||
String trimmedDisplayString = displayString;
|
||||
if (fontrenderer.getStringWidth(displayString) > width + 30 && !this.field_146123_n) {
|
||||
if (fontrenderer.getStringWidth(displayString) > width + 30 && !this.hovered) {
|
||||
int energencyBreak = 0;
|
||||
while (fontrenderer.getStringWidth(trimmedDisplayString) * 0.7 > width - 5) {
|
||||
trimmedDisplayString = trimmedDisplayString.substring(0, trimmedDisplayString.length() - 1);
|
||||
|
@ -43,7 +43,7 @@ public class GuiButtonTextOnly extends GuiButton {
|
|||
trimmedDisplayString += "...";
|
||||
}
|
||||
|
||||
if (this.field_146123_n) {
|
||||
if (this.hovered) {
|
||||
trimmedDisplayString = EnumChatFormatting.BOLD + "" + EnumChatFormatting.ITALIC + trimmedDisplayString;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(0f, 0f, 0f, 1f);
|
||||
|
@ -58,6 +58,6 @@ public class GuiButtonTextOnly extends GuiButton {
|
|||
}
|
||||
|
||||
public boolean getIsHovering() {
|
||||
return field_146123_n;
|
||||
return hovered;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue