aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/configv3/CategoryPageWidget.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/configv3/CategoryPageWidget.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/configv3/CategoryPageWidget.java
index 8565167a..035b715e 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/configv3/CategoryPageWidget.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/configv3/CategoryPageWidget.java
@@ -39,9 +39,11 @@ public class CategoryPageWidget extends AnnotatedImportOnlyWidget {
public final BindableAttribute categories = new BindableAttribute<>(WidgetList.class);
@Bind(variableName = "categoryShow")
public final BindableAttribute<String > showCategory = new BindableAttribute<>(String.class);
+ private String category;
public CategoryPageWidget(String category) {
super(new ResourceLocation("dungeonsguide:gui/config/categorypage.gui"));
items.setValue(buildMenu(category));
+ this.category = category;
List<Widget> widgets;
categories.setValue(widgets = buildCategory(category));
showCategory.setValue(widgets.isEmpty() ? "hide" : "show");
@@ -62,4 +64,19 @@ public class CategoryPageWidget extends AnnotatedImportOnlyWidget {
a -> new FeatureItem(a)
).collect(Collectors.toList());
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ CategoryPageWidget that = (CategoryPageWidget) o;
+
+ return category.equals(that.category);
+ }
+
+ @Override
+ public int hashCode() {
+ return category.hashCode();
+ }
}