tcr/java/src/game/gui/element/NavButton.java

26 lines
708 B
Java
Raw Normal View History

package game.gui.element;
import game.Game;
import game.gui.Gui;
import game.renderer.Drawing;
public class NavButton extends ActButton {
private final Gui navGui;
public NavButton(int x, int y, int w, int h, Gui gui, String text) {
super(x, y, w, h, new Callback() {
public void use(ActButton elem, Mode action) {
Game.getGame().displayGuiScreen(gui);
}
}, text);
this.navGui = gui;
}
protected void drawBackground() {
if(this.gm.open == this.navGui)
Drawing.drawGradientBorder(this.pos_x, this.pos_y, this.size_x, this.size_y, this.gm.style.fill_btm, this.gm.style.fill_top, 0xff000000, this.gm.style.brdr_top, this.gm.style.brdr_btm);
else
super.drawBackground();
}
}