Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltips R' Us #2099

Draft
wants to merge 12 commits into
base: 1.20.1
Choose a base branch
from
412 changes: 165 additions & 247 deletions src/generated/resources/assets/gtceu/lang/en_ud.json

Large diffs are not rendered by default.

412 changes: 165 additions & 247 deletions src/generated/resources/assets/gtceu/lang/en_us.json

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions src/main/java/com/gregtechceu/gtceu/api/item/PipeBlockItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ public PipeBlock getBlock() {
public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> tooltip,
TooltipFlag isAdvanced) {
super.appendHoverText(stack, level, tooltip, isAdvanced);
if (GTUtil.isShiftDown()) {
tooltip.add(Component.translatable("gtceu.tool_action.wire_cutter.connect"));
if (this instanceof OpticalPipeBlockItem) {
if (GTUtil.isShiftDown()) {
tooltip.add(Component.translatable("gtceu.tool_action.wire_cutter.connect"));
} else {
tooltip.add(Component.translatable("gtceu.tool_action.show_tooltips"));
}
Comment on lines +50 to +55
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just override it in OpticalPipeBlockItem?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you override it, then you have to call super().
But if you call super() it'll add the wrench tooltip.
But if you don't call super then you don't get the block tooltip unless you manually call this.getBlock().appendHoverText() in the override for this tooltip.
image
It's a mess overall D:

} else {
tooltip.add(Component.translatable("gtceu.tool_action.show_tooltips"));
if (GTUtil.isShiftDown()) {
tooltip.add(Component.translatable("gtceu.tool_action.wrench.connect"));
} else {
tooltip.add(Component.translatable("gtceu.tool_action.show_tooltips"));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ default void attachConfigurators(ConfiguratorPanel configuratorPanel) {
controllable::isWorkingEnabled, (clickData, pressed) -> controllable.setWorkingEnabled(pressed))
.setTooltipsSupplier(pressed -> List.of(
Component.translatable(
pressed ? "behaviour.soft_hammer.enabled" : "behaviour.soft_hammer.disabled"))));
pressed ? "behavior.soft_hammer.enabled" : "behavior.soft_hammer.disabled"))));
}
if (this instanceof IOverclockMachine overclockMachine) {
configuratorPanel.attachConfigurators(new OverclockFancyConfigurator(overclockMachine));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2643,8 +2643,7 @@ public Component getItemName(ItemStack stack) {
.tag(Tags.Items.ARMORS_HELMETS)
.tag(CustomTags.PPE_ARMOR)
.onRegister(attach(new TooltipBehavior(tooltips -> {
tooltips.add(Component.translatable("gtceu.hazard_trigger.protection.description"));
tooltips.add(Component.translatable("gtceu.hazard_trigger.inhalation"));
tooltips.add(Component.translatable("gtceu.hazard_trigger.protection.description").append(Component.translatable("gtceu.hazard_trigger.inhalation")));
})))
.register();
public static ItemEntry<ArmorComponentItem> RUBBER_GLOVES = REGISTRATE
Expand All @@ -2655,8 +2654,7 @@ public Component getItemName(ItemStack stack) {
.tag(Tags.Items.ARMORS_CHESTPLATES)
.tag(CustomTags.PPE_ARMOR)
.onRegister(attach(new TooltipBehavior(tooltips -> {
tooltips.add(Component.translatable("gtceu.hazard_trigger.protection.description"));
tooltips.add(Component.translatable("gtceu.hazard_trigger.skin_contact"));
tooltips.add(Component.translatable("gtceu.hazard_trigger.protection.description").append(Component.translatable("gtceu.hazard_trigger.skin_contact")));
})))
.register();
public static ItemEntry<ArmorComponentItem> HAZMAT_CHESTPLATE = REGISTRATE
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/gregtechceu/gtceu/common/data/GTOres.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public class GTOres {
.surfaceRock(CertusQuartz)
.placement(SurfaceIndicatorGenerator.IndicatorPlacement.BELOW)));

public static final GTOreDefinition MANGANESE_VEIN = create("manganese_vein", vein -> vein
public static final GTOreDefinition MANGANESE_VEIN_NETHER = create("manganese_vein_nether", vein -> vein
.clusterSize(UniformInt.of(50, 64)).density(0.75f).weight(20)
.layer(WorldGenLayers.NETHERRACK)
.heightRangeUniform(20, 30)
Expand Down Expand Up @@ -260,7 +260,7 @@ public class GTOres {
.surfaceRock(NetherQuartz)
.placement(SurfaceIndicatorGenerator.IndicatorPlacement.ABOVE)));

public static final GTOreDefinition REDSTONE_VEIN = create("redstone_vein", vein -> vein
public static final GTOreDefinition REDSTONE_VEIN_NETHER = create("redstone_vein_nether", vein -> vein
.clusterSize(UniformInt.of(32, 40)).density(0.2f).weight(60)
.layer(WorldGenLayers.NETHERRACK)
.heightRangeUniform(5, 40)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,12 @@ public void appendHoverText(ItemStack stack, @Nullable Level level, List<Compone
int remainingUses = getUsesLeft(stack);
if (color != null) {
tooltipComponents
.add(Component.translatable("behaviour.paintspray." + this.color.getSerializedName() + ".tooltip"));
.add(Component.translatable("behavior.paintspray." + this.color.getSerializedName() + ".tooltip"));
} else {
tooltipComponents.add(Component.translatable("behaviour.paintspray.solvent.tooltip"));
tooltipComponents.add(Component.translatable("behavior.paintspray.solvent.tooltip"));
}
tooltipComponents.add(Component.translatable("behaviour.paintspray.uses", remainingUses));
tooltipComponents.add(Component.translatable("behavior.paintspray.uses", remainingUses));
tooltipComponents.add(Component.translatable("behavior.paintspray.offhand"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void appendHoverText(ItemStack stack, @Nullable Level level, List<Compone
tooltipComponents.add(Component.translatable("metaitem.prospector.tooltip.radius", radius));
tooltipComponents.add(Component.translatable("metaitem.prospector.tooltip.modes"));
for (ProspectorMode<?> mode : modes) {
tooltipComponents.add(Component.literal(" -").append(Component.translatable(mode.unlocalizedName))
tooltipComponents.add(Component.literal(" - ").append(Component.translatable(mode.unlocalizedName))
.withStyle(Style.EMPTY.withColor(ChatFormatting.RED)));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ public boolean showEmptyBar(ItemStack itemStack) {
public void appendHoverText(ItemStack stack, @org.jetbrains.annotations.Nullable Level level,
List<Component> tooltipComponents, TooltipFlag isAdvanced) {
tooltipComponents.add(Component
.translatable(usesFluid ? "behaviour.lighter.fluid.tooltip" : "behaviour.lighter.tooltip.description"));
tooltipComponents.add(Component.translatable("behaviour.lighter.tooltip.usage"));
.translatable(usesFluid ? "behavior.lighter.fluid.tooltip" : "behavior.lighter.tooltip.description"));
tooltipComponents.add(Component.translatable("behavior.lighter.tooltip.usage"));
if (hasMultipleUses && !usesFluid) {
tooltipComponents.add(Component.translatable("behaviour.lighter.uses", getUsesLeft(stack)));
tooltipComponents.add(Component.translatable("behavior.lighter.uses", getUsesLeft(stack)));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public void addInformation(@NotNull ItemStack stack, @Nullable Level world, @Not
@Getter
public enum WrenchModeType {

ITEM(Component.translatable("gtceu.mode.item")),
FLUID(Component.translatable("gtceu.mode.fluid")),
BOTH(Component.translatable("gtceu.mode.both"));
ITEM(Component.translatable("gtceu.tool.mode.item")),
FLUID(Component.translatable("gtceu.tool.mode.fluid")),
BOTH(Component.translatable("gtceu.tool.mode.both"));

private final Component name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ protected InteractionResult onSoftMalletClick(Player playerIn, InteractionHand h
if (!isRemote()) {
controllable.setWorkingEnabled(!controllable.isWorkingEnabled());
playerIn.sendSystemMessage(Component.translatable(controllable.isWorkingEnabled() ?
"behaviour.soft_hammer.enabled" : "behaviour.soft_hammer.disabled"));
"behavior.soft_hammer.enabled" : "behavior.soft_hammer.disabled"));
}
return InteractionResult.CONSUME;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ protected InteractionResult onSoftMalletClick(Player playerIn, InteractionHand h
if (!isRemote()) {
controllable.setWorkingEnabled(!controllable.isWorkingEnabled());
playerIn.sendSystemMessage(Component.translatable(controllable.isWorkingEnabled() ?
"behaviour.soft_hammer.enabled" : "behaviour.soft_hammer.disabled"));
"behavior.soft_hammer.enabled" : "behavior.soft_hammer.disabled"));
}
return InteractionResult.CONSUME;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ protected InteractionResult onSoftMalletClick(Player playerIn, InteractionHand h
if (!isRemote()) {
controllable.setWorkingEnabled(!controllable.isWorkingEnabled());
playerIn.sendSystemMessage(Component.translatable(controllable.isWorkingEnabled() ?
"behaviour.soft_hammer.enabled" : "behaviour.soft_hammer.disabled"));
"behavior.soft_hammer.enabled" : "behavior.soft_hammer.disabled"));
}
return InteractionResult.CONSUME;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ private static void initRecipeViewerLang(RegistrateLangProvider provider) {
String name = GTRegistries.BEDROCK_FLUID_DEFINITIONS.getKey(fluid).getPath();
provider.add("gtceu.jei.bedrock_fluid." + name, RegistrateLangProvider.toEnglishName(name));
}

LangHandler.replace(provider, "gtceu.jei.ore_vein.bauxite_vein_end", "End Bauxite Vein");
LangHandler.replace(provider, "gtceu.jei.ore_vein.magnetite_vein_end", "End Magnetite Vein");
LangHandler.replace(provider, "gtceu.jei.ore_vein.magnetite_vein_ow", "Magnetite Vein");
LangHandler.replace(provider, "gtceu.jei.ore_vein.manganese_vein_nether", "Nether Manganese Vein");
LangHandler.replace(provider, "gtceu.jei.ore_vein.magnetite_vein_ow", "Manganese Vein");
LangHandler.replace(provider, "gtceu.jei.ore_vein.pitchblende_vein_end", "End Pitchblende Vein");
LangHandler.replace(provider, "gtceu.jei.ore_vein.redstone_vein_ow", "Redstone Vein");
LangHandler.replace(provider, "gtceu.jei.ore_vein.redstone_vein_nether", "Nether Redstone Vein");
}

/** Jade, TheOneProbe, WTHIT */
Expand Down Expand Up @@ -100,6 +109,7 @@ private static void initWailaLikeLang(RegistrateLangProvider provider) {
provider.add("gtceu.top.progress_tick", " / %s t");
}

/** Xaero, JourneyMap*/
private static void initMinimapLang(RegistrateLangProvider provider) {
provider.add("gtceu.minimap.ore_vein.depleted", "Depleted");

Expand Down
11 changes: 7 additions & 4 deletions src/main/java/com/gregtechceu/gtceu/data/lang/ItemLang.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ private static void initGeneratedNames(RegistrateLangProvider provider) {
private static void initItemNames(RegistrateLangProvider provider) {}

private static void initItemTooltips(RegistrateLangProvider provider) {
// When in doubt, all tooltips should be gray (§7)

provider.add("item.gtceu.copper_credit.tooltip", "§70.125 Credits");
provider.add("item.gtceu.cupronickel_credit.tooltip", "§71 Credit");
provider.add("item.gtceu.silver_credit.tooltip", "§78 Credits");
Expand Down Expand Up @@ -162,7 +164,7 @@ private static void initItemTooltips(RegistrateLangProvider provider) {
provider.add("item.gtceu.data_stick.tooltip", "§7A Low Capacity Data Storage");
provider.add("item.gtceu.data_orb.tooltip", "§7A High Capacity Data Storage");
multilineLang(provider, "item.gtceu.programmed_circuit.tooltip",
"Use to open configuration GUI\nShift-Right-Click on a machine\nwith a circuit slot to set it to\nthis circuit's value.");
"§7Use to open configuration GUI\nShift-Right-Click on a machine\nwith a circuit slot to set it to\nthis circuit's value.");
provider.add("item.gtceu.circuit.integrated.gui", "§7Programmed Circuit Configuration");
// multilineLang(provider, "item.gtceu.circuit.integrated.jei_description", "JEI is only showing recipes for the
// given configuration.\n\nYou can select a configuration in the Programmed Circuit configuration tab.");
Expand Down Expand Up @@ -354,11 +356,12 @@ private static void initItemTooltips(RegistrateLangProvider provider) {
multilineLang(provider, "item.gtceu.foam_sprayer.tooltip",
"§7Sprays Construction Foam\nUse on a frame to foam connected frames\nFoam can be colored");
provider.add("item.gtceu.firebrick.tooltip", "§7Heat resistant");
provider.add("item.gtceu.basic_tape.tooltip",
"§7Not strong enough for mechanical issues\nCan be used to pick up crates without dropping their items");
provider.add("item.gtceu.basic_tape.tooltip", "§7Not strong enough for mechanical issues\nCan be used to pick up crates without dropping their items");
multilineLang(provider,"item.gtceu.sus_record.desc", "§7Leonz - Among Us Drip\nsussy!");
provider.add("item.gtceu.iron_minecart_wheels.tooltip", "§To get things rolling");
provider.add("item.gtceu.steel_minecart_wheels.tooltip", "§To get things rolling");
provider.add("item.gtceu.terminal.tooltip",
"Shift + R-Click on a controller to automatically build the multi-block");

provider.add("item.gtceu.sus_record.desc", "§7sussy!");
}
}
Loading
Loading