diff --git a/src/main/java/org/saturnclient/mod/mods/KeystrokesMod.java b/src/main/java/org/saturnclient/mod/mods/KeystrokesMod.java index dc05c29..50b9eca 100644 --- a/src/main/java/org/saturnclient/mod/mods/KeystrokesMod.java +++ b/src/main/java/org/saturnclient/mod/mods/KeystrokesMod.java @@ -153,7 +153,7 @@ public class KeystrokesMod extends Mod implements HudMod { int fg = pressed ? clickFg.value : layout.fgColor.value; scope.drawRoundedRectangle(x, y, layout.width, SPACE_H, layout.radius.value, bg); int lineY = y + SPACE_H / 2; - scope.drawRect(x + (layout.width - 30) / 2, lineY, 30, 1, fg); + scope.drawRectangle(x + (layout.width - 30) / 2, lineY, 30, 1, fg); } private void refreshHeight() { diff --git a/src/main/java/org/saturnclient/ui/RenderScope.java b/src/main/java/org/saturnclient/ui/RenderScope.java index 9f8b1bf..0caeb23 100644 --- a/src/main/java/org/saturnclient/ui/RenderScope.java +++ b/src/main/java/org/saturnclient/ui/RenderScope.java @@ -6,52 +6,74 @@ import org.saturnclient.common.ref.game.ItemStackRef; import org.saturnclient.common.ref.render.MatrixStackRef; public interface RenderScope { - public MatrixStackRef getMatrixStack(); - public void setOpacity(float alpha); + // ---------------------------- + // Matrix & Transform + // ---------------------------- + MatrixStackRef getMatrixStack(); - public int getColor(int color); + // ---------------------------- + // Color & Opacity + // ---------------------------- + void setOpacity(float alpha); - public void drawRect(int x, int y, int width, int height, int color); + int getColor(int color); - public void drawText(String text, int x, int y, int font, int color); + // ---------------------------- + // Shapes + // ---------------------------- + void drawRectangle(int x, int y, int width, int height, int color); - public void drawText(float scale, String text, int x, int y, int font, int color); + void drawRoundedRectangle(int x, int y, int width, int height, int radius, int color); - public void drawRoundedRectangle(int x, int y, int width, int height, int radius, int color); + void drawBorder(int x, int y, int width, int height, int color); - public int getScaledWindowWidth(); + void fill(int x1, int y1, int x2, int y2, int color); - public int getScaledWindowHeight(); + // ---------------------------- + // Text + // ---------------------------- + void drawText(String text, int x, int y, int font, int color); - public void drawTexture(IdentifierRef sprite, int x, int y, float u, float v, int width, int height, - int color); + void drawText(float scale, String text, int x, int y, int font, int color); - public void drawTexture(IdentifierRef sprite, int x, int y, float u, float v, int width, int height); + // ---------------------------- + // Textures & Sprites + // ---------------------------- + void drawTexture(IdentifierRef sprite, int x, int y, float u, float v, int width, int height); - public void drawTexture(IdentifierRef sprite, int x, int y, float u, float v, int width, int height, - int regionWith, - int regionHeight, int textureWidth, int textureHeight); + void drawTexture(IdentifierRef sprite, int x, int y, float u, float v, int width, int height, int color); - public void drawTexture(IdentifierRef sprite, int x, int y, float u, float v, int width, int height, - int regionWidth, - int regionHeight, int textureWidth, int textureHeight, int color); + void drawTexture(IdentifierRef sprite, int x, int y, float u, float v, int width, int height, + int regionWidth, int regionHeight, int textureWidth, int textureHeight); - public void enableScissor(int x1, int y1, int x2, int y2); + void drawTexture(IdentifierRef sprite, int x, int y, float u, float v, int width, int height, + int regionWidth, int regionHeight, int textureWidth, int textureHeight, int color); - public void disableScissor(); + void drawSpriteStretched(SpriteRef sprite, int x, int y, int width, int height); - public boolean scissorContains(int x, int y); + void drawSpriteStretched(SpriteRef sprite, int x, int y, int width, int height, int color); - public void drawItem(ItemStackRef item, int x, int y); + // ---------------------------- + // Items + // ---------------------------- + void drawItem(ItemStackRef item, int x, int y); - public void drawItemWithoutEntity(ItemStackRef stack, int x, int y); + // ---------------------------- + // Scissor / Clipping + // ---------------------------- + void enableScissor(int x1, int y1, int x2, int y2); - public void drawSpriteStretched(SpriteRef sprite, int x, int y, int width, int height); + void disableScissor(); - public void drawSpriteStretched(SpriteRef sprite, int x, int y, int width, int height, int color); + boolean scissorContains(int x, int y); - public void fill(int x1, int y1, int x2, int y2, int color); + // ---------------------------- + // Window Info / Draw + // ---------------------------- + int getScaledWindowWidth(); - public void drawBorder(int x, int y, int width, int height, int color); -} + int getScaledWindowHeight(); + + void draw(); +} \ No newline at end of file diff --git a/src/main/java/org/saturnclient/ui/components/inputs/Input.java b/src/main/java/org/saturnclient/ui/components/inputs/Input.java index 9c4b8e8..e4291f0 100644 --- a/src/main/java/org/saturnclient/ui/components/inputs/Input.java +++ b/src/main/java/org/saturnclient/ui/components/inputs/Input.java @@ -76,7 +76,7 @@ public abstract class Input extends Element { (int) (Fonts.getWidth(visibleText.substring(0, cursorPosition - scrollOffset), Theme.FONT.value) * 0.6f); - renderScope.drawRect(cursorX, 2, 1, height - 4, 0xFFFFFFFF); + renderScope.drawRectangle(cursorX, 2, 1, height - 4, 0xFFFFFFFF); } }