Compare commits

...
11 Commits
8 changed files with 67 additions and 26 deletions

No files matched your search

+2 -2
View File
@@ -1,8 +1,8 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:CodeChickenCore:1.4.7:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.8.0:dev')
api('com.github.GTNewHorizons:CodeChickenCore:1.4.10:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.8.34:dev')
shadowImplementation('org.apache.commons:commons-csv:1.10.0')
@@ -58,8 +58,13 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
IGuiClientSide, IGuiHandleMouseWheel, IContainerTooltipHandler, INEIGuiHandler {
private static final int BORDER_PADDING = 5;
private final DrawableResource BG_TEXTURE = new DrawableBuilder("nei:textures/gui/recipebg.png", 0, 0, 176, 166)
.build();
private static final int TRANSPARENCY_BORDER = 4;
private final DrawableResource BG_TEXTURE = new DrawableBuilder(
"nei:textures/gui/recipebg.png",
0,
0,
176 + TRANSPARENCY_BORDER * 2,
166 + TRANSPARENCY_BORDER * 2).build();
private static final int BUTTON_WIDTH = 13;
private static final int BUTTON_HEIGHT = 12;
@@ -789,14 +794,14 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
@Override
public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
BG_TEXTURE.draw(
this.guiLeft,
this.guiTop,
this.xSize,
this.ySize,
BORDER_PADDING,
BORDER_PADDING,
BORDER_PADDING,
BORDER_PADDING);
this.guiLeft - TRANSPARENCY_BORDER,
this.guiTop - TRANSPARENCY_BORDER,
this.xSize + TRANSPARENCY_BORDER * 2,
this.ySize + TRANSPARENCY_BORDER * 2,
BORDER_PADDING + TRANSPARENCY_BORDER,
BORDER_PADDING + TRANSPARENCY_BORDER,
BORDER_PADDING + TRANSPARENCY_BORDER,
BORDER_PADDING + TRANSPARENCY_BORDER);
drawJEITabs(mouseX, mouseY);
}
@@ -49,12 +49,14 @@ public class GuiRecipeCatalyst extends ScrollContainer {
private static final int SLOT_SIZE = 16;
private static final int BORDER_PADDING = 6;
private static final int TRANSPARENCY_BORDER = 4;
private static final DrawableResource BG_TEXTURE = new DrawableBuilder(
"nei:textures/catalyst_tab.png",
0,
0,
28,
28).setTextureSize(28, 28).build();
28 + TRANSPARENCY_BORDER * 2,
28 + TRANSPARENCY_BORDER * 2).setTextureSize(28 + TRANSPARENCY_BORDER * 2, 28 + TRANSPARENCY_BORDER * 2)
.build();
private static final DrawableResource FG_TEXTURE = new DrawableBuilder("nei:textures/slot.png", 0, 0, 18, 18)
.setTextureSize(18, 18).build();
@@ -149,7 +151,15 @@ public class GuiRecipeCatalyst extends ScrollContainer {
if (!this.showWidget) return;
GL11.glColor4f(1, 1, 1, 1);
BG_TEXTURE.draw(this.x, this.y, this.w, this.h, BORDER_PADDING, BORDER_PADDING, BORDER_PADDING, BORDER_PADDING);
BG_TEXTURE.draw(
this.x - TRANSPARENCY_BORDER,
this.y - TRANSPARENCY_BORDER,
this.w + TRANSPARENCY_BORDER * 2,
this.h + TRANSPARENCY_BORDER * 2,
BORDER_PADDING + TRANSPARENCY_BORDER,
BORDER_PADDING + TRANSPARENCY_BORDER,
BORDER_PADDING + TRANSPARENCY_BORDER,
BORDER_PADDING + TRANSPARENCY_BORDER);
FG_TEXTURE.draw(
this.x + this.paddingInlineStart - 1,
this.y + this.paddingBlockStart - 1,
@@ -36,6 +36,7 @@ public class RecipeChainTooltipLineHandler implements ITooltipLineHandler {
protected ItemsTooltipLineHandler inputs;
protected ItemsTooltipLineHandler outputs;
protected ItemsTooltipLineHandler remainder;
protected ItemsTooltipLineHandler craftingNeeded;
protected boolean lastShiftKey = false;
protected boolean lastControlKey = false;
@@ -54,6 +55,7 @@ public class RecipeChainTooltipLineHandler implements ITooltipLineHandler {
final List<ItemStack> inputs = new ArrayList<>();
final List<ItemStack> outputs = new ArrayList<>();
final List<ItemStack> remainder = new ArrayList<>();
final List<ItemStack> craftingNeeded = new ArrayList<>();
final ItemStackAmount inventory = new ItemStackAmount();
final GuiContainer currentGui = NEIClientUtils.getGuiContainer();
@@ -167,6 +169,12 @@ public class RecipeChainTooltipLineHandler implements ITooltipLineHandler {
}
}
if (this.lastShiftKey) {
for (Map.Entry<BookmarkItem, Long> item : this.math.requiredAmount.entrySet()) {
if (item.getKey().type == BookmarkItem.BookmarkItemType.RESULT && item.getValue() != 0)
craftingNeeded.add(item.getKey().getItemStack(item.getValue()));
}
}
inputs.sort(
Comparator.comparing((ItemStack stack) -> StackInfo.getFluid(stack) != null)
@@ -203,9 +211,16 @@ public class RecipeChainTooltipLineHandler implements ITooltipLineHandler {
true,
Integer.MAX_VALUE);
this.craftingNeeded = new ItemsTooltipLineHandler(
NEIClientUtils.translate("bookmark.crafting_chain.needed"),
craftingNeeded,
true,
Integer.MAX_VALUE);
if (this.lastShiftKey) {
this.inputs.setLabelColor(EnumChatFormatting.RED);
this.available.setLabelColor(EnumChatFormatting.GREEN);
this.craftingNeeded.setLabelColor(EnumChatFormatting.BLUE);
}
this.size.height = this.size.width = 0;
@@ -217,16 +232,18 @@ public class RecipeChainTooltipLineHandler implements ITooltipLineHandler {
if (!this.math.outputRecipes.isEmpty()) {
this.size.height = 2 + GuiDraw.fontRenderer.FONT_HEIGHT;
}
this.size.width = Math.max(
this.inputs.getSize().width,
Math.max(
this.outputs.getSize().width,
Math.max(this.remainder.getSize().width, this.available.getSize().width)));
Math.max(
this.remainder.getSize().width,
Math.max(this.available.getSize().width, this.craftingNeeded.getSize().width))));
this.size.height += this.inputs.getSize().height + this.outputs.getSize().height
+ this.remainder.getSize().height
+ this.available.getSize().height;
+ this.available.getSize().height
+ this.craftingNeeded.getSize().height;
}
}
@@ -258,7 +275,6 @@ public class RecipeChainTooltipLineHandler implements ITooltipLineHandler {
}
if (NEIClientConfig.recipeChainDir() == 0) {
if (!this.inputs.isEmpty()) {
this.inputs.draw(x, y);
y += this.inputs.getSize().height;
@@ -269,6 +285,11 @@ public class RecipeChainTooltipLineHandler implements ITooltipLineHandler {
y += this.available.getSize().height;
}
if (!this.craftingNeeded.isEmpty()) {
this.craftingNeeded.draw(x, y);
y += this.craftingNeeded.getSize().height;
}
if (!this.outputs.isEmpty()) {
this.outputs.draw(x, y);
y += this.outputs.getSize().height;
@@ -286,6 +307,11 @@ public class RecipeChainTooltipLineHandler implements ITooltipLineHandler {
y += this.inputs.getSize().height;
}
if (!this.craftingNeeded.isEmpty()) {
this.craftingNeeded.draw(x, y);
y += this.craftingNeeded.getSize().height;
}
if (!this.available.isEmpty()) {
this.available.draw(x, y);
y += this.available.getSize().height;
@@ -131,10 +131,6 @@ public class ItemUntranslator {
private final Map<String, String> secondNames = new HashMap<>();
private final Map<String, String> processedNames = new HashMap<>();
static {
API.addSubset("Untranslated", item -> instance.getItemStackDisplayName(item).isEmpty());
}
private ItemUntranslator() {}
public static ItemUntranslator getInstance() {
@@ -363,12 +359,14 @@ public class ItemUntranslator {
this.secondNames.clear();
LanguageRegistryPatch.secondLanguageListCache = null;
this.processedNames.clear();
SubsetWidget.removeTag("Untranslated");
}
public void load() {
unload();
this.secondNames.clear();
LanguageRegistryPatch.secondLanguageListCache = null;
this.processedNames.clear();
if (ClientHandler.loadSettingsFile(CONFIG_FILE, null, this::parseStream)
|| ClientHandler.loadSettingsResource(CONFIG_FILE, this::parseStream)) {
@@ -380,7 +378,7 @@ public class ItemUntranslator {
this.secondNames.clear();
}
SubsetWidget.updateHiddenItems();
API.addSubset("Untranslated", item -> instance.getItemStackDisplayName(item).isEmpty());
}
private void parseStream(Stream<String> lines) {
@@ -47,6 +47,7 @@ nei.bookmark.crafting_chain.input=Ingredients
nei.bookmark.crafting_chain.missing=Missing Items
nei.bookmark.crafting_chain.output=Results
nei.bookmark.crafting_chain.remainder=Remainders
nei.bookmark.crafting_chain.needed=Required Crafts
nei.bookmark.crafting_chain.available=Available Items
nei.inventory.search.placeholder=Search...
nei.itempanel.quantity.default=One stack
@@ -602,6 +603,7 @@ nei.subsets.Items.Tools.Shovels=Shovels
nei.subsets.Items.Weapons=Weapons
nei.subsets.Items.Weapons.Ranged=Ranged
nei.subsets.Items.Weapons.Swords=Swords
nei.subsets.Untranslated=Untranslated
nei.subsets.Mod=Mod
nei.presets.new=New Preset
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB