aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-04-30 11:58:20 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-04-30 11:58:20 +0200
commitb49893c61b81d326e69212f3784933209834ee61 (patch)
treecea1b176e1ee4045f81d1f8af37158c709f494ba /src/main/java/io/polyfrost
parent5ca991a444df237d26bceaa23468a16d5781e910 (diff)
downloadOneConfig-b49893c61b81d326e69212f3784933209834ee61.tar.gz
OneConfig-b49893c61b81d326e69212f3784933209834ee61.tar.bz2
OneConfig-b49893c61b81d326e69212f3784933209834ee61.zip
merge
Diffstat (limited to 'src/main/java/io/polyfrost')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java b/src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java
index 9d5dd6e..79e04ff 100644
--- a/src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java
+++ b/src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java
@@ -5,7 +5,6 @@ import io.polyfrost.oneconfig.config.data.OptionPage;
import io.polyfrost.oneconfig.config.interfaces.BasicOption;
import io.polyfrost.oneconfig.lwjgl.RenderManager;
import io.polyfrost.oneconfig.lwjgl.font.Fonts;
-import org.lwjgl.nanovg.NanoVG;
public class ModConfigPage extends Page {
private final OptionPage page;
@@ -18,15 +17,11 @@ public class ModConfigPage extends Page {
@Override
public void draw(long vg, int x, int y) {
if (page.categories.size() == 0) return;
- NanoVG.nvgScissor(vg, x + 14, y, 1056, 800);
String selectedCategory = page.categories.keySet().stream().findFirst().get();
int optionX = x + 30;
int optionY = y + (page.categories.size() == 1 ? 32 : 72);
for (String subCategory : page.categories.get(selectedCategory).keySet()) {
- RenderManager.drawString(vg, subCategory, x + 18, optionY, OneConfigConfig.WHITE, 24f, Fonts.INTER_MEDIUM);
- optionY += 26;
-
- int backgroundSize = 32;
+ int backgroundSize = 48;
for (int i = 0; i < page.categories.get(selectedCategory).get(subCategory).size(); i++) {
BasicOption option = page.categories.get(selectedCategory).get(subCategory).get(i);
if (i + 1 < page.categories.get(selectedCategory).get(subCategory).size()) {
@@ -39,9 +34,11 @@ public class ModConfigPage extends Page {
}
backgroundSize += option.getHeight() + 16;
}
- RenderManager.drawRoundedRect(vg, x + 14, optionY, 1024, backgroundSize - 16, OneConfigConfig.GRAY_900, 20);
+ RenderManager.drawRoundedRect(vg, x + 14, optionY, 1024, backgroundSize, OneConfigConfig.GRAY_900, 20);
optionY += 16;
+ RenderManager.drawString(vg, subCategory, x + 18, optionY, OneConfigConfig.WHITE, 24f, Fonts.INTER_MEDIUM);
+ optionY += 48;
for (int i = 0; i < page.categories.get(selectedCategory).get(subCategory).size(); i++) {
BasicOption option = page.categories.get(selectedCategory).get(subCategory).get(i);
option.draw(vg, optionX, optionY);
@@ -58,7 +55,6 @@ public class ModConfigPage extends Page {
}
optionY += 28;
}
- NanoVG.nvgResetScissor(vg);
}
@Override