> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XGameUiShowPlayerPickerAsync

> XGameUiShowPlayerPickerAsync

# XGameUiShowPlayerPickerAsync

顯示選擇器 UI，讓正在玩遊戲的人從所呈現的人員清單中選取玩家。

## 語法

```cpp theme={null}
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  
)  
```

### 參數

*async*   \_In\_\
類型：[XAsyncBlock\*](https://docs.xbox.com/zh-TW/reference/system/xasync/structs/xasyncblock.md)

指向傳遞給 [XAsyncRun](https://docs.xbox.com/zh-TW/reference/system/xasync/functions/xasyncrun.md) 之 [XAsyncBlock](https://docs.xbox.com/zh-TW/reference/system/xasync/structs/xasyncblock.md) 的指標。

*requestingUser*   \_In\_\
類型：XUserHandle

要求玩家選擇器 UI 之使用者的控制代碼。

*promptText*   \_In\_z\_\
類型：char\*

提示顯示文字。

*selectFromPlayersCount*   \_In\_\
類型：uint32\_t

呼叫者可從中選取的玩家數目。

*selectFromPlayers*   \_In\_reads\_(selectFromPlayersCount)\
類型：uint64\_t\*

指向呼叫者可從中選取之玩家識別碼清單的指標。

*preSelectedPlayersCount*   \_In\_\
類型：uint32\_t

呈現 UI 時預先選取的玩家數目。

*preSelectedPlayers*   \_In\_reads\_opt\_(preSelectedPlayersCount)\
類型：uint64\_t\*

指向呈現 UI 時預先選取之玩家識別碼清單的指標。

*minSelectionCount*   \_In\_\
類型：uint32\_t

呼叫者必須選取的最少人數。

*maxSelectionCount*   \_In\_\
類型：uint32\_t

呼叫者可選取的最多人數。

### 傳回值

類型：HRESULT

非同步呼叫的 HRESULT 成功或錯誤碼。

若要取得結果，請在 *AsyncBlock* 回呼內或 *AsyncBlock* 完成之後，呼叫 [XGameUiShowPlayerPickerResultCount](https://docs.xbox.com/zh-TW/reference/system/xgameui/functions/xgameuishowplayerpickerresultcount.md) 和 [XGameUiShowPlayerPickerResult](https://docs.xbox.com/zh-TW/reference/system/xgameui/functions/xgameuishowplayerpickerresult.md)。

## 備註

玩家識別碼必須是 XBOX 使用者識別碼 (XUID)，其為 *uint64\_t* 值。

呼叫 UI 會讓您的遊戲進入 *受限模式*。在受限模式下，當您的遊戲位於所呼叫 UI 的背景時，會獲得較少的系統資源。若要深入了解受限模式及遊戲的其他作業模式，請參閱 [XBOX 遊戲生命週期 (NDA 主題)](https://docs.xbox.com/zh-TW/build/console-features/console-workflows/xbox-game-life-cycle.md)。

## 需求

**標頭：** XGameUI.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、Steam Deck、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XGameUI](https://docs.xbox.com/zh-TW/reference/system/xgameui/xgameui_members.md)\
[XGameUiShowPlayerPickerResult](https://docs.xbox.com/zh-TW/reference/system/xgameui/functions/xgameuishowplayerpickerresult.md)\
[XGameUiShowPlayerPickerResultCount](https://docs.xbox.com/zh-TW/reference/system/xgameui/functions/xgameuishowplayerpickerresultcount.md)\
[XBOX 遊戲生命週期 (NDA 主題)](https://docs.xbox.com/zh-TW/build/console-features/console-workflows/xbox-game-life-cycle.md)


## Related topics

- [XGameUiShowPlayerPickerResult](https://docs.xbox.com/zh-TW/reference/system/xgameui/functions/xgameuishowplayerpickerresult.md)
- [XGameUiShowPlayerPickerUiCallback](https://docs.xbox.com/zh-TW/reference/system/xgameui/functions/xgameuishowplayerpickeruicallback.md)
- [XGameUiShowPlayerPickerResultCount](https://docs.xbox.com/zh-TW/reference/system/xgameui/functions/xgameuishowplayerpickerresultcount.md)
- [XGameUiSetPlayerPickerUiResponse](https://docs.xbox.com/zh-TW/reference/system/xgameui/functions/xgameuisetplayerpickeruiresponse.md)
- [XGameUiUiCallbacks](https://docs.xbox.com/zh-TW/reference/system/xgameui/structs/xgameuiuicallbacks.md)
