Skip to content

Commit

Permalink
Backport #132: Fixes for some tooltips in Powah's GUI (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
StarskyXIII authored Aug 3, 2024
1 parent 3cd426c commit b37e940
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ protected void renderTooltip(GuiGraphics gui, int mouseX, int mouseY) {
.translatable("info.lollipop.fe.stored", Util.addCommas(energy.getStored()), Util.numFormat(energy.getCapacity()))
.withStyle(ChatFormatting.DARK_GRAY)));
list.add(Component.translatable("info.lollipop.generates").withStyle(ChatFormatting.GRAY).append(Text.COLON)
.append(Component.literal(Util.numFormat(this.te.getGeneration())).append(Component.translatable("info.lollipop.fe.pet.tick"))
.append(Component.translatable("info.lollipop.fe.pet.tick", Util.numFormat(this.te.getGeneration()))
.withStyle(ChatFormatting.DARK_GRAY)));
list.add(Component.translatable("info.lollipop.max.extract").withStyle(ChatFormatting.GRAY).append(Text.COLON)
.append(Component.literal(Util.numFormat(energy.getMaxExtract())).append(Component.translatable("info.lollipop.fe.pet.tick"))
.append(Component.translatable("info.lollipop.fe.pet.tick", Util.numFormat(energy.getMaxExtract()))
.withStyle(ChatFormatting.DARK_GRAY)));
gui.renderComponentTooltip(font, list, mouseX, mouseY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ protected void renderTooltip(GuiGraphics gui, int mouseX, int mouseY) {
.translatable("info.lollipop.fe.stored", Util.addCommas(energy.getStored()), Util.numFormat(energy.getCapacity()))
.withStyle(ChatFormatting.DARK_GRAY)));
list.add(Component.translatable("info.lollipop.generates").withStyle(ChatFormatting.GRAY).append(Text.COLON)
.append(Component.literal(Util.numFormat(this.te.getGeneration())).append(Component.translatable("info.lollipop.fe.pet.tick"))
.append(Component.translatable("info.lollipop.fe.pet.tick", Util.numFormat(this.te.getGeneration()))
.withStyle(ChatFormatting.DARK_GRAY)));
list.add(Component.translatable("info.lollipop.max.extract").withStyle(ChatFormatting.GRAY).append(Text.COLON)
.append(Component.literal(Util.numFormat(energy.getMaxExtract())).append(Component.translatable("info.lollipop.fe.pet.tick"))
.append(Component.translatable("info.lollipop.fe.pet.tick", Util.numFormat(energy.getMaxExtract()))
.withStyle(ChatFormatting.DARK_GRAY)));
gui.renderComponentTooltip(font, list, mouseX, mouseY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ protected void renderTooltip(GuiGraphics gui, int mouseX, int mouseY) {
.translatable("info.lollipop.fe.stored", Util.addCommas(energy.getStored()), Util.numFormat(energy.getCapacity()))
.withStyle(ChatFormatting.DARK_GRAY)));
list.add(Component.translatable("info.powah.generation.factor").withStyle(ChatFormatting.GRAY).append(Text.COLON)
.append(Component.literal(Util.numFormat(this.te.getGeneration())).append(Component.translatable("info.lollipop.fe.pet.tick"))
.append(Component.translatable("info.lollipop.fe.pet.tick", Util.numFormat(this.te.getGeneration()))
.withStyle(ChatFormatting.DARK_GRAY)));
list.add(Component.translatable("info.lollipop.generating").withStyle(ChatFormatting.GRAY).append(Text.COLON)
.append(Component.literal(Util.numFormat((long) this.te.calcProduction()))
.append(Component.translatable("info.lollipop.fe.pet.tick")).withStyle(ChatFormatting.DARK_GRAY)));
.append(Component.translatable("info.lollipop.fe.pet.tick", Util.numFormat((long) this.te.calcProduction()))
.withStyle(ChatFormatting.DARK_GRAY)));
list.add(Component.translatable("info.lollipop.max.extract").withStyle(ChatFormatting.GRAY).append(Text.COLON)
.append(Component.literal(Util.numFormat(energy.getMaxExtract())).append(Component.translatable("info.lollipop.fe.pet.tick"))
.append(Component.translatable("info.lollipop.fe.pet.tick", Util.numFormat(energy.getMaxExtract()))
.withStyle(ChatFormatting.DARK_GRAY)));

gui.renderComponentTooltip(font, list, mouseX, mouseY);
Expand All @@ -117,8 +117,9 @@ protected void renderTooltip(GuiGraphics gui, int mouseX, int mouseY) {
.append(Component.translatable("info.lollipop.mb.stored", String.format("%.0f", this.te.fuel.getTicks()),
String.format("%.0f", this.te.fuel.getMax())).withStyle(ChatFormatting.DARK_GRAY)));
list.add(Component.translatable("info.lollipop.using").withStyle(ChatFormatting.GRAY).append(Text.COLON)
.append(Component.literal(ChatFormatting.GREEN + String.format("%.4f", this.te.calcConsumption()))
.append(Component.translatable("info.lollipop.mb.pet.tick")).withStyle(ChatFormatting.DARK_GRAY)));
.append(Component
.translatable("info.lollipop.mb.pet.tick", ChatFormatting.GREEN + String.format("%.4f", this.te.calcConsumption()))
.withStyle(ChatFormatting.DARK_GRAY)));
gui.renderComponentTooltip(font, list, mouseX, mouseY);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ protected void renderTooltip(GuiGraphics gui, int mouseX, int mouseY) {
.translatable("info.lollipop.fe.stored", Util.addCommas(energy.getStored()), Util.numFormat(energy.getCapacity()))
.withStyle(ChatFormatting.DARK_GRAY)));
list.add(Component.translatable("info.lollipop.generates").withStyle(ChatFormatting.GRAY).append(Text.COLON)
.append(Component.literal(Util.numFormat(this.te.getGeneration())).append(Component.translatable("info.lollipop.fe.pet.tick"))
.append(Component.translatable("info.lollipop.fe.pet.tick", Util.numFormat(this.te.getGeneration()))
.withStyle(ChatFormatting.DARK_GRAY)));
list.add(Component.translatable("info.lollipop.max.extract").withStyle(ChatFormatting.GRAY).append(Text.COLON)
.append(Component.literal(Util.numFormat(energy.getMaxExtract())).append(Component.translatable("info.lollipop.fe.pet.tick"))
.append(Component.translatable("info.lollipop.fe.pet.tick", Util.numFormat(energy.getMaxExtract()))
.withStyle(ChatFormatting.DARK_GRAY)));
gui.renderComponentTooltip(font, list, mouseX, mouseY);
}
Expand Down

0 comments on commit b37e940

Please sign in to comment.