Skip to content

Commit

Permalink
Blood Altar JEI Tweaks
Browse files Browse the repository at this point in the history
* Removed the text shadows.  This makes them easier to read.
* Added comma thousands separator to LP amounts.
* Moved the tooltip hover area to the Arrow to be consistent with other recipe tooltips.
* Added the "Info" label under the arrow to hint that the tooltip exists.
  • Loading branch information
VT-14 committed Oct 11, 2023
1 parent 95ee608 commit 4233d76
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/generated/resources/assets/bloodmagic/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
"jei.bloodmagic.recipe.lpDrained": "Drained: %s LP",
"jei.bloodmagic.recipe.minimumsouls": "Minimum: %s Will",
"jei.bloodmagic.recipe.potionflask": "Potion Crafting",
"jei.bloodmagic.recipe.requiredlp": "LP: %d",
"jei.bloodmagic.recipe.requiredlp": "LP: %,d",
"jei.bloodmagic.recipe.requiredtier": "Tier: %d",
"jei.bloodmagic.recipe.soulforge": "Hellfire Forge",
"jei.bloodmagic.recipe.soulsdrained": "Drained: %s Will",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ protected void addTranslations()
// JEI
add("jei.bloodmagic.recipe.minimumsouls", "Minimum: %s Will");
add("jei.bloodmagic.recipe.soulsdrained", "Drained: %s Will");
add("jei.bloodmagic.recipe.requiredlp", "LP: %d");
add("jei.bloodmagic.recipe.requiredlp", "LP: %,d");
add("jei.bloodmagic.recipe.requiredtier", "Tier: %d");
add("jei.bloodmagic.recipe.consumptionrate", "Consumption: %s LP/t");
add("jei.bloodmagic.recipe.drainrate", "Drain: %s LP/t");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public BloodAltarRecipeCategory(IGuiHelper guiHelper) {
public List<Component> getTooltipStrings(RecipeBloodAltar recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) {
List<Component> tooltip = Lists.newArrayList();

if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58) {
if (mouseX >= 85 && mouseX <= 104 && mouseY >= 30 && mouseY <= 44) {
tooltip.add(Component.translatable("jei.bloodmagic.recipe.consumptionrate", ChatUtil.DECIMAL_FORMAT.format(recipe.getConsumeRate())));
tooltip.add(Component.translatable("jei.bloodmagic.recipe.drainrate", ChatUtil.DECIMAL_FORMAT.format(recipe.getDrainRate())));
}
Expand Down Expand Up @@ -93,8 +93,15 @@ public void draw(RecipeBloodAltar recipe, IRecipeSlotsView recipeSlotsView, GuiG
String[] infoString = new String[]{
TextHelper.localize("jei.bloodmagic.recipe.requiredtier", NumeralHelper.toRoman(recipe.getMinimumTier() + 1)),
TextHelper.localize("jei.bloodmagic.recipe.requiredlp", recipe.getSyphon())};
guiGraphics.drawString(mc.font, infoString[0], 90 - mc.font.width(infoString[0]) / 2, 0, Color.gray.getRGB());
guiGraphics.drawString(mc.font, infoString[1], 90 - mc.font.width(infoString[1]) / 2, 10, Color.gray.getRGB());
guiGraphics.drawString(mc.font, infoString[0], 90 - mc.font.width(infoString[0]) / 2, 0, Color.gray.getRGB(), false);
guiGraphics.drawString(mc.font, infoString[1], 90 - mc.font.width(infoString[1]) / 2, 10, Color.gray.getRGB(), false);

PoseStack poseStack = guiGraphics.pose();
poseStack.pushPose();
poseStack.translate(87, 41, 0);
poseStack.scale(0.5f, 0.5f, 1f);
guiGraphics.drawString(Minecraft.getInstance().font, Component.translatable("jei.bloodmagic.recipe.info"), 0, 0, 0x8b8b8b, false);
poseStack.popPose();
}

}

0 comments on commit 4233d76

Please sign in to comment.