36 lines
1.6 KiB
Lua
36 lines
1.6 KiB
Lua
|
---@class WB_PlayerInfo_L_C:UUserWidget
|
||
|
---@field General_AvatarFrame_UIBP UCommon_Avatar_BP_C
|
||
|
---@field Image_TC_Loading_Item_Badge1 UImage
|
||
|
---@field Image_TC_Loading_Item_Badge2 UImage
|
||
|
---@field TextBlock_TC_Loading_PlayerName1 UTextBlock
|
||
|
---@field WidgetSwitcher_TC_Loading_Gender1 UWidgetSwitcher
|
||
|
---@field WidgetSwitcher_TC_Loading_Item UWidgetSwitcher
|
||
|
--Edit Below--
|
||
|
local WB_PlayerInfo_L = { bInitDoOnce = false }
|
||
|
|
||
|
--[==[ Construct
|
||
|
function WB_PlayerInfo_L:Construct()
|
||
|
|
||
|
end
|
||
|
-- Construct ]==]
|
||
|
|
||
|
-- function WB_PlayerInfo_L:Tick(MyGeometry, InDeltaTime)
|
||
|
|
||
|
-- end
|
||
|
|
||
|
-- function WB_PlayerInfo_L:Destruct()
|
||
|
|
||
|
-- end
|
||
|
|
||
|
function WB_PlayerInfo_L:UpdatePlayerInfo(PlayerKey)
|
||
|
local PlayerInfo = UGCGameSystem.GameState:GetPlayerHeadInfo(PlayerKey)
|
||
|
---@param PlayerInfo table {UID:string, IconURL:string, Gender:int, AvatarBoxId:int, PlayerLevel:int, PlayerName:string} 其中AvatarBoxId可以从PlayerState中获取
|
||
|
UGCLogSystem.LogTree(string.format("[WB_PlayerInfo_L_UpdatePlayerInfo] PlayerInfo ="), PlayerInfo)
|
||
|
UGCLogSystem.Log("[WB_ShowVSPlayerInfo:UpdatePlayerInfo] PlayerName = %s", PlayerInfo.PlayerName)
|
||
|
self.TextBlock_TC_Loading_PlayerName1:SetText(PlayerInfo.PlayerName)
|
||
|
self.WidgetSwitcher_TC_Loading_Gender1:SetActiveWidgetIndex(PlayerInfo.Gender - 1)
|
||
|
---@field InitView:fun(style:int32,uid:FString,iconURL:FString,gender:int32,frameLevel:int32,playerLevel:int32,ignoreFrame:bool,IsMySelf:bool)
|
||
|
self.General_AvatarFrame_UIBP:InitView(2, PlayerInfo.UIDString, PlayerInfo.IconURL, PlayerInfo.Gender, PlayerInfo.AvatarBoxId, PlayerInfo.PlayerLevel, false, false)
|
||
|
end
|
||
|
|
||
|
return WB_PlayerInfo_L
|