Freigeben über


XGameUiShowPlayerPickerAsync

Displays a picker UI that allows a person playing the game to select players from a presented list of people.

Syntax

HRESULT XGameUiShowPlayerPickerAsync(  
         XAsyncBlock* async,  
         XUserHandle requestingUser,  
         const char* promptText,  
         uint32_t selectFromPlayersCount,  
         const uint64_t* selectFromPlayers,  
         uint32_t preSelectedPlayersCount,  
         const uint64_t* preSelectedPlayers,  
         uint32_t minSelectionCount,  
         uint32_t maxSelectionCount  
)  

Parameters

async   _In_
Type: XAsyncBlock*

A pointer to the XAsyncBlock that is passed to XAsyncRun.

requestingUser   _In_
Type: XUserHandle

A handle to the user requesting the player picker UI.

promptText   _In_z_
Type: char*

The prompt display text.

selectFromPlayersCount   _In_
Type: uint32_t

The number of players that the caller can select from.

selectFromPlayers   _In_reads_(selectFromPlayersCount)
Type: uint64_t*

A pointer to a list of player IDs that the caller can select from.

preSelectedPlayersCount   _In_
Type: uint32_t

The number of players that are pre-selected when the UI is presented.

preSelectedPlayers   _In_reads_opt_(preSelectedPlayersCount)
Type: uint64_t*

A pointer to a list of player IDs that are pre-selected when the UI is presented.

minSelectionCount   _In_
Type: uint32_t

The minimum number of people the caller must select.

maxSelectionCount   _In_
Type: uint32_t

The maximum number of people the caller can select.

Return value

Type: HRESULT

HRESULT success or error code of the async call.

To get the result, call XGameUiShowPlayerPickerResultCount and XGameUiShowPlayerPickerResult inside the AsyncBlock callback or after the AsyncBlock is complete.

Remarks

The player IDs must be Xbox User Ids (XUIDs), which are a uint64_t value.

Calling for UI will cause your game to enter constrained mode. In constrained mode your title will receive fewer system resources while it is in the background of the UI that has been called for. To learn more about constrained mode and other operational modes for your title read Xbox Game Life Cycle (NDA topic)Autorisierung erforderlich.

Requirements

Header: XGameUI.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

XGameUI
XGameUiShowPlayerPickerResult
XGameUiShowPlayerPickerResultCount
Xbox Game Life Cycle (NDA topic)Autorisierung erforderlich