split client and server 1
This commit is contained in:
parent
26a15a0b15
commit
2fa521c3d1
661 changed files with 3058 additions and 2826 deletions
28
java/src/client/gui/element/SelectableButton.java
Normal file
28
java/src/client/gui/element/SelectableButton.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package client.gui.element;
|
||||
|
||||
import client.renderer.Drawing;
|
||||
import game.util.Util;
|
||||
|
||||
public class SelectableButton extends ActButton {
|
||||
private boolean selected;
|
||||
|
||||
public SelectableButton(int x, int y, int w, int h, Callback callback, String text, boolean selected) {
|
||||
super(x, y, w, h, callback, text);
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
protected void drawBackground() {
|
||||
if(this.selected) {
|
||||
if(this.enabled)
|
||||
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
|
||||
Drawing.drawGradientBorder(this.pos_x, this.pos_y, this.size_x, this.size_y, Util.mulColor(this.gm.style.fill_btm, 0.5f), Util.mulColor(this.gm.style.fill_top, 0.5f), 0xff000000, Util.mulColor(this.gm.style.brdr_top, 0.5f), Util.mulColor(this.gm.style.brdr_btm, 0.5f));
|
||||
}
|
||||
else
|
||||
super.drawBackground();
|
||||
}
|
||||
|
||||
public void setSelected(boolean selected) {
|
||||
this.selected = selected;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue