pub struct UiButton {
pub id: String,
pub label: String,
pub action: String,
pub popup: Option<String>,
}Expand description
One button rendered for a mod on the Mods page. Clicking it performs
action (launcher-handled, e.g. tournament.create), optionally
opening the popup named by popup first to collect input.
Fields§
§id: StringStable identifier for this button within the mod’s ui section.
Must be unique, see ModUi::validate.
label: StringButton caption. May contain {placeholder} tokens the launcher
fills in live (e.g. "Join ({room_count})"); stored verbatim.
action: StringLauncher-handled action name (e.g. tournament.create). Must
be non-empty, see ModUi::validate.
popup: Option<String>Optional popup id (a key into ModUi::popups) opened when the
button is pressed, to collect input before the action runs.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UiButton
impl<'de> Deserialize<'de> for UiButton
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for UiButton
Auto Trait Implementations§
impl Freeze for UiButton
impl RefUnwindSafe for UiButton
impl Send for UiButton
impl Sync for UiButton
impl Unpin for UiButton
impl UnsafeUnpin for UiButton
impl UnwindSafe for UiButton
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more