diff options
| author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-24 14:46:10 +0200 |
|---|---|---|
| committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-24 14:46:10 +0200 |
| commit | 087267b1e9a0562ca80604d583fc6c0790e0f733 (patch) | |
| tree | 53019267804181b9e8ff42d90783d04c3119efa5 /src/main/java/io/polyfrost/oneconfig/gui/pages | |
| parent | 9a3d070d80d569bea3f1b6b162bb061a7d9446db (diff) | |
| parent | 5417c7bd2d43c306863707bb91e7c88a651a696b (diff) | |
| download | OneConfig-087267b1e9a0562ca80604d583fc6c0790e0f733.tar.gz OneConfig-087267b1e9a0562ca80604d583fc6c0790e0f733.tar.bz2 OneConfig-087267b1e9a0562ca80604d583fc6c0790e0f733.zip | |
Merge branch 'master' of github.com:Polyfrost/OneConfig
merge or smthing
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/gui/pages')
3 files changed, 92 insertions, 0 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/pages/HomePage.java b/src/main/java/io/polyfrost/oneconfig/gui/pages/HomePage.java new file mode 100644 index 0000000..d38f565 --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/gui/pages/HomePage.java @@ -0,0 +1,21 @@ +package io.polyfrost.oneconfig.gui.pages; + +import io.polyfrost.oneconfig.config.OneConfigConfig; +import io.polyfrost.oneconfig.gui.elements.BasicButton; +import io.polyfrost.oneconfig.lwjgl.RenderManager; +import io.polyfrost.oneconfig.lwjgl.font.Fonts; + +public class HomePage extends Page { + private final BasicButton btn = new BasicButton(184, 36, "Socials", "/assets/oneconfig/textures/share.png", "/assets/oneconfig/textures/share2.png", 1, BasicButton.ALIGNMENT_CENTER); + public HomePage() { + super("Home Dashboard"); + } + + public void draw(long vg, int x, int y) { + RenderManager.drawRoundedRect(vg, x, y, 184, 36, -1, 12f); + RenderManager.drawString(vg, "This is a cool string to test pages", x + 32, y + 72, -1, 36f, Fonts.INTER_BOLD); + RenderManager.drawRoundedRect(vg, x + 350, y + 310, 300, 200, OneConfigConfig.BLUE_600, 14f); + //RenderManager.drawRoundedRect(vg); + btn.draw(vg, x + 432, y + 658); + } +} diff --git a/src/main/java/io/polyfrost/oneconfig/gui/pages/ModsPage.java b/src/main/java/io/polyfrost/oneconfig/gui/pages/ModsPage.java new file mode 100644 index 0000000..856b2f3 --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/gui/pages/ModsPage.java @@ -0,0 +1,52 @@ +package io.polyfrost.oneconfig.gui.pages; + +import io.polyfrost.oneconfig.OneConfig; +import io.polyfrost.oneconfig.config.data.ModData; +import io.polyfrost.oneconfig.gui.elements.BasicButton; +import io.polyfrost.oneconfig.gui.elements.ModCard; + +import java.util.ArrayList; +import java.util.List; + +public class ModsPage extends Page { + private final BasicButton allBtn = new BasicButton(49, 40, "All", null, null, 0, BasicButton.ALIGNMENT_CENTER, true); + private final BasicButton newBtn = new BasicButton(64, 40, "New", null, null, 0, BasicButton.ALIGNMENT_CENTER, true); + private final BasicButton combatBtn = new BasicButton(104, 40, "Combat", null, null, 0, BasicButton.ALIGNMENT_CENTER, true); + private final BasicButton hudBtn = new BasicButton(104, 40, "HUD & QoL", null, null, 0, BasicButton.ALIGNMENT_CENTER, true); + private final BasicButton hypixelBtn = new BasicButton(104, 40, "Hypixel", null, null, 0, BasicButton.ALIGNMENT_CENTER, true); + private final BasicButton skyblockBtn = new BasicButton(104, 40, "Skyblock", null, null, 0, BasicButton.ALIGNMENT_CENTER, true); + private final BasicButton utilBtn = new BasicButton(104, 40, "Utility", null, null, 0, BasicButton.ALIGNMENT_CENTER, true); + private final BasicButton customBtn = new BasicButton(104, 40, "Custom", null, null, 0, BasicButton.ALIGNMENT_CENTER, true); + + private final List<ModCard> modCards = new ArrayList<>(); + + public ModsPage() { + super("Mods"); + for(ModData modData : OneConfig.loadedMods) { + modCards.add(new ModCard(modData, null, true, false, false)); + } + } + + public void draw(long vg, int x, int y) { + allBtn.draw(vg, x + 16, y + 16); + newBtn.draw(vg, x + 92, y + 16); + combatBtn.draw(vg, x + 168, y + 16); + hudBtn.draw(vg, x + 284, y + 16); + hypixelBtn.draw(vg, x + 400, y + 16); + skyblockBtn.draw(vg, x + 516, y + 16); + utilBtn.draw(vg, x + 632, y + 16); + customBtn.draw(vg, x + 748, y + 16); + + int iX = x + 16; + int iY = y + 72; + for(ModCard modCard : modCards) { + modCard.draw(vg, iX, iY); + iX += 260; + if(iX > x + 796) { + iX = x + 16; + iY += 135; + } + } + + } +} diff --git a/src/main/java/io/polyfrost/oneconfig/gui/pages/Page.java b/src/main/java/io/polyfrost/oneconfig/gui/pages/Page.java index 72fa3a3..492a1f9 100644 --- a/src/main/java/io/polyfrost/oneconfig/gui/pages/Page.java +++ b/src/main/java/io/polyfrost/oneconfig/gui/pages/Page.java @@ -1,4 +1,23 @@ package io.polyfrost.oneconfig.gui.pages; +import io.polyfrost.oneconfig.lwjgl.RenderManager; +import io.polyfrost.oneconfig.lwjgl.font.Fonts; + +/** + * A page is a 1056x728 rectangle of the GUI. It is the main content of the gui, and can be switched back and forwards easily. All the content of OneConfig is in a page. + */ public class Page { + protected final String title; + + Page(String title) { + this.title = title; + } + + public void draw(long vg, int x, int y) { + RenderManager.drawString(vg, "If you are seeing this, something went quite wrong.", x + 12, y + 12, -1, 24f, Fonts.INTER_BOLD); + } + + public String getTitle() { + return title; + } } |
