aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/gui/elements
diff options
context:
space:
mode:
authornextdaydelivery <12willettsh@gmail.com>2022-02-20 12:13:58 +0000
committernextdaydelivery <12willettsh@gmail.com>2022-02-20 12:14:29 +0000
commitdfa65f6236c226eb88f4e3761e10e80e5f37c22b (patch)
tree33937f0cadf5fb012aae57e6db87e56a32b4e265 /src/main/java/io/polyfrost/oneconfig/gui/elements
parent4f8e90571e3a270b54244d0fef985d5e0ca04b40 (diff)
downloadOneConfig-dfa65f6236c226eb88f4e3761e10e80e5f37c22b.tar.gz
OneConfig-dfa65f6236c226eb88f4e3761e10e80e5f37c22b.tar.bz2
OneConfig-dfa65f6236c226eb88f4e3761e10e80e5f37c22b.zip
package moves and a split string renderer
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/gui/elements')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/gui/elements/OCBlock.java11
-rw-r--r--src/main/java/io/polyfrost/oneconfig/gui/elements/OCStoreBlock.java18
2 files changed, 23 insertions, 6 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/OCBlock.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/OCBlock.java
index 7a5c8f3..fcce48b 100644
--- a/src/main/java/io/polyfrost/oneconfig/gui/elements/OCBlock.java
+++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/OCBlock.java
@@ -2,7 +2,7 @@ package io.polyfrost.oneconfig.gui.elements;
import io.polyfrost.oneconfig.renderer.Renderer;
import io.polyfrost.oneconfig.themes.Theme;
-import io.polyfrost.oneconfig.themes.ThemeElement;
+import io.polyfrost.oneconfig.themes.textures.ThemeElement;
import io.polyfrost.oneconfig.themes.Themes;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
@@ -14,15 +14,16 @@ import org.lwjgl.input.Mouse;
import java.awt.*;
+import static io.polyfrost.oneconfig.gui.Window.resolution;
+
@SuppressWarnings("unused")
public class OCBlock {
- private static final Theme theme = Themes.getActiveTheme();
+ public static final Theme theme = Themes.getActiveTheme();
private static final Minecraft mc = Minecraft.getMinecraft();
- public static ScaledResolution resolution = new ScaledResolution(mc);
private Color color;
private String text;
private final boolean bold;
- private int width, height;
+ protected int width, height;
private ThemeElement element;
private boolean clicked = false;
private boolean rightClicked = false;
@@ -103,7 +104,7 @@ public class OCBlock {
}
/**
- * Update this elements click, key and hover status. Call this method at the end of your 'draw' function, if overrided.
+ * Update this elements click, key and hover status. Call this method at the end of your 'draw' function, if overridden.
*/
public void update() {
resolution = new ScaledResolution(mc);
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/OCStoreBlock.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/OCStoreBlock.java
index 6d9d8c1..7a87f77 100644
--- a/src/main/java/io/polyfrost/oneconfig/gui/elements/OCStoreBlock.java
+++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/OCStoreBlock.java
@@ -1,17 +1,33 @@
package io.polyfrost.oneconfig.gui.elements;
+import io.polyfrost.oneconfig.renderer.Renderer;
import net.minecraft.util.ResourceLocation;
-public class OCStoreBlock extends OCBlock {
+import java.awt.*;
+public class OCStoreBlock extends OCBlock {
+ private ResourceLocation image;
+ private String description, title;
+ private Color color;
public OCStoreBlock(String title, String description, ResourceLocation image, int color) {
super(color, 200, 400);
+ this.color = Renderer.getColorFromInt(color);
+ this.description = description;
+ this.title = title;
+ this.image = image;
}
public void draw(int x, int y) {
+ super.draw(x, y);
+ Renderer.drawScaledImage(image, x, y, 200, 100);
+ super.theme.getFont().drawSplitString("i like fish", x + 2, y + 102, 200, -1);
super.update();
}
+
+ public void draw(int x, int y, int width, int height) {
+ draw(x,y);
+ }
}