gui disabled colors

This commit is contained in:
Sen 2025-03-28 01:01:16 +01:00
parent 6a6a820963
commit 3316c42ed8
10 changed files with 64 additions and 19 deletions

View file

@ -1,6 +1,7 @@
package game.gui.element;
import game.renderer.Drawing;
import game.util.Util;
public class SelectableButton extends ActButton {
private boolean selected;
@ -11,8 +12,12 @@ public class SelectableButton extends ActButton {
}
protected void drawBackground() {
if(this.selected)
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);
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();
}