aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-04-30 12:37:21 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-04-30 12:37:21 +0200
commit78fab84df48759e8968c477924b4bcc3b81e6cee (patch)
tree1273be94b15da4f468c7c7f94efcb57d2cd7f593 /src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java
parentcb211a4c727243ede579a439008c6097506fe046 (diff)
downloadOneConfig-78fab84df48759e8968c477924b4bcc3b81e6cee.tar.gz
OneConfig-78fab84df48759e8968c477924b4bcc3b81e6cee.tar.bz2
OneConfig-78fab84df48759e8968c477924b4bcc3b81e6cee.zip
config page system rewrite start
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java16
1 files changed, 9 insertions, 7 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 79e04ff..2b31421 100644
--- a/src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java
+++ b/src/main/java/io/polyfrost/oneconfig/gui/pages/ModConfigPage.java
@@ -19,9 +19,10 @@ public class ModConfigPage extends Page {
if (page.categories.size() == 0) return;
String selectedCategory = page.categories.keySet().stream().findFirst().get();
int optionX = x + 30;
- int optionY = y + (page.categories.size() == 1 ? 32 : 72);
+ int optionY = y + (page.categories.size() == 1 ? 16 : 64);
+ int backgroundSize = 48;
for (String subCategory : page.categories.get(selectedCategory).keySet()) {
- int backgroundSize = 48;
+ backgroundSize += 32;
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()) {
@@ -34,10 +35,12 @@ public class ModConfigPage extends Page {
}
backgroundSize += option.getHeight() + 16;
}
- RenderManager.drawRoundedRect(vg, x + 14, optionY, 1024, backgroundSize, 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 += 16;
+ for (String subCategory : page.categories.get(selectedCategory).keySet()) {
+ RenderManager.drawString(vg, subCategory, optionX, optionY + 16, OneConfigConfig.WHITE_90, 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);
@@ -45,7 +48,7 @@ public class ModConfigPage extends Page {
if (i + 1 < page.categories.get(selectedCategory).get(subCategory).size()) {
BasicOption nextOption = page.categories.get(selectedCategory).get(subCategory).get(i + 1);
if (option.size == 1 && option.hasHalfSize() && nextOption.size == 1 && nextOption.hasHalfSize()) {
- nextOption.draw(vg, optionX + 528, optionY);
+ nextOption.draw(vg, optionX + 512, optionY);
optionY += Math.max(option.getHeight(), nextOption.getHeight()) + 16;
i++;
continue;
@@ -53,7 +56,6 @@ public class ModConfigPage extends Page {
}
optionY += option.getHeight() + 16;
}
- optionY += 28;
}
}