53 lines
1.2 KiB
Lua
53 lines
1.2 KiB
Lua
---@class WB_ShowDisable_C:UUserWidget
|
|
---@field Image_0 UImage
|
|
---@field WidgetSwitcher_Icons UWidgetSwitcher
|
|
--Edit Below--
|
|
---@type WB_ShowDisable_C
|
|
local WB_ShowDisable = { bInitDoOnce = false }
|
|
|
|
function WB_ShowDisable:Construct()
|
|
end
|
|
|
|
WB_ShowDisable.DisableType = nil;
|
|
|
|
function WB_ShowDisable:LuaInit()
|
|
if self.bInitDoOnce then return ; end
|
|
-- 读取是否是禁用状态
|
|
self:SetInitDisable(false);
|
|
|
|
self.bInitDoOnce = true;
|
|
end
|
|
|
|
-- function WB_ShowDisable:Tick(MyGeometry, InDeltaTime)
|
|
|
|
-- end
|
|
|
|
function WB_ShowDisable:Destruct()
|
|
self.WidgetSwitcher_Icons:ClearChildren();
|
|
end
|
|
|
|
function WB_ShowDisable:SetDisableType(InType)
|
|
self.DisableType = InType;
|
|
self.WidgetSwitcher_Icons:SetActiveWidgetIndex(InType - 1);
|
|
-- 设置一下
|
|
if DisableInfo[InType].Default then
|
|
self:SetInitDisable(DisableInfo[InType].Default);
|
|
end
|
|
end
|
|
|
|
function WB_ShowDisable:GetDisableType()
|
|
return self.DisableType;
|
|
end
|
|
|
|
function WB_ShowDisable:SetInitDisable(Enable)
|
|
if self.DisableType and DisableInfo[self.DisableType].IsSelectEnable then
|
|
Enable = not Enable
|
|
end
|
|
if Enable then
|
|
self.Image_0:SetVisibility(ESlateVisibility.SelfHitTestInvisible);
|
|
else
|
|
self.Image_0:SetVisibility(ESlateVisibility.Collapsed);
|
|
end
|
|
end
|
|
|
|
return WB_ShowDisable |