diff options
Diffstat (limited to 'src/main/java/gregtech')
4 files changed, 52 insertions, 33 deletions
diff --git a/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java b/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java index 5b858a426a..007a73d588 100644 --- a/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java +++ b/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java @@ -133,14 +133,7 @@ public class MultiblockTooltipBuilder { * @return Instance this method was called on. */ public MultiblockTooltipBuilder addSeparator() { - switch (GTMod.gregtechproxy.separatorStyle) { - case 0 -> iLines.add(" "); - case 1 -> iLines.add(EnumChatFormatting.GRAY + StringUtils.getRepetitionOf('-', 41)); - default -> iLines.add( - EnumChatFormatting.GRAY.toString() + EnumChatFormatting.STRIKETHROUGH - + StringUtils.getRepetitionOf('-', 41)); - } - return this; + return addSeparator(EnumChatFormatting.GRAY, 41); } /** @@ -148,11 +141,12 @@ public class MultiblockTooltipBuilder { * * @return Instance this method was called on. */ - public MultiblockTooltipBuilder addLineSeparator(EnumChatFormatting color, int length) { - if (GTMod.gregtechproxy.separatorStyle == 1) { - iLines.add(color + StringUtils.getRepetitionOf('-', length)); - } else { - iLines.add(color.toString() + EnumChatFormatting.STRIKETHROUGH + StringUtils.getRepetitionOf('-', length)); + public MultiblockTooltipBuilder addSeparator(EnumChatFormatting color, int length) { + switch (GTMod.gregtechproxy.separatorStyle) { + case 0 -> iLines.add(" "); + case 1 -> iLines.add(color + StringUtils.getRepetitionOf('-', length)); + default -> iLines + .add(color.toString() + EnumChatFormatting.STRIKETHROUGH + StringUtils.getRepetitionOf('-', length)); } return this; } @@ -681,11 +675,25 @@ public class MultiblockTooltipBuilder { * * @return Instance this method was called on. */ - public MultiblockTooltipBuilder addStructureInfoLineSeparator(EnumChatFormatting color, int length) { - if (GTMod.gregtechproxy.separatorStyle == 1) { - sLines.add(color + StringUtils.getRepetitionOf('-', length)); + public MultiblockTooltipBuilder addStructureInfoSeparator(EnumChatFormatting color, int length, + boolean useFinisherConfig) { + if (useFinisherConfig) { + switch (GTMod.gregtechproxy.tooltipFinisherStyle) { + case 0 -> {} + case 1 -> sLines.add(TAB + " "); + case 2 -> sLines.add(TAB + color + StringUtils.getRepetitionOf('-', length)); + default -> sLines.add( + TAB + color.toString() + + EnumChatFormatting.STRIKETHROUGH + + StringUtils.getRepetitionOf('-', length)); + } } else { - sLines.add(color.toString() + EnumChatFormatting.STRIKETHROUGH + StringUtils.getRepetitionOf('-', length)); + switch (GTMod.gregtechproxy.separatorStyle) { + case 0 -> sLines.add(TAB + " "); + case 1 -> sLines.add(TAB + color + StringUtils.getRepetitionOf('-', length)); + default -> sLines + .add(TAB + color + EnumChatFormatting.STRIKETHROUGH + StringUtils.getRepetitionOf('-', length)); + } } return this; } @@ -696,14 +704,7 @@ public class MultiblockTooltipBuilder { * @return Instance this method was called on. */ public MultiblockTooltipBuilder addStructureInfoSeparator() { - switch (GTMod.gregtechproxy.separatorStyle) { - case 0 -> sLines.add(" "); - case 1 -> sLines.add(EnumChatFormatting.GRAY + StringUtils.getRepetitionOf('-', 30)); - default -> sLines.add( - EnumChatFormatting.GRAY.toString() + EnumChatFormatting.STRIKETHROUGH - + StringUtils.getRepetitionOf('-', 30)); - } - return this; + return addStructureInfoSeparator(EnumChatFormatting.GRAY, 30, false); } /** @@ -754,8 +755,7 @@ public class MultiblockTooltipBuilder { * @param authors Formatted names of the creators of this multiblock machine - if any */ public MultiblockTooltipBuilder toolTipFinisher(@Nullable String... authors) { - iLines.add(" "); - return toolTipFinisher0(authors); + return toolTipFinisher(EnumChatFormatting.GRAY, 41, authors); } /** @@ -766,15 +766,23 @@ public class MultiblockTooltipBuilder { * <p> * Ends the building process. * - * @param authors Formatted names of the creators of this multiblock machine - if any + * @param separatorColor Color of the separator line + * @param separatorLength Length of the separator line + * @param authors Formatted names of the creators of this multiblock machine - if any */ + public MultiblockTooltipBuilder toolTipFinisher(EnumChatFormatting separatorColor, int separatorLength, @Nullable String... authors) { - this.addLineSeparator(separatorColor, separatorLength); - return toolTipFinisher0(authors); - } - private MultiblockTooltipBuilder toolTipFinisher0(@Nullable String... authors) { + switch (GTMod.gregtechproxy.tooltipFinisherStyle) { + case 0 -> {} + case 1 -> iLines.add(" "); + case 2 -> iLines.add(separatorColor + StringUtils.getRepetitionOf('-', separatorLength)); + default -> iLines.add( + separatorColor.toString() + EnumChatFormatting.STRIKETHROUGH + + StringUtils.getRepetitionOf('-', separatorLength)); + } + iLines.add( TT_hold + " " + EnumChatFormatting.BOLD @@ -807,7 +815,7 @@ public class MultiblockTooltipBuilder { iLines.add(sb.toString()); } hLines.add(TT_structurehint); - sLines.add(" "); + this.addStructureInfoSeparator(EnumChatFormatting.GRAY, 30, true); sLines.add(EnumChatFormatting.WHITE + TT_StructureComplex); sLines.add( EnumChatFormatting.WHITE + TT_SeeStructure1 diff --git a/src/main/java/gregtech/common/GTProxy.java b/src/main/java/gregtech/common/GTProxy.java index 1515256ec1..643811234d 100644 --- a/src/main/java/gregtech/common/GTProxy.java +++ b/src/main/java/gregtech/common/GTProxy.java @@ -692,6 +692,12 @@ public abstract class GTProxy implements IGTMod, IFuelHandler { public int separatorStyle = 2; /** + * Which style should tooltip finisher separator lines have? 0: no line, 1: empty line, 2: dashed line, 3+: + * continuous line + */ + public int tooltipFinisherStyle = 1; + + /** * Whether to show seconds or ticks on NEI */ public boolean mNEIRecipeSecondMode = true; diff --git a/src/main/java/gregtech/common/config/Client.java b/src/main/java/gregtech/common/config/Client.java index f51c154466..fdbd0fe6e0 100644 --- a/src/main/java/gregtech/common/config/Client.java +++ b/src/main/java/gregtech/common/config/Client.java @@ -107,6 +107,10 @@ public class Client { @Config.Comment("Which style should tooltip separator lines have? 0: empty line, 1: dashed line, 2+: continuous line.") @Config.DefaultInt(2) public int separatorStyle; + + @Config.Comment("Which style should tooltip finisher separator lines have? 0: no line, 1: empty line, 2: dashed line, 3+: continuous line.") + @Config.DefaultInt(1) + public int tooltipFinisherStyle; } @Config.LangKey("GT5U.gui.config.client.preference") diff --git a/src/main/java/gregtech/loaders/preload/GTPreLoad.java b/src/main/java/gregtech/loaders/preload/GTPreLoad.java index 12c3294153..7fcea477c5 100644 --- a/src/main/java/gregtech/loaders/preload/GTPreLoad.java +++ b/src/main/java/gregtech/loaders/preload/GTPreLoad.java @@ -588,6 +588,7 @@ public class GTPreLoad { GTMod.gregtechproxy.mTooltipShiftVerbosity = Client.iface.tooltipShiftVerbosity; GTMod.gregtechproxy.mTitleTabStyle = Client.iface.titleTabStyle; GTMod.gregtechproxy.separatorStyle = Client.iface.separatorStyle; + GTMod.gregtechproxy.tooltipFinisherStyle = Client.iface.tooltipFinisherStyle; GTMod.gregtechproxy.mNEIRecipeSecondMode = Client.nei.NEIRecipeSecondMode; GTMod.gregtechproxy.mNEIRecipeOwner = Client.nei.NEIRecipeOwner; |