Trait TooltipAppender
pub trait TooltipAppender:
Send
+ Sync
+ 'static {
// Required method
fn append(
&self,
host: &dyn ClientHost,
stack: &ItemStack,
context: &TooltipAppendContext,
lines: &mut Vec<(Text, u32)>,
);
}Expand description
The lines a data component adds to its stack’s tooltip. Kept by the game from registration on;
asked only for a stack that carries the component and whose tooltip_display shows it, and
only while its mod is enabled. Multiple registrations for the same component all run.
Required Methods§
fn append(
&self,
host: &dyn ClientHost,
stack: &ItemStack,
context: &TooltipAppendContext,
lines: &mut Vec<(Text, u32)>,
)
fn append( &self, host: &dyn ClientHost, stack: &ItemStack, context: &TooltipAppendContext, lines: &mut Vec<(Text, u32)>, )
Add lines to lines for stack, each with a colour as rgba packs it (u32::MAX keeps
the text’s own). context is the tooltip’s player and flags.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".