Remove creative tab style option for recipe tabs (#1107)

This commit is contained in:
slprime authored and GitHub committed 2026-11-04 16:34:56 +02:00
1 parent 9411541fd8
commit 8e1541eab1
9 files changed
+37 -181

No files matched your search

@@ -256,10 +256,6 @@ public class NEIClientConfig {
.getBooleanValue(true);
API.addOption(new OptionToggleButton("inventory.guirecipe.cycledIngredientsTooltip", true));
tag.getTag("inventory.guirecipe.creativeTabStyle").setComment("Creative or JEI style tabs")
.getBooleanValue(false);
API.addOption(new OptionToggleButton("inventory.guirecipe.creativeTabStyle", true));
tag.getTag("inventory.guirecipe.itemPresenceOverlay").setComment("Item presence overlay on ?-hover")
.getIntValue(1);
API.addOption(new OptionCycled("inventory.guirecipe.itemPresenceOverlay", 3, true));
@@ -1156,10 +1152,6 @@ public class NEIClientConfig {
return getIntSetting("inventory.guirecipe.jeiStyleRecipeCatalyst");
}
public static boolean useCreativeTabStyle() {
return getBooleanSetting("inventory.guirecipe.creativeTabStyle");
}
public static boolean ignorePotionOverlap() {
return getBooleanSetting("inventory.bookmarks.ignorePotionOverlap");
}
@@ -26,6 +26,7 @@ import codechicken.nei.ColorUtils;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.NEIClientUtils;
import codechicken.nei.Widget;
import codechicken.nei.drawable.DrawableBuilder;
import codechicken.nei.drawable.DrawableResource;
import codechicken.nei.event.NEIRegisterHandlerInfosEvent;
import codechicken.nei.guihook.GuiContainerManager;
@@ -43,26 +44,29 @@ public abstract class GuiRecipeTab extends Widget {
protected final String handlerName;
protected final String handlerID;
public static final int TAB_WIDTH = 24;
public static final int TAB_HEIGHT = 24;
private static final DrawableResource selectedTabImage = new DrawableBuilder(
"nei:textures/nei_tabbed_sprites.png",
0,
16,
24,
24).build();
private static final DrawableResource unselectedTabImage = new DrawableBuilder(
"nei:textures/nei_tabbed_sprites.png",
24,
16,
24,
24).build();
private boolean selected;
public abstract int getWidth();
public abstract int getHeight();
public abstract DrawableResource getSelectedTabImage();
public abstract DrawableResource getUnselectedTabImage();
protected abstract int getForegroundIconX();
protected abstract int getForegroundIconY();
public GuiRecipeTab(IRecipeHandler handler, int x, int y) {
super();
this.x = x;
this.y = y;
this.w = getWidth();
this.h = getHeight();
this.w = TAB_WIDTH;
this.h = TAB_HEIGHT;
this.handler = handler;
this.handlerName = handler.getHandlerId();
this.selected = false;
@@ -83,21 +87,16 @@ public abstract class GuiRecipeTab extends Widget {
public void drawBackground(int mouseX, int mouseY) {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glColor4f(1, 1, 1, 1);
final DrawableResource image;
if (selected) image = getSelectedTabImage();
else image = getUnselectedTabImage();
final int iconX = x + (w - image.getWidth()) / 2;
final int iconY = y + (h - image.getHeight()) / 2;
image.draw(iconX, iconY);
final DrawableResource image = this.selected ? selectedTabImage : unselectedTabImage;
image.draw(this.x, this.y);
}
public void drawForeground(int mouseX, int mouseY) {
final int iconX = getForegroundIconX();
final int iconY = getForegroundIconY();
final int iconX = this.x + 4;
final int iconY = this.y + 4;
final FontRenderer fontRenderer = GuiDraw.fontRenderer;
final HandlerInfo handlerInfo = getHandlerInfo(handlerName, handlerID);
final HandlerInfo handlerInfo = getHandlerInfo(this.handlerName, this.handlerID);
final DrawableResource icon = handlerInfo != null ? handlerInfo.getImage() : null;
final ItemStack itemStack = handlerInfo != null ? handlerInfo.getItemStack() : null;
@@ -112,7 +111,7 @@ public abstract class GuiRecipeTab extends Widget {
if (!isEnabled) GL11.glDisable(GL12.GL_RESCALE_NORMAL);
} else {
// Text fallback
String text = handler.getRecipeName();
String text = this.handler.getRecipeName();
if (text != null && text.length() > 0) {
if (text.length() > 2) {
text = text.substring(0, 2);
@@ -121,9 +120,10 @@ public abstract class GuiRecipeTab extends Widget {
text = "??";
}
int textCenterX = x + (int) (getWidth() / 2f);
int textCenterY = y + (int) (getHeight() / 2f) - 3;
int color = selected ? ColorUtils.buttonLabelHover.getColor() : ColorUtils.buttonLabelNormal.getColor();
int textCenterX = this.x + (int) (this.w / 2f);
int textCenterY = this.y + (int) (this.h / 2f) - 3;
int color = this.selected ? ColorUtils.buttonLabelHover.getColor()
: ColorUtils.buttonLabelNormal.getColor();
fontRenderer.drawStringWithShadow(
text,
textCenterX - (int) (fontRenderer.getStringWidth(text) / 2f),
@@ -1,56 +0,0 @@
package codechicken.nei.recipe;
import codechicken.nei.drawable.DrawableBuilder;
import codechicken.nei.drawable.DrawableResource;
public abstract class GuiRecipeTabCreative extends GuiRecipeTab {
public static final int TAB_WIDTH = 28;
public static final int TAB_HEIGHT = 31;
private static final DrawableResource selectedTabImage = new DrawableBuilder(
"minecraft:textures/gui/container/creative_inventory/tabs.png",
28,
32,
28,
32).build();
private static final DrawableResource unselectedTabImage = new DrawableBuilder(
"minecraft:textures/gui/container/creative_inventory/tabs.png",
28,
0,
28,
30).build();
public GuiRecipeTabCreative(IRecipeHandler handler, int x, int y) {
super(handler, x, y);
}
@Override
public int getWidth() {
return TAB_WIDTH;
}
@Override
public int getHeight() {
return TAB_HEIGHT;
}
@Override
protected int getForegroundIconX() {
return x + (w - 16) / 2;
}
@Override
protected int getForegroundIconY() {
return y + h - 22;
}
@Override
public DrawableResource getSelectedTabImage() {
return selectedTabImage;
}
@Override
public DrawableResource getUnselectedTabImage() {
return unselectedTabImage;
}
}
@@ -1,56 +0,0 @@
package codechicken.nei.recipe;
import codechicken.nei.drawable.DrawableBuilder;
import codechicken.nei.drawable.DrawableResource;
public abstract class GuiRecipeTabJEI extends GuiRecipeTab {
public static final int TAB_WIDTH = 24;
public static final int TAB_HEIGHT = 24;
private static final DrawableResource selectedTabImage = new DrawableBuilder(
"nei:textures/nei_tabbed_sprites.png",
0,
16,
24,
24).build();
private static final DrawableResource unselectedTabImage = new DrawableBuilder(
"nei:textures/nei_tabbed_sprites.png",
24,
16,
24,
24).build();
public GuiRecipeTabJEI(IRecipeHandler handler, int x, int y) {
super(handler, x, y);
}
@Override
public int getWidth() {
return TAB_WIDTH;
}
@Override
public int getHeight() {
return TAB_HEIGHT;
}
@Override
protected int getForegroundIconX() {
return x + 4;
}
@Override
protected int getForegroundIconY() {
return y + 4;
}
@Override
public DrawableResource getSelectedTabImage() {
return selectedTabImage;
}
@Override
public DrawableResource getUnselectedTabImage() {
return unselectedTabImage;
}
}
@@ -47,11 +47,11 @@ public class GuiRecipeTabs {
};
public static int getTabWidth() {
return NEIClientConfig.useCreativeTabStyle() ? GuiRecipeTabCreative.TAB_WIDTH : GuiRecipeTabJEI.TAB_WIDTH;
return GuiRecipeTab.TAB_WIDTH;
}
public static int getTabHeight() {
return NEIClientConfig.useCreativeTabStyle() ? GuiRecipeTabCreative.TAB_HEIGHT : GuiRecipeTabJEI.TAB_HEIGHT;
return GuiRecipeTab.TAB_HEIGHT;
}
public void update(GuiRecipe<?> guiRecipe) {
@@ -85,27 +85,15 @@ public class GuiRecipeTabs {
final IRecipeHandler handler = this.currenthandlers.get(index);
final int tabX = this.area.x + (i * tabWidth);
if (NEIClientConfig.useCreativeTabStyle()) {
tabs.add(new GuiRecipeTabCreative(handler, tabX, this.area.y) {
this.tabs.add(new GuiRecipeTab(handler, tabX, this.area.y) {
@Override
public boolean onButtonPress(boolean rightclick) {
setRecipePage(index);
return true;
}
@Override
public boolean onButtonPress(boolean rightclick) {
setRecipePage(index);
return true;
}
});
} else {
tabs.add(new GuiRecipeTabJEI(handler, tabX, this.area.y) {
@Override
public boolean onButtonPress(boolean rightclick) {
setRecipePage(index);
return true;
}
});
}
});
}
}
@@ -412,9 +412,6 @@ nei.options.inventory.search.subsetsSearchMode=Item Subsets Search
nei.options.inventory.search.subsetsSearchMode.0=Always
nei.options.inventory.search.subsetsSearchMode.1=Prefix: %s
nei.options.inventory.search.subsetsSearchMode.2=Never
nei.options.inventory.guirecipe.creativeTabStyle=Creative or JEI tab style
nei.options.inventory.guirecipe.creativeTabStyle.true=Creative
nei.options.inventory.guirecipe.creativeTabStyle.false=JEI
nei.options.inventory.optimize_gui_overlap_computation=Optimize computation for GUI overlap
nei.options.inventory.optimize_gui_overlap_computation.true=Yes
nei.options.inventory.optimize_gui_overlap_computation.false=No
@@ -251,9 +251,6 @@ nei.options.inventory.search.subsetsSearchMode=Поиск по подмноже
nei.options.inventory.search.subsetsSearchMode.0=Всегда
nei.options.inventory.search.subsetsSearchMode.1=Префикс: %s
nei.options.inventory.search.subsetsSearchMode.2=Никогда
nei.options.inventory.guirecipe.creativeTabStyle=Стиль вкладок: Творческий или JEI
nei.options.inventory.guirecipe.creativeTabStyle.true=Творческий
nei.options.inventory.guirecipe.creativeTabStyle.false=JEI
nei.options.inventory.optimize_gui_overlap_computation=Оптимизация вычислений при перекрытии GUI
nei.options.inventory.optimize_gui_overlap_computation.true=Да
nei.options.inventory.optimize_gui_overlap_computation.false=Нет
@@ -359,9 +359,6 @@ nei.options.inventory.search.subsetsSearchMode=Пошук у підгрупах
nei.options.inventory.search.subsetsSearchMode.0=Завжди
nei.options.inventory.search.subsetsSearchMode.1=Префікс: %s
nei.options.inventory.search.subsetsSearchMode.2=Ніколи
nei.options.inventory.guirecipe.creativeTabStyle=Стиль вкладок Creative чи JEI
nei.options.inventory.guirecipe.creativeTabStyle.true=Creative
nei.options.inventory.guirecipe.creativeTabStyle.false=JEI
nei.options.inventory.optimize_gui_overlap_computation=Оптимізувати обчислення перекриття інтерфейсів
nei.options.inventory.optimize_gui_overlap_computation.true=Так
nei.options.inventory.optimize_gui_overlap_computation.false=Ні
@@ -137,9 +137,6 @@ nei.options.inventory.bookmarks.showRecipeMarker.0=否
nei.options.inventory.showItemQuantityWidget=显示物品数量栏(右下角)
nei.options.inventory.showItemQuantityWidget.true=是
nei.options.inventory.showItemQuantityWidget.false=否
nei.options.inventory.guirecipe.creativeTabStyle=创造模式/JEI标签页
nei.options.inventory.guirecipe.creativeTabStyle.true=创造模式
nei.options.inventory.guirecipe.creativeTabStyle.false=JEI
nei.options.inventory.bookmarks.ignorePotionOverlap=忽略书签与药水效果重叠
nei.options.inventory.bookmarks.ignorePotionOverlap.true=忽略
nei.options.inventory.bookmarks.ignorePotionOverlap.false=规避