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 moreSource§impl Debug for MiiSelector
impl Debug for MiiSelector
Auto Trait Implementations§
impl Freeze for MiiSelector
impl RefUnwindSafe for MiiSelector
impl Send for MiiSelector
impl Sync for MiiSelector
impl Unpin for MiiSelector
impl UnwindSafe for MiiSelector
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)