2025-01-04 23:00:19 +08:00

43 lines
1.4 KiB
Lua

---@class WB_MiniGameMVP_2_C:UUserWidget
---@field ShowMVP UWidgetAnimation
---@field Border_ImageColor UBorder
---@field Image_Head UImage
---@field TextBlock_Name UTextBlock
---@field TextBlock_PlayerNum_Debug UTextBlock
---@field TextBlock_Score UTextBlock
--Edit Below--
local WB_MiniGameMVP_2 = { bInitDoOnce = false; };
--[==[ Construct
function WB_MiniGameMVP_2:Construct()
end
-- Construct ]==]
-- function WB_MiniGameMVP_2:Tick(MyGeometry, InDeltaTime)
-- end
-- function WB_MiniGameMVP_2:Destruct()
-- end
function WB_MiniGameMVP_2:UpdatePlayer(InPlayerKey, Score, IsMVP)
if GlobalConfigs.IsDebug then
self.TextBlock_PlayerNum_Debug:SetVisibility(ESlateVisibility.SelfHitTestInvisible)
self.TextBlock_PlayerNum_Debug:SetText(tostring(InPlayerKey % 10))
end
self.PlayerKey = InPlayerKey
local PlayerName = UGCGameSystem.GameState:GetPlayerNameByPlayerKey(self.PlayerKey)
self.TextBlock_Name:SetText(PlayerName)
if IsMVP then
self:PlayAnimation(self.ShowMVP, 0, 1, EUMGSequencePlayMode.Forward, 1)
self.Border_ImageColor:SetVisibility(ESlateVisibility.SelfHitTestInvisible)
else
self.Border_ImageColor:SetVisibility(ESlateVisibility.Collapsed)
end
self.TextBlock_Score:SetText(tostring(Score))
UGCSystemLibrary.DownloadImageToUImage(self.Image_Head, UGCGameSystem.GameState:GetHeadIconByPlayerKey(self.PlayerKey));
end
return WB_MiniGameMVP_2;