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
215 changes: 107 additions & 108 deletions src/generated/resources/assets/gtceu/lang/en_ud.json

Large diffs are not rendered by default.

225 changes: 112 additions & 113 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 @@ -408,7 +408,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"));
}
playerIn.swing(hand);
return InteractionResult.CONSUME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,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 @@ -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 @@ -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 @@ -492,7 +492,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 @@ -559,7 +559,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
10 changes: 6 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 @@ -45,6 +45,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 @@ -151,7 +153,6 @@ 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");
provider.add("item.gtceu.programmed_circuit.tooltip", "§7Use to open configuration GUI");
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.");
provider.add("item.glass_lens", "Glass Lens (White)"); // todo move to material overrides
Expand Down Expand Up @@ -342,8 +343,9 @@ 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", "Not strong enough for mechanical issues");

provider.add("item.gtceu.sus_record.desc", "sussy!");
provider.add("item.gtceu.basic_tape.tooltip", "N§7ot 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");
}
}
80 changes: 38 additions & 42 deletions src/main/java/com/gregtechceu/gtceu/data/lang/LangHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ public static void init(RegistrateLangProvider provider) {
provider.add("metaitem.generic.electric_item.stored", "%d/%d EU (%s)");
provider.add("metaitem.electric.discharge_mode.enabled", "§eDischarge Mode Enabled");
provider.add("metaitem.electric.discharge_mode.disabled", "§eDischarge Mode Disabled");
provider.add("metaitem.electric.discharge_mode.tooltip", "Use while sneaking to toggle discharge mode");
provider.add("metaitem.dust.tooltip.purify", "Right click a Cauldron to get clean Dust");
provider.add("metaitem.crushed.tooltip.purify", "Right click a Cauldron to get Purified Ore");
provider.add("metaitem.int_circuit.configuration", "Configuration: %d");
provider.add("metaitem.electric.discharge_mode.tooltip", "§7Use while sneaking to toggle discharge mode");
provider.add("metaitem.dust.tooltip.purify", "§7Right click a Cauldron to get clean Dust");
provider.add("metaitem.crushed.tooltip.purify", "§7Right click a Cauldron to get Purified Ore");
provider.add("metaitem.int_circuit.configuration", "§aConfigured Value: §r%d");
provider.add("metaitem.machine_configuration.mode", "§aConfiguration Mode:§r %s");
provider.add("gtceu.mode.fluid", "§9Fluid§r");
provider.add("gtceu.mode.item", "§6Item§r");
Expand Down Expand Up @@ -314,9 +314,8 @@ public static void init(RegistrateLangProvider provider) {
provider.add("metaarmor.energy_share.tooltip", "Supply mode: %s");
provider.add("metaarmor.energy_share.tooltip.guide",
"To change mode shift-right click when holding item");
provider.add("metaitem.record.sus.tooltip", "§7Leonz - Among Us Drip");
provider.add("item.gtceu.nan_certificate.tooltip", "Challenge Accepted!");
provider.add("item.gtceu.blacklight.tooltip", "Long-Wave §dUltraviolet§7 light source");
provider.add("item.gtceu.nan_certificate.tooltip", "§7Challenge Accepted!");
provider.add("item.gtceu.blacklight.tooltip", "§7Long-Wave §dUltraviolet§7 light source");
provider.add("gui.widget.incrementButton.default_tooltip",
"Hold Shift, Ctrl or both to change the amount");
provider.add("gui.widget.recipeProgressWidget.default_tooltip", "Show Recipes");
Expand Down Expand Up @@ -692,37 +691,34 @@ public static void init(RegistrateLangProvider provider) {
provider.add("item.gtceu.small_iridium_metal_residue_dust", "Small Pile of Iridium Metal Residue");
provider.add("item.gtceu.iridium_metal_residue_dust", "Iridium Metal Residue");

provider.add("behaviour.hoe", "Can till dirt");
provider.add("behaviour.soft_hammer", "Activates and Deactivates Machines");
provider.add("behaviour.soft_hammer.enabled", "Working Enabled");
provider.add("behaviour.soft_hammer.disabled", "Working Disabled");
provider.add("behaviour.lighter.tooltip.description", "Can light things on fire");
provider.add("behaviour.lighter.tooltip.usage", "Shift-right click to open/close");
provider.add("behaviour.lighter.fluid.tooltip", "Can light things on fire with Butane or Propane");
provider.add("behaviour.lighter.uses", "Remaining uses: %d");
provider.add("behavior.toggle_energy_consumer.tooltip", "Use to toggle mode");
provider.add("behaviour.hammer", "Turns on and off Muffling for Machines (by hitting them)");
provider.add("behaviour.wrench", "Rotates Blocks on Rightclick");
provider.add("behaviour.boor.by", "by %s");
provider.add("behaviour.paintspray.solvent.tooltip", "Can remove color from things");
provider.add("behaviour.paintspray.white.tooltip", "Can paint things in White");
provider.add("behaviour.paintspray.orange.tooltip", "Can paint things in Orange");
provider.add("behaviour.paintspray.magenta.tooltip", "Can paint things in Magenta");
provider.add("behaviour.paintspray.light_blue.tooltip", "Can paint things in Light Blue");
provider.add("behaviour.paintspray.yellow.tooltip", "Can paint things in Yellow");
provider.add("behaviour.paintspray.lime.tooltip", "Can paint things in Lime");
provider.add("behaviour.paintspray.pink.tooltip", "Can paint things in Pink");
provider.add("behaviour.paintspray.gray.tooltip", "Can paint things in Gray");
provider.add("behaviour.paintspray.light_gray.tooltip", "Can paint things in Light Gray");
provider.add("behaviour.paintspray.cyan.tooltip", "Can paint things in Cyan");
provider.add("behaviour.paintspray.purple.tooltip", "Can paint things in Purple");
provider.add("behaviour.paintspray.blue.tooltip", "Can paint things in Blue");
provider.add("behaviour.paintspray.brown.tooltip", "Can paint things in Brown");
provider.add("behaviour.paintspray.green.tooltip", "Can paint things in Green");
provider.add("behaviour.paintspray.red.tooltip", "Can paint things in Red");
provider.add("behaviour.paintspray.black.tooltip", "Can paint things in Black");
provider.add("behaviour.paintspray.uses", "Remaining Uses: %d");
provider.add("behaviour.prospecting", "Usable for Prospecting");
provider.add("behavior.soft_hammer", "§7Activates and Deactivates Machines");
provider.add("behavior.soft_hammer.enabled", "Working Enabled");
provider.add("behavior.soft_hammer.disabled", "Working Disabled");
provider.add("behavior.lighter.tooltip.description", "§7Can light things on fire");
provider.add("behavior.lighter.tooltip.usage", "§7Shift-right click to open/close");
provider.add("behavior.lighter.fluid.tooltip", "§7Can light things on fire with Butane or Propane");
provider.add("behavior.lighter.uses", "§7Remaining uses: %d");
provider.add("behavior.toggle_energy_consumer.tooltip", "§7Use to toggle mode");
provider.add("behavior.hammer", "§7Turns on and off Muffling for Machines (by hitting them)");
provider.add("behavior.paintspray.solvent.tooltip", "§7Can remove color from things");
provider.add("behavior.paintspray.white.tooltip", "§7Can paint things in White");
provider.add("behavior.paintspray.orange.tooltip", "§7Can paint things in Orange");
provider.add("behavior.paintspray.magenta.tooltip", "§7Can paint things in Magenta");
provider.add("behavior.paintspray.light_blue.tooltip", "§7Can paint things in Light Blue");
provider.add("behavior.paintspray.yellow.tooltip", "§7Can paint things in Yellow");
provider.add("behavior.paintspray.lime.tooltip", "§7Can paint things in Lime");
provider.add("behavior.paintspray.pink.tooltip", "§7Can paint things in Pink");
provider.add("behavior.paintspray.gray.tooltip", "§7Can paint things in Gray");
provider.add("behavior.paintspray.light_gray.tooltip", "§7Can paint things in Light Gray");
provider.add("behavior.paintspray.cyan.tooltip", "§7Can paint things in Cyan");
provider.add("behavior.paintspray.purple.tooltip", "§7Can paint things in Purple");
provider.add("behavior.paintspray.blue.tooltip", "§7Can paint things in Blue");
provider.add("behavior.paintspray.brown.tooltip", "§7Can paint things in Brown");
provider.add("behavior.paintspray.green.tooltip", "§7Can paint things in Green");
provider.add("behavior.paintspray.red.tooltip", "§7Can paint things in Red");
provider.add("behavior.paintspray.black.tooltip", "§7Can paint things in Black");
provider.add("behavior.paintspray.uses", "§7Remaining Uses: %d");
provider.add("behavior.paintspray.offhand", "§7Hold in offhand to color while placing blocks");
provider.add("enchantment.damage.disjunction", "Disjunction");
provider.add("enchantment.gtceu.disjunction.description",
"Applies Weakness and Slowness to Ender-related mobs.");
Expand Down Expand Up @@ -1258,10 +1254,10 @@ public static void init(RegistrateLangProvider provider) {

provider.add("gtceu.gui.machinemode.title", "Active Machine Mode");
provider.add("gtceu.gui.machinemode", "Active Machine Mode: %s");
provider.add("gtceu.machine.available_recipe_map_1.tooltip", "Available Recipe Types: %s");
provider.add("gtceu.machine.available_recipe_map_2.tooltip", "Available Recipe Types: %s, %s");
provider.add("gtceu.machine.available_recipe_map_3.tooltip", "Available Recipe Types: %s, %s, %s");
provider.add("gtceu.machine.available_recipe_map_4.tooltip", "Available Recipe Types: %s, %s, %s, %s");
provider.add("gtceu.machine.available_recipe_map_1.tooltip", "Available Recipe Types: §e%s");
provider.add("gtceu.machine.available_recipe_map_2.tooltip", "Available Recipe Types: §e%s, %s");
provider.add("gtceu.machine.available_recipe_map_3.tooltip", "Available Recipe Types: §e%s, %s, %s");
provider.add("gtceu.machine.available_recipe_map_4.tooltip", "Available Recipe Types: §e%s, %s, %s, %s");

provider.add("gtceu.gui.content.chance_0", "§cNot Consumed§r");
provider.add("gtceu.gui.content.chance_0_short", "§cNC§r");
Expand Down
Loading
Loading