Revert "Added code formatter"

This reverts commit b9448d5d90.
This commit is contained in:
modmuss50 2016-03-24 00:41:47 +00:00
parent b9448d5d90
commit 33985f1a31
444 changed files with 26235 additions and 32364 deletions

View file

@ -1,22 +1,22 @@
package techreborn.manual.util;
import java.util.List;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
@SideOnly(Side.CLIENT)
public class ButtonUtil
public class ButtonUtil
{
@SideOnly(Side.CLIENT)
public static void addBackButton(int ID, int X, int Y, List buttonList)
{
buttonList.add(new GuiButtonCustomTexture(ID, X, Y, 50, 60, 17, 12, "button", "", "", 0, 11, 10, 16));
buttonList.add(new GuiButtonCustomTexture(ID, X, Y, 50, 60, 17, 12, "button", "", "", 0, 11, 10, 16));
}
@SideOnly(Side.CLIENT)
public static void addNextButton(int ID, int X, int Y, List buttonList)
{
buttonList.add(new GuiButtonCustomTexture(ID, X, Y, 50, 60, 17, 12, "button", "", "", 0, 1, 10, 17));
buttonList.add(new GuiButtonCustomTexture(ID, X, Y, 50, 60, 17, 12, "button", "", "", 0, 1, 10, 17));
}
}

View file

@ -4,59 +4,45 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper;
import org.lwjgl.opengl.GL11;
public class GuiButtonAHeight extends GuiButton
{
public class GuiButtonAHeight extends GuiButton {
public GuiButtonAHeight(int id, int xPos, int yPos, int width, int hight, String displayString)
{
super(id, xPos, yPos, width, hight, displayString);
}
public GuiButtonAHeight(int id, int xPos, int yPos, int width, int hight, String displayString) {
super(id, xPos, yPos, width, hight, displayString);
}
@Override
public void drawButton(Minecraft minecraft, int mouseX, int mouseY)
{
if (this.visible)
{
FontRenderer fontrenderer = minecraft.fontRendererObj;
minecraft.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
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);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2,
46 + k * 20, this.width / 2, this.height);
@Override
public void drawButton(Minecraft minecraft, int mouseX, int mouseY) {
if (this.visible) {
FontRenderer fontrenderer = minecraft.fontRendererObj;
minecraft.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
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);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height);
if (this.height < 20)
{
this.drawTexturedModalRect(xPosition, yPosition + 3, 0, (46 + k * 20) + 20 - height + 3, width / 2,
height - 3);
this.drawTexturedModalRect(xPosition + width / 2, yPosition + 3, 200 - width / 2,
(46 + k * 20) + 20 - height + 3, width / 2, height - 3);
}
if (this.height < 20) {
this.drawTexturedModalRect(xPosition, yPosition + 3, 0, (46 + k * 20) + 20 - height + 3, width / 2, height - 3);
this.drawTexturedModalRect(xPosition + width / 2, yPosition + 3, 200 - width / 2, (46 + k * 20) + 20 - height + 3, width / 2, height - 3);
}
this.mouseDragged(minecraft, mouseX, mouseY);
int l = 14737632;
this.mouseDragged(minecraft, mouseX, mouseY);
int l = 14737632;
if (packedFGColour != 0)
{
l = packedFGColour;
} else if (!this.enabled)
{
l = 10526880;
} else if (this.hovered)
{
l = 16777120;
}
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2,
this.yPosition + (this.height - 8) / 2, l);
}
}
if (packedFGColour != 0) {
l = packedFGColour;
} else if (!this.enabled) {
l = 10526880;
} else if (this.hovered) {
l = 16777120;
}
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
}
}
}

View file

@ -1,22 +1,21 @@
package techreborn.manual.util;
import java.awt.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.config.GuiButtonExt;
import org.lwjgl.opengl.GL11;
import java.awt.*;
public class GuiButtonCustomTexture extends GuiButtonExt
{
public int textureU;
public int textureV;
public String texturename;
public String LINKED_PAGE;
public String NAME;
public int textureU;
public int textureV;
public String texturename;
public String LINKED_PAGE;
public String NAME;
public String imageprefix = "techreborn:textures/manual/elements/";
public int buttonHeight;
public int buttonWidth;
@ -25,53 +24,52 @@ public class GuiButtonCustomTexture extends GuiButtonExt
public int textureH;
public int textureW;
public GuiButtonCustomTexture(int id, int xPos, int yPos, int u, int v, int buttonWidth, int buttonHeight,
String texturename, String linkedPage, String name, int buttonU, int buttonV, int textureH, int textureW)
{
super(id, xPos, yPos, buttonWidth, buttonHeight, "_");
this.textureU = u;
this.textureV = v;
this.texturename = texturename;
this.NAME = name;
this.LINKED_PAGE = linkedPage;
this.buttonHeight = height;
this.buttonWidth = width;
this.buttonU = buttonU;
this.buttonV = buttonV;
this.textureH = textureH;
this.textureW = textureW;
}
public GuiButtonCustomTexture(int id, int xPos, int yPos, int u, int v, int buttonWidth, int buttonHeight, String texturename, String linkedPage, String name, int buttonU, int buttonV, int textureH, int textureW)
{
super(id, xPos, yPos, buttonWidth, buttonHeight, "_");
this.textureU = u;
this.textureV = v;
this.texturename = texturename;
this.NAME = name;
this.LINKED_PAGE = linkedPage;
this.buttonHeight = height;
this.buttonWidth = width;
this.buttonU = buttonU;
this.buttonV = buttonV;
this.textureH = textureH;
this.textureW = textureW;
}
public void drawButton(Minecraft mc, int mouseX, int mouseY)
{
if (this.visible)
{
boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition
&& mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
mc.getTextureManager().bindTexture(buttonTextures);
int u = textureU;
int v = textureV;
public void drawButton(Minecraft mc, int mouseX, int mouseY)
{
if (this.visible)
{
boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
mc.getTextureManager().bindTexture(buttonTextures);
int u = textureU;
int v = textureV;
if (flag)
{
u += width;
GL11.glPushMatrix();
GL11.glColor4f(0f, 0f, 0f, 1f);
this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height);
GL11.glPopMatrix();
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(32826);
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
renderImage(this.xPosition, this.yPosition);
this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3,
Color.white.getRGB());
}
}
public void renderImage(int offsetX, int offsetY)
{
if (flag)
{
u += width;
GL11.glPushMatrix();
GL11.glColor4f(0f, 0f, 0f, 1f);
this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height);
GL11.glPopMatrix();
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(32826);
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
renderImage(this.xPosition, this.yPosition);
this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3, Color.white.getRGB());
}
}
public void renderImage(int offsetX, int offsetY)
{
TextureManager render = Minecraft.getMinecraft().renderEngine;
render.bindTexture(new ResourceLocation(imageprefix + this.texturename + ".png"));
@ -80,10 +78,10 @@ public class GuiButtonCustomTexture extends GuiButtonExt
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(offsetX, offsetY, this.buttonU, this.buttonV, this.textureW, this.textureH);
GL11.glDisable(GL11.GL_BLEND);
}
}
public boolean getIsHovering()
{
return hovered;
}
public boolean getIsHovering()
{
return hovered;
}
}

View file

@ -1,67 +1,59 @@
package techreborn.manual.util;
import java.awt.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.client.config.GuiButtonExt;
import org.lwjgl.opengl.GL11;
public class GuiButtonItemTexture extends GuiButtonExt
{
import java.awt.*;
public int textureU;
public int textureV;
public ItemStack itemstack;
public String LINKED_PAGE;
public String NAME;
public class GuiButtonItemTexture extends GuiButtonExt {
public GuiButtonItemTexture(int id, int xPos, int yPos, int u, int v, int width, int height, ItemStack stack,
String linkedPage, String name)
{
super(id, xPos, yPos, width, height, "_");
textureU = u;
textureV = v;
itemstack = stack;
NAME = name;
this.LINKED_PAGE = linkedPage;
}
public int textureU;
public int textureV;
public ItemStack itemstack;
public String LINKED_PAGE;
public String NAME;
public void drawButton(Minecraft mc, int mouseX, int mouseY)
{
if (this.visible)
{
boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
mc.getTextureManager().bindTexture(buttonTextures);
int u = textureU;
int v = textureV;
public GuiButtonItemTexture(int id, int xPos, int yPos, int u, int v, int width, int height, ItemStack stack, String linkedPage, String name) {
super(id, xPos, yPos, width, height, "_");
textureU = u;
textureV = v;
itemstack = stack;
NAME = name;
this.LINKED_PAGE = linkedPage;
}
if (flag)
{
u += width;
GL11.glPushMatrix();
GL11.glColor4f(0f, 0f, 0f, 1f);
this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height);
GL11.glPopMatrix();
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(32826);
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if (this.visible) {
boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition
&& mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
mc.getTextureManager().bindTexture(buttonTextures);
int u = textureU;
int v = textureV;
if (flag) {
u += width;
GL11.glPushMatrix();
GL11.glColor4f(0f, 0f, 0f, 1f);
this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height);
GL11.glPopMatrix();
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(32826);
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
itemRenderer.renderItemIntoGUI(itemstack, this.xPosition, this.yPosition);
this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3,
Color.white.getRGB());
}
}
this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3, Color.white.getRGB());
}
}
public boolean getIsHovering()
{
return hovered;
}
public boolean getIsHovering() {
return hovered;
}
}

View file

@ -1,77 +1,63 @@
package techreborn.manual.util;
import java.awt.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.util.text.TextFormatting;
import org.lwjgl.opengl.GL11;
public class GuiButtonTextOnly extends GuiButton
{
public String LINKED_PAGE;
public int textColour;
import java.awt.*;
public GuiButtonTextOnly(int id, int xPos, int yPos, int width, int hight, String displayString, String linkedPage,
int colour)
{
super(id, xPos, yPos, width, hight, displayString);
this.LINKED_PAGE = linkedPage;
this.textColour = colour;
}
public class GuiButtonTextOnly extends GuiButton {
public String LINKED_PAGE;
public int textColour;
@Override
public void drawButton(Minecraft minecraft, int mouseX, int mouseY)
{
if (this.visible)
{
FontRenderer fontrenderer = minecraft.fontRendererObj;
minecraft.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
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);
public GuiButtonTextOnly(int id, int xPos, int yPos, int width, int hight, String displayString, String linkedPage, int colour) {
super(id, xPos, yPos, width, hight, displayString);
this.LINKED_PAGE = linkedPage;
this.textColour = colour;
}
this.mouseDragged(minecraft, mouseX, mouseY);
@Override
public void drawButton(Minecraft minecraft, int mouseX, int mouseY) {
if (this.visible) {
FontRenderer fontrenderer = minecraft.fontRendererObj;
minecraft.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
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);
String trimmedDisplayString = displayString;
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);
energencyBreak++;
if (energencyBreak > 100)
break;
}
trimmedDisplayString += "...";
}
this.mouseDragged(minecraft, mouseX, mouseY);
if (this.hovered)
{
trimmedDisplayString = TextFormatting.BOLD + "" + TextFormatting.ITALIC + trimmedDisplayString;
GL11.glPushMatrix();
GL11.glColor4f(0f, 0f, 0f, 1f);
drawTexturedModalRect(xPosition + (int) (xPosition * 0.01), yPosition + (int) (yPosition * 0.01), 0, 46,
(int) (fontrenderer.getStringWidth(trimmedDisplayString) * 0.72) + 2, 8);
GL11.glPopMatrix();
}
GL11.glPushMatrix();
GL11.glScalef(0.7F, 0.7F, 1);
fontrenderer.drawString(trimmedDisplayString, (int) (xPosition * 1.45),
(int) ((yPosition + (height - 8) / 2) * 1.45), Color.WHITE.getRGB());
GL11.glPopMatrix();
}
}
String trimmedDisplayString = displayString;
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);
energencyBreak++;
if (energencyBreak > 100) break;
}
trimmedDisplayString += "...";
}
public boolean getIsHovering()
{
return hovered;
}
if (this.hovered) {
trimmedDisplayString = TextFormatting.BOLD + "" + TextFormatting.ITALIC + trimmedDisplayString;
GL11.glPushMatrix();
GL11.glColor4f(0f, 0f, 0f, 1f);
drawTexturedModalRect(xPosition + (int) (xPosition * 0.01), yPosition + (int) (yPosition * 0.01), 0, 46, (int) (fontrenderer.getStringWidth(trimmedDisplayString) * 0.72) + 2, 8);
GL11.glPopMatrix();
}
GL11.glPushMatrix();
GL11.glScalef(0.7F, 0.7F, 1);
fontrenderer.drawString(trimmedDisplayString, (int) (xPosition * 1.45), (int) ((yPosition + (height - 8) / 2) * 1.45), Color.WHITE.getRGB());
GL11.glPopMatrix();
}
}
public boolean getIsHovering() {
return hovered;
}
}