22 lines
880 B
Lua
22 lines
880 B
Lua
|
---@class WB_HeadingInfo_C:UUserWidget
|
||
|
---@field TextBlock_Kill UTextBlock
|
||
|
---@field TextBlock_Score UTextBlock
|
||
|
---@field TextBlock_Star UTextBlock
|
||
|
--Edit Below--
|
||
|
---@type WB_HeadingInfo_C
|
||
|
local WB_HeadingInfo = { bInitDoOnce = false; };
|
||
|
|
||
|
function WB_HeadingInfo:Construct()
|
||
|
UGCEventSystem.AddListener(EventEnum.UpdatePlayerScoreData, self.UpdatePlayerScoreData, self)
|
||
|
end
|
||
|
|
||
|
function WB_HeadingInfo:UpdatePlayerScoreData()
|
||
|
local LocalPK = UGCSystemLibrary.GetLocalPlayerKey()
|
||
|
self.TextBlock_Score:SetText(tostring(PlayerScoreSystem.GetPlayerScore(LocalPK)))
|
||
|
self.TextBlock_Kill:SetText(tostring(PlayerScoreSystem.GetPlayerScoreDataFromType(LocalPK, PlayerScoreSystem.Config.EScoreType.Kills)))
|
||
|
self.TextBlock_Star:SetText(tostring(PlayerScoreSystem.GetPlayerScoreDataFromType(LocalPK, PlayerScoreSystem.Config.EScoreType.StarCount)))
|
||
|
end
|
||
|
|
||
|
|
||
|
|
||
|
return WB_HeadingInfo;
|