Browse Source

Finish MiiSelector applet documentation

pull/134/head
Andrea Ciliberti 1 year ago
parent
commit
fafe3c3dbf
  1. 2
      ctru-rs/examples/mii-selector.rs
  2. 10
      ctru-rs/src/applets/mii_selector.rs

2
ctru-rs/examples/mii-selector.rs

@ -10,7 +10,7 @@ fn main() {
let _console = Console::new(gfx.top_screen.borrow_mut()); let _console = Console::new(gfx.top_screen.borrow_mut());
let mut mii_selector = MiiSelector::new(); let mut mii_selector = MiiSelector::new();
mii_selector.set_options(Options::MII_SELECTOR_CANCEL); mii_selector.set_options(Options::ENABLE_CANCEL);
mii_selector.set_initial_index(3); mii_selector.set_initial_index(3);
mii_selector.blacklist_user_mii(0.into()); mii_selector.blacklist_user_mii(0.into());
mii_selector.set_title("Great Mii Selector!"); mii_selector.set_title("Great Mii Selector!");

10
ctru-rs/src/applets/mii_selector.rs

@ -5,9 +5,9 @@
use crate::mii::MiiData; use crate::mii::MiiData;
use bitflags::bitflags; use bitflags::bitflags;
use std::{ffi::CString, error::Error, fmt}; use std::{error::Error, ffi::CString, fmt};
/// Index of a Mii used to configure some parameters of the Mii Selector. /// Index of a Mii on the Mii Selector interface.
#[derive(Debug, Clone, Copy, Eq, PartialEq)] #[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum Index { pub enum Index {
/// Specific Mii index. /// Specific Mii index.
@ -58,14 +58,14 @@ bitflags! {
const ENABLE_CANCEL = ctru_sys::MIISELECTOR_CANCEL; const ENABLE_CANCEL = ctru_sys::MIISELECTOR_CANCEL;
/// Make guest Miis available to select. /// Make guest Miis available to select.
const ENABLE_GUESTS = ctru_sys::MIISELECTOR_GUESTS; const ENABLE_GUESTS = ctru_sys::MIISELECTOR_GUESTS;
/// Show on the top screen. /// Show the Mii Selector window on the top screen.
const USE_TOP_SCREEN = ctru_sys::MIISELECTOR_TOP; const USE_TOP_SCREEN = ctru_sys::MIISELECTOR_TOP;
/// Start on the guests' page. Requires [Options::ENABLE_GUESTS]. /// Start the Mii Selector on the guests' page. Requires [Options::ENABLE_GUESTS].
const START_WITH_GUESTS = ctru_sys::MIISELECTOR_GUESTSTART; const START_WITH_GUESTS = ctru_sys::MIISELECTOR_GUESTSTART;
} }
} }
/// Configuration object to setup the Mii Selector applet. /// Configuration structure to setup the Mii Selector applet.
/// ///
/// # Example /// # Example
/// ```no_run /// ```no_run

Loading…
Cancel
Save