Browse Source

Add documentation to LaunchError. Update mii-selector example.

pull/122/head
DeltaF1 2 years ago
parent
commit
1e158191ff
  1. 2
      ctru-rs/examples/mii-selector.rs
  2. 3
      ctru-rs/src/applets/mii_selector.rs

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

@ -10,13 +10,13 @@ fn main() { @@ -10,13 +10,13 @@ fn main() {
let _console = Console::new(gfx.top_screen.borrow_mut());
let mut mii_selector = MiiSelector::new();
mii_selector.set_options(Options::MII_SELECTOR_CANCEL);
mii_selector.set_initial_index(3);
mii_selector.blacklist_user_mii(0.into());
mii_selector.set_title("Great Mii Selector!");
match mii_selector.launch() {
Ok(result) => {
println!("Is Mii selected?: {:?}", result.is_mii_selected);
println!("Mii type: {:?}", result.mii_type);
println!("Name: {:?}", result.mii_data.name);
println!("Author: {:?}", result.mii_data.author_name);

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

@ -65,7 +65,10 @@ pub struct SelectionResult { @@ -65,7 +65,10 @@ pub struct SelectionResult {
/// Error type for the Mii selector
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum LaunchError {
/// The selected Mii's data is corrupt in some way
InvalidChecksum,
/// Either the user cancelled the selection (see [Options::MII_SELECTOR_CANCEL]), or no valid Miis were available to select
NoMiiSelected,
}

Loading…
Cancel
Save