fix gui drawing
This commit is contained in:
parent
5641c5c834
commit
e1759b853e
4 changed files with 10 additions and 7 deletions
|
@ -1082,7 +1082,7 @@ public class Client implements IThreadListener {
|
||||||
int y = this.fbY - 20 * scale;
|
int y = this.fbY - 20 * scale;
|
||||||
if(selected == n)
|
if(selected == n)
|
||||||
Drawing.drawRect(x - scale * 2, y - scale * 2, 20 * scale, 20 * scale, 0xffffffff);
|
Drawing.drawRect(x - scale * 2, y - scale * 2, 20 * scale, 20 * scale, 0xffffffff);
|
||||||
InventoryButton.drawButton(x - scale, y - scale, 18 * scale, 18 * scale, this.scaleHotbar);
|
InventoryButton.drawButton(this, x - scale, y - scale, 18 * scale, 18 * scale, this.scaleHotbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack itemstack = this.player.getHeldItem();
|
ItemStack itemstack = this.player.getHeldItem();
|
||||||
|
|
|
@ -41,6 +41,7 @@ import common.item.ItemStack;
|
||||||
import common.packet.CPacketAction;
|
import common.packet.CPacketAction;
|
||||||
import common.packet.CPacketCheat;
|
import common.packet.CPacketCheat;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
|
import common.util.Util;
|
||||||
import common.util.Color;
|
import common.util.Color;
|
||||||
|
|
||||||
public abstract class GuiContainer extends Gui
|
public abstract class GuiContainer extends Gui
|
||||||
|
@ -932,7 +933,7 @@ public abstract class GuiContainer extends Gui
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawBackground() {
|
public void drawBackground() {
|
||||||
Drawing.drawRectBorder(this.container_x, this.container_y, this.container_w, this.container_h, 0xff3f3f3f, 0xff000000, 0xff7f7f7f, 0xff1f1f1f);
|
Drawing.drawRectBorder(this.container_x, this.container_y, this.container_w, this.container_h, Util.mulColor(Util.mixColor(this.gm.style.fill_top, this.gm.style.fill_btm), 0.8f), 0xff000000, Util.mulColor(this.gm.style.brdr_top, 0.8f), Util.mulColor(this.gm.style.brdr_btm, 0.8f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ public class DisplayLabel extends MultiLabel {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawBackground() {
|
protected void drawBackground() {
|
||||||
Drawing.drawRect(this.pos_x, this.pos_y, this.size_x, this.size_y, 0xff000000, 0xff2f2f2f, 0xff5f5f5f);
|
Drawing.drawRect(this.pos_x, this.pos_y, this.size_x, this.size_y, 0xff000000, this.gm.style.brdr_btm, this.gm.style.brdr_top);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawForeground(int x1, int y1, int x2, int y2) {
|
protected void drawForeground(int x1, int y1, int x2, int y2) {
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package client.gui.element;
|
package client.gui.element;
|
||||||
|
|
||||||
|
import client.Client;
|
||||||
import client.renderer.Drawing;
|
import client.renderer.Drawing;
|
||||||
import common.inventory.Slot;
|
import common.inventory.Slot;
|
||||||
|
import common.util.Util;
|
||||||
|
|
||||||
public class InventoryButton extends Element {
|
public class InventoryButton extends Element {
|
||||||
private final boolean bordered;
|
private final boolean bordered;
|
||||||
|
@ -16,7 +18,7 @@ public class InventoryButton extends Element {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawBackground() {
|
protected void drawBackground() {
|
||||||
drawButton(this.pos_x, this.pos_y, this.size_x, this.size_y, this.bordered);
|
drawButton(this.gm, this.pos_x, this.pos_y, this.size_x, this.size_y, this.bordered);
|
||||||
if(this.texture != null && !this.slot.getHasStack()) {
|
if(this.texture != null && !this.slot.getHasStack()) {
|
||||||
int scale = this.bordered ? 2 : 1;
|
int scale = this.bordered ? 2 : 1;
|
||||||
Drawing.drawTexturedRect(this.gm, this.texture, 16 * scale, 16 * scale, this.pos_x + scale, this.pos_y + scale, 0, 0, this.size_x - scale * 2, this.size_y - scale * 2);
|
Drawing.drawTexturedRect(this.gm, this.texture, 16 * scale, 16 * scale, this.pos_x + scale, this.pos_y + scale, 0, 0, this.size_x - scale * 2, this.size_y - scale * 2);
|
||||||
|
@ -26,10 +28,10 @@ public class InventoryButton extends Element {
|
||||||
protected void drawForeground(int x1, int y1, int x2, int y2) {
|
protected void drawForeground(int x1, int y1, int x2, int y2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void drawButton(int x, int y, int w, int h, boolean border) {
|
public static void drawButton(Client gm, int x, int y, int w, int h, boolean border) {
|
||||||
if(border)
|
if(border)
|
||||||
Drawing.drawDoubleRect(x, y, w, h, 0xff6f6f6f, 0xffcfcfcf, 0xff2f2f2f);
|
Drawing.drawDoubleRect(x, y, w, h, Util.mixColor(gm.style.fill_top, gm.style.fill_btm), gm.style.brdr_top, gm.style.brdr_btm);
|
||||||
else
|
else
|
||||||
Drawing.drawRect(x, y, w, h, 0xff6f6f6f, 0xffcfcfcf, 0xff2f2f2f);
|
Drawing.drawRect(x, y, w, h, Util.mixColor(gm.style.fill_top, gm.style.fill_btm), gm.style.brdr_top, gm.style.brdr_btm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue