33 lines
852 B
Lua
33 lines
852 B
Lua
---@class WBP_CloseWidget_C:UUserWidget
|
|
--Edit Below--
|
|
local WBP_CloseWidget = {
|
|
bInitDoOnce = false;
|
|
WidgetToClose = nil
|
|
};
|
|
|
|
--[==[ Construct
|
|
function WBP_CloseWidget:Construct()
|
|
|
|
end
|
|
-- Construct ]==]
|
|
|
|
-- function WBP_CloseWidget:Destruct()
|
|
|
|
-- end
|
|
|
|
-- 表示随意点击其他地方都会关闭要关闭的页面
|
|
function WBP_CloseWidget:OnMouseButtonDown(MyGeometry, PointerEvent)
|
|
print(string.format('[WBP_CloseWidget:OnMouseButtonDown] 执行'))
|
|
if UE.IsValid(self.WidgetToClose) then
|
|
--self.WidgetToClose:Close();
|
|
self.WidgetToClose:SetVisibility(ESlateVisibility.Collapsed)
|
|
end
|
|
return self.SuperClass:OnMouseButtonDown(MyGeometry, PointerEvent)
|
|
end
|
|
|
|
function WBP_CloseWidget:SetWidgetToClose(InWidget)
|
|
print(string.format('[WBP_CloseWidget:SetWidgetToClose] 执行了'))
|
|
self.WidgetToClose = InWidget
|
|
end
|
|
|
|
return WBP_CloseWidget; |