Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

dependencies {
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.14-GTNH:dev')
api('com.github.GTNewHorizons:GTNHLib:0.9.62:dev')
api('com.github.GTNewHorizons:GTNHLib:0.11.30:dev')

compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.60:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.7.10:dev') {transitive=false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
import vazkii.botania.client.integration.nei.NEIHelper;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.lib.LibColorUtils;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lexicon.page.PageText;
import codechicken.lib.gui.GuiDraw;
Expand Down Expand Up @@ -89,22 +90,24 @@ public void drawBackground(int recipe) {
EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal(recipeObj.entry.getUnlocalizedName()),
82,
30,
0x404040,
LibColorUtils.neiHandlerBotaniaLexicaTitle.getColor(),
false);

KnowledgeType type = recipeObj.entry.getKnowledgeType();
GuiDraw.drawStringC(
type.color + StatCollector.translateToLocal(type.getUnlocalizedName()).replaceAll("&[0-9a-fklmnor]", ""),
82,
42,
0x404040,
LibColorUtils.neiHandlerBotaniaLexicaKnowledge.getColor(),
false);

PageText.renderText(
5,
42,
160,
200,
10,
LibColorUtils.neiHandlerBotaniaLexicaTagline.getColor(),
"\"" + StatCollector.translateToLocal(recipeObj.entry.getTagline()) + "\"");

String key = LexiconRecipeMappings.stackToString(recipeObj.item.item);
Expand All @@ -121,12 +124,12 @@ else if (quickInfo.equals(quickInfoLocal))
StatCollector.translateToLocal("botania.nei.lexicaSeparator"),
82,
80,
0x404040,
LibColorUtils.neiHandlerBotaniaLexicaExtraInfo.getColor(),
false);
s = quickInfoLocal;
}

PageText.renderText(5, 80, 160, 200, s);
PageText.renderText(5, 80, 160, 200, 10, LibColorUtils.neiHandlerBotaniaLexicaExtraInfoDesc.getColor(), s);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ public static void renderText(int x, int y, int width, int height, String unloca
renderText(x, y, width, height, 10, unlocalizedText);
}

@SideOnly(Side.CLIENT)
public static void renderText(int x, int y, int width, int height, int paragraphSize, String unlocalizedText) {
renderText(x, y, width, height, paragraphSize, 0, unlocalizedText);
}

@SideOnly(Side.CLIENT)
public static void renderText(int x, int y, int width, int height, int paragraphSize, int color, String unlocalizedText) {
y += 10;
width -= 4;

Expand Down Expand Up @@ -132,7 +136,7 @@ public static void renderText(int x, int y, int width, int height, int paragraph
String tok = words.get(idx);
int tw = font.getStringWidth(tok);

font.drawString(tok, xi, y, 0);
font.drawString(tok, xi, y, color);
xi += tw;

if (justify && gi < gapIds.size() && idx == gapIds.get(gi)) {
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/vazkii/botania/common/lib/LibColorUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package vazkii.botania.common.lib;

import com.gtnewhorizon.gtnhlib.color.ColorResource;


public class LibColorUtils {

private static final ColorResource.Factory color = new ColorResource.Factory("botania");

public static final ColorResource
// spotless:off
neiHandlerBotaniaLexicaTitle = color.rgb("neiHandlerBotaniaLexicaTitle", "0x404040"),
neiHandlerBotaniaLexicaKnowledge = color.rgb("neiHandlerBotaniaLexicaKnowledge", "0x404040"),
neiHandlerBotaniaLexicaTagline = color.rgb("neiHandlerBotaniaLexicaTagline", "0x404040"),
neiHandlerBotaniaLexicaExtraInfo = color.rgb("neiHandlerBotaniaLexicaExtraInfo", "0x404040"),
neiHandlerBotaniaLexicaExtraInfoDesc = color.rgb("neiHandlerBotaniaLexicaExtraInfoDesc", "0x404040");
// spotless:on
}