Skip to content

Commit

Permalink
simplify the side/transporter config tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Oct 28, 2023
1 parent 5dde47f commit d3c2080
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,6 @@ private void addMisc() {
add(MekanismLang.GENERIC_SQUARE_BRACKET, "[%1$s]");
add(MekanismLang.GENERIC_PARENTHESIS, "(%1$s)");
add(MekanismLang.GENERIC_WITH_PARENTHESIS, "%1$s (%2$s)");
add(MekanismLang.GENERIC_WITH_TWO_PARENTHESIS, "%1$s (%2$s) (%3$s)");
add(MekanismLang.GENERIC_FRACTION, "%1$s/%2$s");
add(MekanismLang.GENERIC_TRANSFER, "- %1$s (%2$s)");
add(MekanismLang.GENERIC_PER_TICK, "%1$s/t");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Map;
import mekanism.api.RelativeSide;
import mekanism.api.text.EnumColor;
import mekanism.api.text.TextComponentUtil;
import mekanism.client.gui.GuiMekanism;
import mekanism.client.gui.IGuiWrapper;
import mekanism.client.gui.element.GuiInnerScreen;
Expand Down Expand Up @@ -103,8 +104,10 @@ private IHoverable getOnHover(RelativeSide side) {
if (onHover instanceof SideDataButton button) {
DataType dataType = button.getDataType();
if (dataType != null) {
displayTooltips(guiGraphics, mouseX, mouseY, MekanismLang.GENERIC_WITH_TWO_PARENTHESIS.translateColored(dataType.getColor(), dataType,
dataType.getColor().getName(), side));
displayTooltips(guiGraphics, mouseX, mouseY,
TextComponentUtil.translate(side.getTranslationKey()),
TextComponentUtil.build(dataType.getColor(), dataType)
);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.Collections;
import mekanism.api.RelativeSide;
import mekanism.api.text.EnumColor;
import mekanism.api.text.TextComponentUtil;
import mekanism.client.gui.GuiMekanism;
import mekanism.client.gui.IGuiWrapper;
import mekanism.client.gui.element.GuiInnerScreen;
Expand Down Expand Up @@ -78,7 +79,10 @@ private IHoverable getOnHover(RelativeSide side) {
if (dataType != null) {
EnumColor color = button.getColor();
Component colorComponent = color == null ? MekanismLang.NONE.translate() : color.getColoredName();
displayTooltips(guiGraphics, mouseX, mouseY, MekanismLang.GENERIC_WITH_PARENTHESIS.translate(colorComponent, side));
displayTooltips(guiGraphics, mouseX, mouseY,
TextComponentUtil.translate(side.getTranslationKey()),
colorComponent
);
}
}
};
Expand Down
1 change: 0 additions & 1 deletion src/main/java/mekanism/common/MekanismLang.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public enum MekanismLang implements ILangEntry {
GENERIC_SQUARE_BRACKET("generic", "square_bracket"),
GENERIC_PARENTHESIS("generic", "parenthesis"),
GENERIC_WITH_PARENTHESIS("generic", "with_parenthesis"),
GENERIC_WITH_TWO_PARENTHESIS("generic", "with_two_parenthesis"),
GENERIC_FRACTION("generic", "fraction"),
GENERIC_TRANSFER("generic", "transfer"),
GENERIC_PER_TICK("generic", "per_tick"),
Expand Down

0 comments on commit d3c2080

Please sign in to comment.