Skip to main content

steel_protocol/packets/game/
c_set_titles_animation.rs

1use steel_macros::{ClientPacket, WriteTo};
2use steel_registry::packets::play::C_SET_TITLES_ANIMATION;
3
4/// Sets the title fade-in, stay, and fade-out durations on the client.
5#[derive(ClientPacket, WriteTo, Clone, Debug)]
6#[packet_id(Play = C_SET_TITLES_ANIMATION)]
7pub struct CSetTitlesAnimation {
8    /// Number of client ticks used for the fade-in.
9    pub fade_in: i32,
10    /// Number of client ticks the title remains fully visible.
11    pub stay: i32,
12    /// Number of client ticks used for the fade-out.
13    pub fade_out: i32,
14}
15
16impl CSetTitlesAnimation {
17    /// Creates a title-animation packet.
18    #[must_use]
19    pub const fn new(fade_in: i32, stay: i32, fade_out: i32) -> Self {
20        Self {
21            fade_in,
22            stay,
23            fade_out,
24        }
25    }
26}