UGCProjects/ProjectTemp_T/Script/UI/WB_Spectation.lua

35 lines
950 B
Lua
Raw Normal View History

2025-01-04 23:00:19 +08:00
---@class WB_Spectation_C:UUserWidget
---@field Button_ExitSpectate UButton
--Edit Below--
---@type WB_Spectation_C
local WB_Spectation = { bInitDoOnce = false; };
function WB_Spectation:Construct()
UITool.BindButtonClicked(self.Button_ExitSpectate, self.OnExitSpectate, self)
end
function WB_Spectation:OnShowPanel()
-- 隐藏退出按钮
LocalPlayerController:CastUIMsg("UIMsg_HideQuitWatch", "");
end
-- function WB_Spectation:Tick(MyGeometry, InDeltaTime)
-- end
-- function WB_Spectation:Destruct()
-- end
function WB_Spectation:OnExitSpectate()
UGCLogSystem.Log("[WB_Spectation:OnExitSpectate] 退出观战")
self:OnClosePanel();
WidgetManager:ClosePanel(WidgetConfig.EUIType.Spectation);
end
function WB_Spectation:OnClosePanel()
--UnrealNetwork.CallUnrealRPC(LocalPlayerController, LocalPlayerController, "ExitSpectate");
UGCSendRPCSystem.ActorRPCNotify(nil, LocalPlayerController, "ExitSpectate");
end
return WB_Spectation;