aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/config
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-05-29 11:20:51 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-05-29 11:20:51 +0200
commita099d4a19953eb8d0fa92b2dd1f47cb6cb449ebb (patch)
tree2f35973f014da00e7b1a499a76eb9e4d9caecc24 /src/main/java/cc/polyfrost/oneconfig/config
parentad94530c89f8358338b9a4034b92b3a444001df6 (diff)
downloadOneConfig-a099d4a19953eb8d0fa92b2dd1f47cb6cb449ebb.tar.gz
OneConfig-a099d4a19953eb8d0fa92b2dd1f47cb6cb449ebb.tar.bz2
OneConfig-a099d4a19953eb8d0fa92b2dd1f47cb6cb449ebb.zip
fix OC-48
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/config')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/data/OptionSubcategory.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/data/OptionSubcategory.java b/src/main/java/cc/polyfrost/oneconfig/config/data/OptionSubcategory.java
index cdd9c51..cf4e2f0 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/data/OptionSubcategory.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/data/OptionSubcategory.java
@@ -14,6 +14,8 @@ public class OptionSubcategory {
public ArrayList<BasicOption> options = new ArrayList<>();
public ArrayList<ConfigPageButton> topButtons = new ArrayList<>();
public ArrayList<ConfigPageButton> bottomButtons = new ArrayList<>();
+ private ArrayList<BasicOption> filteredOptions = new ArrayList<>();
+ private int drawLastY;
public OptionSubcategory(String name) {
this.name = name;
@@ -21,7 +23,7 @@ public class OptionSubcategory {
public int draw(long vg, int x, int y) {
String filter = OneConfigGui.INSTANCE == null ? "" : OneConfigGui.INSTANCE.getSearchValue().toLowerCase().trim();
- ArrayList<BasicOption> filteredOptions = new ArrayList<>(options);
+ filteredOptions = new ArrayList<>(options);
ArrayList<ConfigPageButton> filteredTop = new ArrayList<>(topButtons);
ArrayList<ConfigPageButton> filteredBottom = new ArrayList<>(bottomButtons);
if (!filter.equals("") && !name.toLowerCase().contains(filter)) {
@@ -70,7 +72,7 @@ public class OptionSubcategory {
optionY += 16;
}
- int drawLastY = optionY;
+ drawLastY = optionY;
if (filteredOptions.size() > 0) {
for (int i = 0; i < filteredOptions.size(); i++) {
BasicOption option = filteredOptions.get(i);
@@ -94,6 +96,10 @@ public class OptionSubcategory {
optionY += page.getHeight() + 16;
}
+ return optionY - y;
+ }
+
+ public void drawLast(long vg, int x) {
for (int i = 0; i < filteredOptions.size(); i++) {
BasicOption option = filteredOptions.get(i);
option.drawLast(vg, x, drawLastY);
@@ -108,8 +114,6 @@ public class OptionSubcategory {
}
drawLastY += option.getHeight() + 16;
}
-
- return optionY - y;
}
public String getName() {