Skip to main content

XGameUiShowPlayerPickerAsync

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

語法

參數

async _In_
類型:XAsyncBlock*
指向傳遞給 XAsyncRun 之 XAsyncBlock 的指標。 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 和 XGameUiShowPlayerPickerResult。

備註

玩家識別碼必須是 XBOX 使用者識別碼 (XUID),其為 uint64_t 值。 呼叫 UI 會讓您的遊戲進入 受限模式。在受限模式下,當您的遊戲位於所呼叫 UI 的背景時,會獲得較少的系統資源。若要深入了解受限模式及遊戲的其他作業模式,請參閱 XBOX 遊戲生命週期 (NDA 主題)。

需求

標頭: XGameUI.h 程式庫: xgameruntime.lib 支援的平台: Windows、Steam Deck、XBOX One 系列主機和 XBOX Series 主機

另請參閱

XGameUI
XGameUiShowPlayerPickerResult
XGameUiShowPlayerPickerResultCount
XBOX 遊戲生命週期 (NDA 主題)
Last modified on October 6, 2026