Move RecipeTransferRectHandler out of TemplateRecipeHandler and tidy up PositionedStack (#1106) (#1132)

Co-authored-by: slprime <[email protected]>
This commit is contained in:
boubou19andslprime authored and GitHub committed 2026-11-19 07:44:56 +01:00
1 parent 1aa4d56100
commit 621ab621c7
9 files changed
+216 -196

No files matched your search

@@ -263,13 +263,12 @@ public abstract class GuiRecipeTab extends Widget {
NEIClientConfig.logger.info("Error setting handler dimensions for " + handler);
}
final boolean allowOverflow = record.isSet("useCustomScroll")
&& Boolean.parseBoolean(record.get("useCustomScroll"));
info.setAllowOverflowX(
record.isSet("allowOverflowX") ? Boolean.parseBoolean(record.get("allowOverflowX")) : true);
info.setAllowOverflowY(
record.isSet("allowOverflowY") ? Boolean.parseBoolean(record.get("allowOverflowY"))
: allowOverflow);
final boolean allowOverflow = booleanOrDefault(record, "useCustomScroll", false);
info.setAllowOverflowX(booleanOrDefault(record, "allowOverflowX", true));
info.setAllowOverflowY(booleanOrDefault(record, "allowOverflowY", allowOverflow));
info.setShowFavoritesButton(booleanOrDefault(record, "showFavorites", true));
info.setShowOverlayButton(booleanOrDefault(record, "showOverlay", true));
info.setShowBadge(booleanOrDefault(record, "showBadge", false));
handlerMap.put(handler, info);
NEIClientConfig.logger.info("Loaded " + handler);
}
@@ -306,6 +305,11 @@ public abstract class GuiRecipeTab extends Widget {
return info;
}
private static boolean booleanOrDefault(CSVRecord record, String name, boolean defaultValue) {
final String str = record.isSet(name) ? record.get(name) : null;
return str == null || str.isEmpty() ? defaultValue : Boolean.parseBoolean(str);
}
private static int intOrDefault(String str, int defaultValue) {
if (str == null || str.equals("")) return defaultValue;
try {