chore [WIP]

This commit is contained in:
Discreater committed 2021-05-08 00:39:17 +08:00
1 parent ea0253a359
commit 1939619ed4
34 files changed
+265 -167

No files matched your search

@@ -37,10 +37,11 @@ public class WButtonText extends WButton {
}
@Override
public void onDraw(JecaGui gui, int xMouse, int yMouse) {
super.onDraw(gui, xMouse, yMouse);
public boolean onDraw(JecaGui gui, int xMouse, int yMouse) {
boolean ret = super.onDraw(gui, xMouse, yMouse);
JecaGui.Font font = mouseIn(xMouse, yMouse) ? focused : normal;
float x = xPos + Math.max(3, xSize / 2.0f - font.getTextWidth(text) / 2.0f);
gui.drawText(x, yPos + ySize / 2.0f - font.getTextHeight() / 2.0f, xSize - 6, font, text);
return ret;
}
}