From a11a04cc1161a4ed55b85fa9bec877094f1e8e9d Mon Sep 17 00:00:00 2001 From: nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> Date: Sat, 23 Apr 2022 13:51:31 +0100 Subject: mod page, pages, and some more stuff --- .../polyfrost/oneconfig/gui/elements/ModCard.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/main/java/io/polyfrost/oneconfig/gui/elements/ModCard.java (limited to 'src/main/java/io/polyfrost/oneconfig/gui/elements/ModCard.java') diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/ModCard.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/ModCard.java new file mode 100644 index 0000000..dd4fe87 --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/ModCard.java @@ -0,0 +1,37 @@ +package io.polyfrost.oneconfig.gui.elements; + +import io.polyfrost.oneconfig.config.OneConfigConfig; +import io.polyfrost.oneconfig.lwjgl.RenderManager; +import io.polyfrost.oneconfig.lwjgl.font.Fonts; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class ModCard extends BasicElement { + private final String modName, iconPath; + private boolean active, disabled, favorite; + + public ModCard(@NotNull String modName, @Nullable String iconPath, boolean active, boolean disabled, boolean favorite) { + super(224, 119, true); + this.modName = modName; + this.iconPath = iconPath; + this.active = active; + this.disabled = disabled; + this.favorite = favorite; + } + + @Override + public void draw(long vg, int x, int y) { + RenderManager.drawRoundedRect(vg, x, y, width, 100, OneConfigConfig.GRAY_600, 12f); + RenderManager.drawRoundedRect(vg, x, y + 75, width, 32, OneConfigConfig.BLUE_600, 12f); + RenderManager.drawRect(vg, x, y + 75, width, 12, OneConfigConfig.BLUE_600); + if(iconPath != null) { + RenderManager.drawImage(vg, iconPath, x, y, width, 87); + } else { + RenderManager.drawImage(vg, "assets/oneconfig/textures/box.png", x + 98, y + 19, 40, 40); + } + RenderManager.drawString(vg, modName, x + 12, y + 92, OneConfigConfig.WHITE, 14f, Fonts.INTER_MEDIUM); + if(favorite) { + // TODO + } + } +} -- cgit