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 14 additions and 41 deletions

No files matched your search

+12 -10
View File
@@ -166,29 +166,31 @@ public class ItemPanel extends PanelWidget {
}
protected int resizeFooter(GuiContainer gui) {
if (!NEIClientConfig.showItemQuantityWidget() && NEIClientConfig.isSearchWidgetCentered()) return 0;
if (!(NEIClientConfig.showItemQuantityWidget() || !NEIClientConfig.isSearchWidgetCentered())) return 0;
final int BUTTON_SIZE = 16;
final int BUTTON_SIZE = 20;
more.w = less.w = BUTTON_SIZE;
quantity.h = BUTTON_SIZE;
if (NEIClientConfig.isSearchWidgetCentered()) {
more.h = less.h = BUTTON_SIZE;
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 {
quantity.x = (int) (x + (w * 0.7)) + 3;
quantity.y = y + h - BUTTON_SIZE;
quantity.w = (int) ((w * 0.3) - BUTTON_SIZE - 1);
more.x = less.x;
more.y = y + h - BUTTON_SIZE;
more.h = less.h = BUTTON_SIZE / 2;
more.y = y + h - (more.h * 2);
less.x = more.x = quantity.x + quantity.w;
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,11 +126,12 @@ public class LayoutStyleMinecraft extends LayoutStyle {
presetsPanel.y = 2;
presetsPanel.x = (gui.width - gui.xSize) / 2 + gui.xSize - presetsPanel.w;
searchField.h = 20;
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;
}
@@ -282,20 +282,6 @@ public abstract class GuiRecipeTab extends Widget {
handlerMap.keySet().removeAll(handlerRemoverFromIMC);
handlerMap.putAll(handlerAdderFromIMC);
if (!handlerAdderFromIMC.isEmpty()) {
// If we're getting an IMC message, it probably means it should match
Set<String> handlerIds = new HashSet<>(handlerMap.keySet());
handlerAdderFromIMC.keySet().forEach(handlerName -> {
if (!handlerIds.contains(handlerName)) {
NEIClientConfig.logger.warn("Could not find a registered handlerID that matches " + handlerName);
handlerIds.forEach(handler -> {
if (handler.equalsIgnoreCase(handlerName)) {
NEIClientConfig.logger.warn(" -- Did you mean: " + handler);
}
});
}
});
}
NEIClientConfig.logger.info("Sending {}", NEIRegisterHandlerInfosEvent.class.getSimpleName());
MinecraftForge.EVENT_BUS.post(new NEIRegisterHandlerInfosEvent());
}
@@ -13,10 +13,8 @@ import java.nio.channels.ReadableByteChannel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import net.minecraft.item.ItemStack;
@@ -229,20 +227,6 @@ public class RecipeCatalysts {
}
}
if (!catalystsAdderFromIMC.isEmpty()) {
// If we're getting an IMC message, it probably means it should match
Set<String> handlerIds = new HashSet<>(GuiRecipeTab.handlerMap.keySet());
catalystsAdderFromIMC.keySet().forEach(handlerName -> {
if (!handlerIds.contains(handlerName)) {
NEIClientConfig.logger.warn("Could not find a registered handlerID that matches " + handlerName);
handlerIds.forEach(handler -> {
if (handler.equalsIgnoreCase(handlerName)) {
NEIClientConfig.logger.warn(" -- Did you mean: " + handler);
}
});
}
});
}
for (Map.Entry<String, List<ItemStack>> entry : catalystsRemoverFromAPI.entrySet()) {
String handlerID = entry.getKey();
if (recipeCatalystMap.containsKey(handlerID)) {