mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 06:12:19 +00:00
Made color and alpha components global among ScriptGui classes.
This commit is contained in:
1 parent
be61bd4e17
commit
e5e1aa1972
16 files changed
+168
-98
No files matched your search
@@ -6,7 +6,6 @@
|
||||
package noppes.npcs.client.gui.custom.components;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -23,17 +22,17 @@ public class CustomGuiButton extends GuiButton implements IClickListener {
|
||||
public int textureY;
|
||||
boolean field_146123_n;
|
||||
String label;
|
||||
int colour;
|
||||
String[] hoverText;
|
||||
|
||||
int color;
|
||||
float alpha;
|
||||
|
||||
public CustomGuiButton(int id, String buttonText, int x, int y) {
|
||||
super(id, GuiCustom.guiLeft + x, GuiCustom.guiTop + y, buttonText);
|
||||
this.colour = 16777215;
|
||||
}
|
||||
|
||||
public CustomGuiButton(int id, String buttonText, int x, int y, int width, int height) {
|
||||
super(id, GuiCustom.guiLeft + x, GuiCustom.guiTop + y, width, height, buttonText);
|
||||
this.colour = 16777215;
|
||||
}
|
||||
|
||||
public CustomGuiButton(int buttonId, String buttonText, int x, int y, int width, int height, String texture) {
|
||||
@@ -66,6 +65,9 @@ public class CustomGuiButton extends GuiButton implements IClickListener {
|
||||
btn = new CustomGuiButton(component.getID(), component.getLabel(), component.getPosX(), component.getPosY());
|
||||
}
|
||||
|
||||
btn.color = component.getColor();
|
||||
btn.alpha = component.getAlpha();
|
||||
|
||||
if (component.hasHoverText()) {
|
||||
btn.hoverText = component.getHoverText();
|
||||
}
|
||||
@@ -81,59 +83,59 @@ public class CustomGuiButton extends GuiButton implements IClickListener {
|
||||
//GL11.func_179094_E();
|
||||
//GL11.func_179109_b(0.0F, 0.0F, (float)this.id);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, 0.0F, (float)this.id);
|
||||
FontRenderer fontRenderer = mc.fontRenderer;
|
||||
int i;
|
||||
if (this.texture == null) {
|
||||
mc.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;
|
||||
i = this.getHoverState(this.field_146123_n);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
//GL11.func_187428_a(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA, SourceFactor.ONE, DestFactor.ZERO);
|
||||
//GL11.func_187401_a(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
|
||||
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
|
||||
this.mouseDragged(mc, mouseX, mouseY);
|
||||
int j = 14737632;
|
||||
if (this.packedFGColour != 0) {
|
||||
j = this.packedFGColour;
|
||||
} else if (!this.enabled) {
|
||||
j = 10526880;
|
||||
} else if (this.field_146123_n) {
|
||||
j = 16777120;
|
||||
}
|
||||
float red = (color >> 16 & 255) / 255f;
|
||||
float green = (color >> 8 & 255) / 255f;
|
||||
float blue = (color & 255) / 255f;
|
||||
GL11.glColor4f(red,green,blue,this.alpha);
|
||||
|
||||
GL11.glTranslated(0.0D, 0.0D, 0.1D);
|
||||
this.drawCenteredString(fontRenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, j);
|
||||
} else {
|
||||
mc.getTextureManager().bindTexture(this.texture);
|
||||
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;
|
||||
i = this.hoverState(this.field_146123_n);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
//GL11.func_187428_a(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA, SourceFactor.ONE, DestFactor.ZERO);
|
||||
//GL11.func_187401_a(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, this.textureX, this.textureY + i * this.height, this.width, this.height);
|
||||
this.drawCenteredString(fontRenderer, this.label, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, this.colour);
|
||||
if (this.field_146123_n && this.hoverText != null && this.hoverText.length > 0) {
|
||||
this.parent.hoverText = this.hoverText;
|
||||
}
|
||||
}
|
||||
GL11.glTranslatef(0.0F, 0.0F, (float)this.id);
|
||||
FontRenderer fontRenderer = mc.fontRenderer;
|
||||
int i;
|
||||
if (this.texture == null) {
|
||||
mc.getTextureManager().bindTexture(buttonTextures);
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
i = this.getHoverState(this.field_146123_n);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
//GL11.func_187428_a(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA, SourceFactor.ONE, DestFactor.ZERO);
|
||||
//GL11.func_187401_a(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
|
||||
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
|
||||
this.mouseDragged(mc, mouseX, mouseY);
|
||||
int j = 14737632;
|
||||
if (this.packedFGColour != 0) {
|
||||
j = this.packedFGColour;
|
||||
} else if (!this.enabled) {
|
||||
j = 10526880;
|
||||
} else if (this.field_146123_n) {
|
||||
j = 16777120;
|
||||
}
|
||||
|
||||
GL11.glTranslated(0.0D, 0.0D, 0.1D);
|
||||
this.drawCenteredString(fontRenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, j);
|
||||
} else {
|
||||
mc.getTextureManager().bindTexture(this.texture);
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
i = this.hoverState(this.field_146123_n);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
//GL11.func_187428_a(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA, SourceFactor.ONE, DestFactor.ZERO);
|
||||
//GL11.func_187401_a(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, this.textureX, this.textureY + i * this.height, this.width, this.height);
|
||||
this.drawCenteredString(fontRenderer, this.label, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, this.color);
|
||||
if (this.field_146123_n && this.hoverText != null && this.hoverText.length > 0) {
|
||||
this.parent.hoverText = this.hoverText;
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public ICustomGuiComponent toComponent() {
|
||||
ScriptGuiButton component = new ScriptGuiButton(this.id, this.label, this.xPosition, this.yPosition, this.width, this.height, this.texture.toString(), this.textureX, this.textureY);
|
||||
component.setHoverText(this.hoverText);
|
||||
component.setColor(this.color);
|
||||
component.setAlpha(this.alpha);
|
||||
return component;
|
||||
}
|
||||
|
||||
public void setColour(int colour) {
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
protected int hoverState(boolean mouseOver) {
|
||||
int i = 0;
|
||||
if (mouseOver) {
|
||||
|
||||
@@ -22,7 +22,6 @@ public class CustomGuiLabel extends Gui implements IGuiComponent {
|
||||
int x, y, width, height;
|
||||
GuiCustom parent;
|
||||
String fullLabel;
|
||||
int color;
|
||||
String[] hoverText;
|
||||
float scale;
|
||||
int id;
|
||||
@@ -30,6 +29,9 @@ public class CustomGuiLabel extends Gui implements IGuiComponent {
|
||||
boolean labelBgEnabled = true;
|
||||
boolean labelShadowEnabled = false;
|
||||
|
||||
int color;
|
||||
float alpha;
|
||||
|
||||
protected int field_146167_a;
|
||||
protected int field_146161_f;
|
||||
public int field_146162_g;
|
||||
@@ -85,6 +87,8 @@ public class CustomGuiLabel extends Gui implements IGuiComponent {
|
||||
lbl.hoverText = component.getHoverText();
|
||||
}
|
||||
lbl.labelShadowEnabled = component.hasShadow();
|
||||
lbl.color = component.getColor();
|
||||
lbl.alpha = component.getAlpha();
|
||||
|
||||
return lbl;
|
||||
}
|
||||
@@ -93,6 +97,8 @@ public class CustomGuiLabel extends Gui implements IGuiComponent {
|
||||
ScriptGuiLabel component = new ScriptGuiLabel(this.id, this.fullLabel, this.field_146162_g, this.field_146174_h, this.field_146167_a, this.field_146161_f, this.color);
|
||||
component.setHoverText(this.hoverText);
|
||||
component.enableShadow(this.labelShadowEnabled);
|
||||
component.setColor(this.color);
|
||||
component.setAlpha(this.alpha);
|
||||
return component;
|
||||
}
|
||||
|
||||
@@ -106,6 +112,11 @@ public class CustomGuiLabel extends Gui implements IGuiComponent {
|
||||
|
||||
this.drawLabelBackground();
|
||||
GL11.glPushMatrix();
|
||||
float red = (color >> 16 & 255) / 255f;
|
||||
float green = (color >> 8 & 255) / 255f;
|
||||
float blue = (color & 255) / 255f;
|
||||
GL11.glColor4f(red,green,blue,this.alpha);
|
||||
|
||||
GL11.glTranslatef(this.x,this.y,0.0F);
|
||||
GL11.glScalef(this.scale, this.scale, this.scale);
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(fullLabel, 0, 0, this.color, this.labelShadowEnabled);
|
||||
|
||||
@@ -9,6 +9,9 @@ import noppes.npcs.scripted.gui.ScriptGuiLine;
|
||||
import noppes.npcs.scripted.interfaces.ICustomGuiComponent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
|
||||
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
|
||||
|
||||
public class CustomGuiLine extends Gui implements IGuiComponent {
|
||||
int id;
|
||||
GuiCustom parent;
|
||||
@@ -17,6 +20,7 @@ public class CustomGuiLine extends Gui implements IGuiComponent {
|
||||
int x2;
|
||||
int y2;
|
||||
int color;
|
||||
float alpha;
|
||||
int thickness;
|
||||
|
||||
public CustomGuiLine(int id, int x1, int y1, int x2, int y2, int color, int thickness){
|
||||
@@ -41,13 +45,13 @@ public class CustomGuiLine extends Gui implements IGuiComponent {
|
||||
public void onRender(Minecraft mc, int mouseX, int mouseY, int mouseWheel, float partialTicks) {
|
||||
double distance = Math.sqrt(Math.pow(x1-x2,2)+Math.pow(y1-y2,2));
|
||||
|
||||
float red = (color >> 16 & 255) / 255f;
|
||||
float green = (color >> 8 & 255) / 255f;
|
||||
float blue = (color & 255) / 255f;
|
||||
|
||||
mc.getTextureManager().bindTexture(new ResourceLocation("customnpcs:textures/gui/misc.png"));
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(red,green,blue,1.0F);
|
||||
float red = (color >> 16 & 255) / 255f;
|
||||
float green = (color >> 8 & 255) / 255f;
|
||||
float blue = (color & 255) / 255f;
|
||||
GL11.glColor4f(red,green,blue,this.alpha);
|
||||
|
||||
GL11.glTranslatef(this.x1,this.y1,0.0F);
|
||||
GL11.glRotated(-Math.toDegrees(Math.atan2(x2-x1,y2-y1)),0.0F,0.0F,1.0F);
|
||||
GL11.glScaled(thickness, distance,0.0D);
|
||||
@@ -56,10 +60,16 @@ public class CustomGuiLine extends Gui implements IGuiComponent {
|
||||
}
|
||||
|
||||
public ICustomGuiComponent toComponent() {
|
||||
return new ScriptGuiLine(this.id, this.x1,this.y1,this.x2,this.y2,this.color,this.thickness);
|
||||
ScriptGuiLine line = new ScriptGuiLine(this.id, this.x1,this.y1,this.x2,this.y2,this.color,this.thickness);
|
||||
line.setColor(this.color);
|
||||
line.setAlpha(this.alpha);
|
||||
return line;
|
||||
}
|
||||
|
||||
public static CustomGuiLine fromComponent(ScriptGuiLine component) {
|
||||
return new CustomGuiLine(component.getID(), component.getX1(), component.getY1(), component.getX2(), component.getY2(), component.getColor(), component.getThickness());
|
||||
CustomGuiLine line = new CustomGuiLine(component.getID(), component.getX1(), component.getY1(), component.getX2(), component.getY2(), component.getColor(), component.getThickness());
|
||||
line.color = component.getColor();
|
||||
line.alpha = component.getAlpha();
|
||||
return line;
|
||||
}
|
||||
}
|
||||
+17
-6
@@ -25,6 +25,9 @@ public class CustomGuiScrollComponent extends GuiCustomScroll implements IDataHo
|
||||
String[] hoverText;
|
||||
public boolean multiSelect = false;
|
||||
|
||||
int color;
|
||||
float alpha;
|
||||
|
||||
public CustomGuiScrollComponent(Minecraft mc, GuiScreen parent, int id) {
|
||||
super(parent, id);
|
||||
this.mc = mc;
|
||||
@@ -48,13 +51,17 @@ public class CustomGuiScrollComponent extends GuiCustomScroll implements IDataHo
|
||||
|
||||
public void onRender(Minecraft mc, int mouseX, int mouseY, int mouseWheel, float partialTicks) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, 0.0F, (float)this.id);
|
||||
boolean hovered = mouseX >= this.guiLeft && mouseY >= this.guiTop && mouseX < this.guiLeft + this.xSize && mouseY < this.guiTop + this.ySize;
|
||||
super.drawScreen(mouseX, mouseY, partialTicks, mouseWheel);
|
||||
if (hovered && this.hoverText != null && this.hoverText.length > 0) {
|
||||
this.parent.hoverText = this.hoverText;
|
||||
}
|
||||
float red = (color >> 16 & 255) / 255f;
|
||||
float green = (color >> 8 & 255) / 255f;
|
||||
float blue = (color & 255) / 255f;
|
||||
GL11.glColor4f(red,green,blue,this.alpha);
|
||||
|
||||
GL11.glTranslatef(0.0F, 0.0F, (float)this.id);
|
||||
boolean hovered = mouseX >= this.guiLeft && mouseY >= this.guiTop && mouseX < this.guiLeft + this.xSize && mouseY < this.guiTop + this.ySize;
|
||||
super.drawScreen(mouseX, mouseY, partialTicks, mouseWheel);
|
||||
if (hovered && this.hoverText != null && this.hoverText.length > 0) {
|
||||
this.parent.hoverText = this.hoverText;
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -79,11 +86,15 @@ public class CustomGuiScrollComponent extends GuiCustomScroll implements IDataHo
|
||||
this.hoverText = component.getHoverText();
|
||||
}
|
||||
|
||||
this.color = component.getColor();
|
||||
this.alpha = component.getAlpha();
|
||||
}
|
||||
|
||||
public ICustomGuiComponent toComponent() {
|
||||
ScriptGuiScroll component = new ScriptGuiScroll(this.id, this.guiLeft - GuiCustom.guiLeft, this.guiTop - GuiCustom.guiTop, this.width, this.height, (String[])this.getList().toArray(new String[0]));
|
||||
component.setHoverText(this.hoverText);
|
||||
component.setColor(color);
|
||||
component.setAlpha(alpha);
|
||||
return component;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,16 @@ import noppes.npcs.client.gui.custom.interfaces.IKeyListener;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.scripted.gui.ScriptGuiTextField;
|
||||
import noppes.npcs.scripted.interfaces.ICustomGuiComponent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class CustomGuiTextField extends GuiTextField implements IKeyListener, IDataHolder, IClickListener {
|
||||
GuiCustom parent;
|
||||
String[] hoverText;
|
||||
int id;
|
||||
|
||||
int color;
|
||||
float alpha;
|
||||
|
||||
public CustomGuiTextField(int id, int x, int y, int width, int height) {
|
||||
super(Minecraft.getMinecraft().fontRenderer, GuiCustom.guiLeft + x, GuiCustom.guiTop + y, width, height);
|
||||
this.id = id;
|
||||
@@ -34,7 +38,12 @@ public class CustomGuiTextField extends GuiTextField implements IKeyListener, ID
|
||||
|
||||
public void onRender(Minecraft mc, int mouseX, int mouseY, int mouseWheel, float partialTicks) {
|
||||
boolean hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
float red = (color >> 16 & 255) / 255f;
|
||||
float green = (color >> 8 & 255) / 255f;
|
||||
float blue = (color & 255) / 255f;
|
||||
GL11.glColor4f(red,green,blue,this.alpha);
|
||||
this.drawTextBox();
|
||||
GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
|
||||
if (hovered && this.hoverText != null && this.hoverText.length > 0) {
|
||||
this.parent.hoverText = this.hoverText;
|
||||
}
|
||||
@@ -59,6 +68,8 @@ public class CustomGuiTextField extends GuiTextField implements IKeyListener, ID
|
||||
ScriptGuiTextField component = new ScriptGuiTextField(this.id, this.xPosition - GuiCustom.guiLeft, this.yPosition - GuiCustom.guiTop, this.width, this.height);
|
||||
component.setText(this.getText());
|
||||
component.setHoverText(this.hoverText);
|
||||
component.setColor(color);
|
||||
component.setAlpha(alpha);
|
||||
return component;
|
||||
}
|
||||
|
||||
@@ -72,6 +83,9 @@ public class CustomGuiTextField extends GuiTextField implements IKeyListener, ID
|
||||
txt.setText(component.getText());
|
||||
}
|
||||
|
||||
txt.color = component.getColor();
|
||||
txt.alpha = component.getAlpha();
|
||||
|
||||
return txt;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ import noppes.npcs.scripted.gui.ScriptGuiTexturedRect;
|
||||
import noppes.npcs.scripted.interfaces.ICustomGuiComponent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
|
||||
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
|
||||
|
||||
public class CustomGuiTexturedRect extends Gui implements IGuiComponent {
|
||||
GuiCustom parent;
|
||||
ResourceLocation texture;
|
||||
@@ -28,6 +31,9 @@ public class CustomGuiTexturedRect extends Gui implements IGuiComponent {
|
||||
float scale;
|
||||
String[] hoverText;
|
||||
|
||||
int color;
|
||||
float alpha;
|
||||
|
||||
public CustomGuiTexturedRect(int id, String texture, int x, int y, int width, int height) {
|
||||
this(id, texture, x, y, width, height, 0, 0);
|
||||
}
|
||||
@@ -57,7 +63,11 @@ public class CustomGuiTexturedRect extends Gui implements IGuiComponent {
|
||||
mc.getTextureManager().bindTexture(this.texture);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
|
||||
float red = (color >> 16 & 255) / 255f;
|
||||
float green = (color >> 8 & 255) / 255f;
|
||||
float blue = (color & 255) / 255f;
|
||||
GL11.glColor4f(red,green,blue,this.alpha);
|
||||
|
||||
GL11.glScalef(this.scale, this.scale, this.scale);
|
||||
this.drawTexturedModalRect((int) (this.x/this.scale), (int) (this.y/this.scale), this.textureX, this.textureY, (int)(this.width), (int)(this.height));
|
||||
GL11.glPopMatrix();
|
||||
@@ -71,6 +81,8 @@ public class CustomGuiTexturedRect extends Gui implements IGuiComponent {
|
||||
ScriptGuiTexturedRect component = new ScriptGuiTexturedRect(this.id, this.texture.toString(), this.x, this.y, this.width, this.height, this.textureX, this.textureY);
|
||||
component.setHoverText(this.hoverText);
|
||||
component.setScale(this.scale);
|
||||
component.setColor(color);
|
||||
component.setAlpha(alpha);
|
||||
return component;
|
||||
}
|
||||
|
||||
@@ -87,6 +99,9 @@ public class CustomGuiTexturedRect extends Gui implements IGuiComponent {
|
||||
rect.hoverText = component.getHoverText();
|
||||
}
|
||||
|
||||
rect.color = component.getColor();
|
||||
rect.alpha = component.getAlpha();
|
||||
|
||||
return rect;
|
||||
}
|
||||
}
|
||||
+6
-3
@@ -13,6 +13,9 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
|
||||
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
|
||||
|
||||
public class CustomOverlayLabel extends Gui implements IOverlayComponent {
|
||||
OverlayCustom parent;
|
||||
int alignment;
|
||||
@@ -70,13 +73,13 @@ public class CustomOverlayLabel extends Gui implements IOverlayComponent {
|
||||
}
|
||||
|
||||
public static CustomOverlayLabel fromComponent(ScriptOverlayLabel component) {
|
||||
CustomOverlayLabel lbl = new CustomOverlayLabel(component.getID(), component.getText(), GuiCustom.guiLeft + component.getPosX(), GuiCustom.guiTop + component.getPosY(), component.getWidth(), component.getHeight(), component.hasShadow());
|
||||
CustomOverlayLabel lbl = new CustomOverlayLabel(component.getID(), component.getText(), component.getPosX(), component.getPosY(), component.getWidth(), component.getHeight(), component.getShadow());
|
||||
lbl.scale = 1.0F;
|
||||
lbl.color = component.getColor();
|
||||
lbl.field_146172_j = true;
|
||||
lbl.setScale(component.getScale());
|
||||
|
||||
lbl.labelShadowEnabled = component.hasShadow();
|
||||
lbl.labelShadowEnabled = component.getShadow();
|
||||
lbl.alignment = component.getAlignment();
|
||||
lbl.alpha = component.getAlpha();
|
||||
lbl.color = component.getColor();
|
||||
@@ -86,7 +89,7 @@ public class CustomOverlayLabel extends Gui implements IOverlayComponent {
|
||||
|
||||
public ICustomOverlayComponent toComponent() {
|
||||
ScriptOverlayLabel component = new ScriptOverlayLabel(this.id, this.fullLabel, this.field_146162_g, this.field_146174_h, this.field_146167_a, this.field_146161_f, this.color);
|
||||
component.enableShadow(this.labelShadowEnabled);
|
||||
component.setShadow(this.labelShadowEnabled);
|
||||
component.setAlignment(alignment);
|
||||
component.setAlpha(alpha);
|
||||
component.setColor(color);
|
||||
|
||||
@@ -2,6 +2,7 @@ package noppes.npcs.client.gui.customoverlay.components;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.gui.customoverlay.OverlayCustom;
|
||||
import noppes.npcs.client.gui.customoverlay.interfaces.IOverlayComponent;
|
||||
@@ -9,6 +10,9 @@ import noppes.npcs.scripted.interfaces.ICustomOverlayComponent;
|
||||
import noppes.npcs.scripted.overlay.ScriptOverlayLine;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
|
||||
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
|
||||
|
||||
public class CustomOverlayLine extends Gui implements IOverlayComponent {
|
||||
OverlayCustom parent;
|
||||
int alignment;
|
||||
|
||||
+4
@@ -2,6 +2,7 @@ package noppes.npcs.client.gui.customoverlay.components;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.gui.customoverlay.OverlayCustom;
|
||||
import noppes.npcs.client.gui.customoverlay.interfaces.IOverlayComponent;
|
||||
@@ -9,6 +10,9 @@ import noppes.npcs.scripted.interfaces.ICustomOverlayComponent;
|
||||
import noppes.npcs.scripted.overlay.ScriptOverlayTexturedRect;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
|
||||
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
|
||||
|
||||
public class CustomOverlayTexturedRect extends Gui implements IOverlayComponent {
|
||||
OverlayCustom parent;
|
||||
int alignment;
|
||||
|
||||
Reference in new issue
Block a user