diff options
author | nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> | 2022-04-23 13:51:31 +0100 |
---|---|---|
committer | nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> | 2022-04-23 13:52:01 +0100 |
commit | a11a04cc1161a4ed55b85fa9bec877094f1e8e9d (patch) | |
tree | 423c49125b176dbabd72df562bd9b9e5f0397b02 /src/main/java/io/polyfrost/oneconfig/gui/elements/ModCard.java | |
parent | 2b38d2d62391428a7fa40f268a4e65f876dd0e75 (diff) | |
download | OneConfig-a11a04cc1161a4ed55b85fa9bec877094f1e8e9d.tar.gz OneConfig-a11a04cc1161a4ed55b85fa9bec877094f1e8e9d.tar.bz2 OneConfig-a11a04cc1161a4ed55b85fa9bec877094f1e8e9d.zip |
mod page, pages, and some more stuff
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/gui/elements/ModCard.java')
-rw-r--r-- | src/main/java/io/polyfrost/oneconfig/gui/elements/ModCard.java | 37 |
1 files changed, 37 insertions, 0 deletions
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 + } + } +} |