Struct ctru::applets::mii_selector::MiiSelector
source · pub struct MiiSelector { /* private fields */ }
Expand description
Configuration structure to setup the Mii Selector applet.
Implementations§
source§impl MiiSelector
impl MiiSelector
sourcepub fn set_options(&mut self, options: Options)
pub fn set_options(&mut self, options: Options)
Set the options of the Mii Selector.
This will overwrite any previously saved options. Use bitwise operations to set all your wanted options at once.
§Example
use ctru::applets::mii_selector::{MiiSelector, Options};
let mut mii_selector = MiiSelector::new();
// Setup a `MiiSelector` that can be cancelled and that makes Guest Miis available to select.
let opts = Options::ENABLE_CANCEL & Options::ENABLE_GUESTS;
mii_selector.set_options(opts);
sourcepub fn allowlist_guest_mii(&mut self, mii_index: Index)
pub fn allowlist_guest_mii(&mut self, mii_index: Index)
Allowlist a guest Mii based on its index.
§Notes
Guest Mii’s won’t be available regardless of their allowlist/blocklist state if the MiiSelector
is run without setting Options::ENABLE_GUESTS
.
Look into MiiSelector::set_options()
to see how to work with options.
§Example
use ctru::applets::mii_selector::{Index, MiiSelector};
let mut mii_selector = MiiSelector::new();
// Allowlist the guest Mii at index 2.
mii_selector.allowlist_guest_mii(Index::Index(2));
sourcepub fn blocklist_guest_mii(&mut self, mii_index: Index)
pub fn blocklist_guest_mii(&mut self, mii_index: Index)
Blocklist a guest Mii based on its index.
§Notes
Guest Mii’s won’t be available regardless of their allowlist/blocklist state if the MiiSelector
is run without setting Options::ENABLE_GUESTS
.
Look into MiiSelector::set_options()
to see how to work with options.
§Example
use ctru::applets::mii_selector::{Index, MiiSelector};
let mut mii_selector = MiiSelector::new();
// Blocklist the guest Mii at index 1 so that it cannot be selected.
mii_selector.blocklist_guest_mii(Index::Index(1));
sourcepub fn allowlist_user_mii(&mut self, mii_index: Index)
pub fn allowlist_user_mii(&mut self, mii_index: Index)
Allowlist a user-created Mii based on its index.
§Example
use ctru::applets::mii_selector::{Index, MiiSelector};
let mut mii_selector = MiiSelector::new();
// Allowlist the user-created Mii at index 0.
mii_selector.allowlist_user_mii(Index::Index(0));
sourcepub fn blocklist_user_mii(&mut self, mii_index: Index)
pub fn blocklist_user_mii(&mut self, mii_index: Index)
Blocklist a user-created Mii based on its index.
§Example
use ctru::applets::mii_selector::{Index, MiiSelector};
let mut mii_selector = MiiSelector::new();
// Blocklist all user-created Miis so that they cannot be selected.
mii_selector.blocklist_user_mii(Index::All);
sourcepub fn set_initial_index(&mut self, index: usize)
pub fn set_initial_index(&mut self, index: usize)
Set where the GUI cursor will start at.
If there’s no Mii at that index, the cursor will start at the Mii with the index 0.
sourcepub fn launch(&mut self, _apt: &Apt, _gfx: &Gfx) -> Result<Selection, Error>
pub fn launch(&mut self, _apt: &Apt, _gfx: &Gfx) -> Result<Selection, Error>
Launch the Mii Selector.
Depending on the configuration, the Mii Selector window will appear either
on the bottom screen (default behaviour) or the top screen (see Options::USE_TOP_SCREEN
).
§Example
use ctru::applets::mii_selector::{MiiSelector, Options};
let mut mii_selector = MiiSelector::new();
mii_selector.set_title("Select a Mii!");
let opts = Options::ENABLE_CANCEL & Options::ENABLE_GUESTS;
mii_selector.set_options(opts);
let result = mii_selector.launch(&apt, &gfx)?;
Trait Implementations§
source§impl Clone for MiiSelector
impl Clone for MiiSelector
source§fn clone(&self) -> MiiSelector
fn clone(&self) -> MiiSelector
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more