pub struct UiField {
pub id: String,
pub kind: UiFieldKind,
pub label: String,
pub options: Vec<String>,
pub hint: Option<String>,
pub validation: Option<String>,
}Expand description
One input field inside a UiPopupKind::Form popup.
Fields§
§id: StringStable identifier for the collected value (what the launcher
hands to the button’s action handling).
kind: UiFieldKindWhat kind of control to render, defaults to
UiFieldKind::Text when omitted.
label: StringHuman-readable label shown next to the control.
options: Vec<String>Choices for UiFieldKind::Select fields; empty for every
other kind (and required non-empty for selects, see
ModUi::validate).
hint: Option<String>short hint text rendered inside the control itself (egui’s
hint_text on text fields), the “(optional)” style note a mod can
attach without bloating the label. None = no hint.
validation: Option<String>Optional name of a shared validation rule set (see
crate::validation) the launcher enforces live on this field:
invalid input renders an error stroke and a warning icon whose
hover carries the reason, and the popup’s confirm button stays
disabled while the value is invalid. Known tags: player_name,
room_name; unknown tags fail ModUi::validate so a newer mod
on an older launcher reports itself. Only meaningful on text
fields.