pub struct OptionRow<G: GameData> {
pub key: &'static str,
pub value: RowValue<G>,
pub starts_group: bool,
pub unsaved: bool,
}Expand description
One row of an options screen, as the game gives it.
Fields§
§key: &'static strThe text key of its label; also what names the row (the focus).
value: RowValue<G>What it shows beside its label, and what changes it.
starts_group: boolWhether a blank row comes before it (the first row of a group).
unsaved: boolWhether its value isn’t one of the settings, so the screen keeps or puts it back itself on leaving (a campaign’s own level, say).
Implementations§
Source§impl<G: GameData> OptionRow<G>
impl<G: GameData> OptionRow<G>
Sourcepub fn new(key: &'static str, value: RowValue<G>) -> Self
pub fn new(key: &'static str, value: RowValue<G>) -> Self
A row labelled by the text key key, showing value.
Sourcepub fn starting_group(self) -> Self
pub fn starting_group(self) -> Self
The same row, first of a group: a blank row comes before it.
Sourcepub fn unsaved(self) -> Self
pub fn unsaved(self) -> Self
The same row, whose value isn’t one of the settings: the screen keeps it or puts it back itself on leaving.
Sourcepub fn text_speed() -> Self
pub fn text_speed() -> Self
The speed text is revealed at (TextSpeed, in the settings).
Sourcepub fn frame_cap() -> Self
pub fn frame_cap() -> Self
The most frames a second the platform shows (the frame cap, in the
settings), labelled Frame rate (FRAME_CAP_ROW): it steps through
the game’s choices
(GameSettings::FRAME_CAP_CHOICES), each shown as “60 FPS”
(FPS_KEY) or “Unlimited”
(UNLIMITED_KEY). A cap that
isn’t among them (set in code) shows as it is, and steps from the
first. The platform applies a change from the next frame, before
the player keeps it.
Sourcepub fn fullscreen() -> Self
pub fn fullscreen() -> Self
Whether the game fills the screen (in the settings). The options
screen leaves it out where the game isn’t in a window
(OptionsScreen::rows).
Sourcepub fn music_volume() -> Self
pub fn music_volume() -> Self
How loud the music plays (in the settings).
Sourcepub fn sound_volume() -> Self
pub fn sound_volume() -> Self
How loud the sounds play (in the settings).
Sourcepub fn voices() -> Self
pub fn voices() -> Self
Whether voice clips play (in the settings). Turning it off stops the voice that is playing.
Sourcepub fn voice_volume() -> Self
pub fn voice_volume() -> Self
How loud voice clips play (in the settings).
Sourcepub fn restore_defaults() -> Self
pub fn restore_defaults() -> Self
Puts every setting back to its default but the layout, asking first; kept or thrown away on leaving, like any change.
Sourcepub fn is_setting(&self) -> bool
pub fn is_setting(&self) -> bool
Whether the cursor’s left and right keys change its value.