libnx  v4.2.0
Data Structures | Enumerations | Functions
psel.h File Reference

Wrapper for using the playerSelect (user selection) LibraryApplet. More...

#include "../types.h"
#include "../services/acc.h"

Go to the source code of this file.

Data Structures

struct  PselUiSettingsV1
 Base UI settings for playerSelect. More...
 
struct  PselUiSettings
 UI settings for versions starting with 0x10000. More...
 
struct  PselUserSelectionSettings
 UserSelectionSettings. More...
 
struct  PselUserSelectionSettingsForSystemService
 [2.0.0+] UserSelectionSettingsForSystemService More...
 
struct  PselUiReturnArg
 Return data sent after execution. More...
 

Enumerations

enum  PselUiMode {
  PselUiMode_UserSelector = 0,
  PselUiMode_UserCreator = 1,
  PselUiMode_EnsureNetworkServiceAccountAvailable = 2,
  PselUiMode_UserIconEditor = 3,
  PselUiMode_UserNicknameEditor = 4,
  PselUiMode_UserCreatorForStarter = 5,
  PselUiMode_NintendoAccountAuthorizationRequestContext = 6,
  PselUiMode_IntroduceExternalNetworkServiceAccount = 7,
  PselUiMode_IntroduceExternalNetworkServiceAccountForRegistration = 8,
  PselUiMode_NintendoAccountNnidLinker = 9,
  PselUiMode_LicenseRequirementsForNetworkService = 10,
  PselUiMode_LicenseRequirementsForNetworkServiceWithUserContextImpl = 11,
  PselUiMode_UserCreatorForImmediateNaLoginTest = 12,
  PselUiMode_UserQualificationPromoter = 13
}
 playerSelect UI modes. More...
 
enum  PselUserSelectionPurpose {
  PselUserSelectionPurpose_General = 0,
  PselUserSelectionPurpose_GameCardRegistration = 1,
  PselUserSelectionPurpose_EShopLaunch = 2,
  PselUserSelectionPurpose_EShopItemShow = 3,
  PselUserSelectionPurpose_PicturePost = 4,
  PselUserSelectionPurpose_NintendoAccountLinkage = 5,
  PselUserSelectionPurpose_SettingsUpdate = 6,
  PselUserSelectionPurpose_SaveDataDeletion = 7,
  PselUserSelectionPurpose_UserMigration = 8,
  PselUserSelectionPurpose_SaveDataTransfer = 9
}
 UI message text to display with PselUiMode_UserSelector. Invalid values are handled as PselUserSelectionPurpose_General. More...
 
enum  PselNintendoAccountStartupDialogType {
  PselNintendoAccountStartupDialogType_LoginAndCreate = 0,
  PselNintendoAccountStartupDialogType_Login = 1,
  PselNintendoAccountStartupDialogType_Create = 2
}
 NintendoAccountStartupDialogType. More...
 

Functions

Result pselUiCreate (PselUiSettings *ui, PselUiMode mode)
 Creates a new UI config for the playerSelect applet with the specified mode. More...
 
void pselUiAddUser (PselUiSettings *ui, AccountUid user_id)
 Adds an user to the user list of the applet. More...
 
static void pselUiSetAllowUserCreation (PselUiSettings *ui, bool flag)
 Sets whether users can be created in the applet. More...
 
static void pselUiSetNetworkServiceRequired (PselUiSettings *ui, bool flag)
 Sets whether users need to be linked to a Nintendo account. More...
 
static void pselUiSetSkipButtonEnabled (PselUiSettings *ui, bool flag)
 Sets whether selection can be skipped with a button. More...
 
Result pselUiShow (PselUiSettings *ui, AccountUid *out_user)
 Shows the applet with the specified UI settings. More...
 
Result pselShowUserSelectorForSystem (AccountUid *out_user, const PselUserSelectionSettings *settings, const PselUserSelectionSettingsForSystemService *settings_system)
 This is the System version of pselShowUserSelector. More...
 
Result pselShowUserSelectorForLauncher (AccountUid *out_user, const PselUserSelectionSettings *settings, u64 application_id)
 This is the Launcher version of pselShowUserSelector. More...
 
Result pselShowUserSelector (AccountUid *out_user, const PselUserSelectionSettings *settings)
 Shows the applet to select a user. More...
 
Result pselShowUserCreator (void)
 Shows the applet to create a user. More...
 
Result pselShowUserIconEditor (AccountUid user)
 Shows the applet to change a user's icon. More...
 
Result pselShowUserNicknameEditor (AccountUid user)
 Shows the applet to change a user's nickname. More...
 
Result pselShowUserCreatorForStarter (void)
 Shows the applet to create a user. More...
 
Result pselShowNintendoAccountNnidLinker (AccountUid user)
 Shows the applet for Nintendo Account Nnid linking. More...
 
Result pselShowUserQualificationPromoter (AccountUid user)
 Shows the applet for UserQualificationPromoter. More...
 

Detailed Description

Wrapper for using the playerSelect (user selection) LibraryApplet.

Author
XorTroll, yellows8

Enumeration Type Documentation

◆ PselNintendoAccountStartupDialogType

NintendoAccountStartupDialogType.

Enumerator
PselNintendoAccountStartupDialogType_LoginAndCreate 

LoginAndCreate.

PselNintendoAccountStartupDialogType_Login 

Login.

PselNintendoAccountStartupDialogType_Create 

Create.

◆ PselUiMode

enum PselUiMode

playerSelect UI modes.

Enumerator
PselUiMode_UserSelector 

UserSelector.

PselUiMode_UserCreator 

UserCreator.

PselUiMode_EnsureNetworkServiceAccountAvailable 

EnsureNetworkServiceAccountAvailable.

PselUiMode_UserIconEditor 

UserIconEditor.

PselUiMode_UserNicknameEditor 

UserNicknameEditor.

PselUiMode_UserCreatorForStarter 

UserCreatorForStarter.

PselUiMode_NintendoAccountAuthorizationRequestContext 

NintendoAccountAuthorizationRequestContext.

PselUiMode_IntroduceExternalNetworkServiceAccount 

IntroduceExternalNetworkServiceAccount.

PselUiMode_IntroduceExternalNetworkServiceAccountForRegistration 

[6.0.0+] IntroduceExternalNetworkServiceAccountForRegistration

PselUiMode_NintendoAccountNnidLinker 

[6.0.0+] NintendoAccountNnidLinker

PselUiMode_LicenseRequirementsForNetworkService 

[6.0.0+] LicenseRequirementsForNetworkService

PselUiMode_LicenseRequirementsForNetworkServiceWithUserContextImpl 

[7.0.0+] LicenseRequirementsForNetworkServiceWithUserContextImpl

PselUiMode_UserCreatorForImmediateNaLoginTest 

[7.0.0+] UserCreatorForImmediateNaLoginTest

PselUiMode_UserQualificationPromoter 

[13.0.0+] UserQualificationPromoter

◆ PselUserSelectionPurpose

UI message text to display with PselUiMode_UserSelector. Invalid values are handled as PselUserSelectionPurpose_General.

Enumerator
PselUserSelectionPurpose_General 

"Select a user."

PselUserSelectionPurpose_GameCardRegistration 

[2.0.0+] "Who will receive the points?"

PselUserSelectionPurpose_EShopLaunch 

[2.0.0+] "Who is using Nintendo eShop?"

PselUserSelectionPurpose_EShopItemShow 

[2.0.0+] "Who is making this purchase?"

PselUserSelectionPurpose_PicturePost 

[2.0.0+] "Who is posting?"

PselUserSelectionPurpose_NintendoAccountLinkage 

[2.0.0+] "Select a user to link to a Nintendo Account."

PselUserSelectionPurpose_SettingsUpdate 

[2.0.0+] "Change settings for which user?"

PselUserSelectionPurpose_SaveDataDeletion 

[2.0.0+] "Format data for which user?"

PselUserSelectionPurpose_UserMigration 

[4.0.0+] "Which user will be transferred to another console?"

PselUserSelectionPurpose_SaveDataTransfer 

[8.0.0+] "Send save data for which user?"

Function Documentation

◆ pselShowNintendoAccountNnidLinker()

Result pselShowNintendoAccountNnidLinker ( AccountUid  user)

Shows the applet for Nintendo Account Nnid linking.

Note
Only available on [6.0.0+].
Parameters
[in]userInput user ID.

◆ pselShowUserCreator()

Result pselShowUserCreator ( void  )

Shows the applet to create a user.

Note
This uses accountIsUserRegistrationRequestPermitted, hence accountInitialize must be used prior to this. If the output flag is 0, an error will be thrown.

◆ pselShowUserCreatorForStarter()

Result pselShowUserCreatorForStarter ( void  )

Shows the applet to create a user.

Used by the starter applet during system setup.

◆ pselShowUserIconEditor()

Result pselShowUserIconEditor ( AccountUid  user)

Shows the applet to change a user's icon.

Parameters
[in]userInput user ID.

◆ pselShowUserNicknameEditor()

Result pselShowUserNicknameEditor ( AccountUid  user)

Shows the applet to change a user's nickname.

Parameters
[in]userInput user ID.

◆ pselShowUserQualificationPromoter()

Result pselShowUserQualificationPromoter ( AccountUid  user)

Shows the applet for UserQualificationPromoter.

Note
Only available on [13.0.0+].
Parameters
[in]userInput user ID.

◆ pselShowUserSelector()

Result pselShowUserSelector ( AccountUid out_user,
const PselUserSelectionSettings settings 
)

Shows the applet to select a user.

Note
This uses accountIsUserRegistrationRequestPermitted, hence accountInitialize must be used prior to this. See also the docs for PselUserSelectionSettings::is_skip_enabled.
Parameters
[out]out_userReturned selected user ID.
[in]settingsPselUserSelectionSettings

◆ pselShowUserSelectorForLauncher()

Result pselShowUserSelectorForLauncher ( AccountUid out_user,
const PselUserSelectionSettings settings,
u64  application_id 
)

This is the Launcher version of pselShowUserSelector.

Note
This uses accountIsUserRegistrationRequestPermitted, hence accountInitialize must be used prior to this. See also the docs for PselUserSelectionSettings::is_skip_enabled.
Parameters
[out]out_userReturned selected user ID.
[in]settingsPselUserSelectionSettings
[in]application_idApplicationId

◆ pselShowUserSelectorForSystem()

Result pselShowUserSelectorForSystem ( AccountUid out_user,
const PselUserSelectionSettings settings,
const PselUserSelectionSettingsForSystemService settings_system 
)

This is the System version of pselShowUserSelector.

Note
This uses accountIsUserRegistrationRequestPermitted, hence accountInitialize must be used prior to this. See also the docs for PselUserSelectionSettings::is_skip_enabled.
Parameters
[out]out_userReturned selected user ID.
[in]settingsPselUserSelectionSettings
[in]settings_system[2.0.0+] PselUserSelectionSettingsForSystemService, ignored on prior versions.

◆ pselUiAddUser()

void pselUiAddUser ( PselUiSettings ui,
AccountUid  user_id 
)

Adds an user to the user list of the applet.

Parameters
uiPselUiSettings struct.
[in]user_iduser ID.
Note
The users will be treated as invalid users for user selection mode, and as the input user for other modes.

◆ pselUiCreate()

Result pselUiCreate ( PselUiSettings ui,
PselUiMode  mode 
)

Creates a new UI config for the playerSelect applet with the specified mode.

Parameters
uiPseluiSettings struct.
modeplayerSelect UI mode.

◆ pselUiSetAllowUserCreation()

static void pselUiSetAllowUserCreation ( PselUiSettings ui,
bool  flag 
)
inlinestatic

Sets whether users can be created in the applet.

Parameters
uiPselUiSettings struct.
flagFlag value.
Note
Only used for ::PselUiMode_SelectUser.

◆ pselUiSetNetworkServiceRequired()

static void pselUiSetNetworkServiceRequired ( PselUiSettings ui,
bool  flag 
)
inlinestatic

Sets whether users need to be linked to a Nintendo account.

Parameters
uiPselUiSettings struct.
flagFlag value.

◆ pselUiSetSkipButtonEnabled()

static void pselUiSetSkipButtonEnabled ( PselUiSettings ui,
bool  flag 
)
inlinestatic

Sets whether selection can be skipped with a button.

Parameters
uiPselUiSettings struct.
flagFlag value.

◆ pselUiShow()

Result pselUiShow ( PselUiSettings ui,
AccountUid out_user 
)

Shows the applet with the specified UI settings.

Parameters
uiPselUiSettings struct.
out_userSelected user ID.
Note
If user skips (see pselUiSetSkipEnabled) this will return successfully but the output ID will be 0.