Compare commits

...
Author SHA1 Message Date
Martin Robertz 6d13061496 Merge branch 'master' into master 2023-03-30 22:09:16 +02:00
Caedis 1f83c77a92 Merge pull request #1 from GTNewHorizons/dev
update bs+sa
2023-03-29 02:17:52 -05:00
Martin Robertz 8f1338622b update bs+sa 2023-03-29 09:12:56 +02:00
Caedis 7a8d71ce31 Add option to have the search widget under item panel 2023-03-28 20:57:08 -05:00
4 changed files with 39 additions and 10 deletions

No files matched your search

+20 -7
View File
@@ -166,19 +166,32 @@ public class ItemPanel extends PanelWidget {
}
protected int resizeFooter(GuiContainer gui) {
if (!NEIClientConfig.showItemQuantityWidget()) return 0;
if (!(NEIClientConfig.showItemQuantityWidget() || !NEIClientConfig.isSearchWidgetCentered())) return 0;
final int BUTTON_SIZE = 16;
more.w = less.w = BUTTON_SIZE;
more.h = less.h = quantity.h = BUTTON_SIZE;
less.x = x;
more.x = x + w - BUTTON_SIZE;
more.y = less.y = quantity.y = y + h - BUTTON_SIZE;
if (NEIClientConfig.isSearchWidgetCentered()) {
more.x = x + w - BUTTON_SIZE;
more.h = less.h = quantity.h = BUTTON_SIZE;
more.y = less.y = quantity.y = y + h - BUTTON_SIZE;
less.x = x;
quantity.x = x + BUTTON_SIZE + 2;
quantity.w = more.x - quantity.x - 2;
} else {
more.x = less.x;
more.y = y + h - BUTTON_SIZE;
more.h = less.h = BUTTON_SIZE / 2;
quantity.x = x + BUTTON_SIZE + 2;
quantity.w = more.x - quantity.x - 2;
less.x = (int) (x + (w * 0.7));
less.y = more.y + more.h;
quantity.h = BUTTON_SIZE;
quantity.x = less.x + less.w + 1;
quantity.y = y + h - BUTTON_SIZE;
quantity.w = x + w - quantity.x;
}
return BUTTON_SIZE + 2;
}
@@ -126,9 +126,15 @@ public class LayoutStyleMinecraft extends LayoutStyle {
presetsPanel.y = 2;
presetsPanel.x = (gui.width - gui.xSize) / 2 + gui.xSize - presetsPanel.w;
searchField.h = 20;
searchField.w = 150;
searchField.x = (gui.width - searchField.w) / 2;
if (NEIClientConfig.isSearchWidgetCentered()) {
searchField.h = 20;
searchField.w = 150;
searchField.x = (gui.width - searchField.w) / 2;
} else {
searchField.h = itemPanel.quantity.h;
searchField.w = (int) (itemPanel.w * (NEIClientConfig.showItemQuantityWidget() ? 0.7 : 1));
searchField.x = itemPanel.x;
}
searchField.y = gui.height - searchField.h - 2;
if (!visiblity.showItemSection) {
@@ -247,6 +247,9 @@ public class NEIClientConfig {
tag.getTag("inventory.showItemQuantityWidget").setComment("Show Item Quantity Widget").getBooleanValue(true);
API.addOption(new OptionToggleButton("inventory.showItemQuantityWidget", true));
tag.getTag("inventory.centerSearchWidget").setComment("Center Search Widget").getBooleanValue(true);
API.addOption(new OptionToggleButton("inventory.centerSearchWidget", true));
tag.getTag("inventory.jei_style_tabs").setComment("Enable/disable JEI Style Tabs").getBooleanValue(true);
API.addOption(new OptionToggleButtonBoubs("inventory.jei_style_tabs", true));
tag.getTag("inventory.jei_style_item_presence_overlay")
@@ -554,6 +557,10 @@ public class NEIClientConfig {
return getBooleanSetting("inventory.showItemQuantityWidget");
}
public static boolean isSearchWidgetCentered() {
return getBooleanSetting("inventory.centerSearchWidget");
}
public static boolean areJEIStyleTabsVisible() {
return getBooleanSetting("inventory.jei_style_tabs");
}
@@ -157,6 +157,9 @@ nei.options.inventory.showRecipeMarker.false=No
nei.options.inventory.showItemQuantityWidget=Show Item Quantity Widget
nei.options.inventory.showItemQuantityWidget.true=Yes
nei.options.inventory.showItemQuantityWidget.false=No
nei.options.inventory.centerSearchWidget=Center Search Widget
nei.options.inventory.centerSearchWidget.true=Yes
nei.options.inventory.centerSearchWidget.false=No
nei.options.inventory.creative_tab_style=Creative or JEI tab style
nei.options.inventory.creative_tab_style.true=Creative
nei.options.inventory.creative_tab_style.false=JEI