---@class WB_FaceNotice_C:UUserWidget ---@field Button_close UButton ---@field Button_left UButton ---@field Button_right UButton ---@field CanvasPanel_IPX UCanvasPanel ---@field CheckBox_select UCheckBox ---@field HorizontalBox_Paging UHorizontalBox ---@field WidgetSwitcher_page UWidgetSwitcher --Edit Below-- ---@type WB_FaceNotice_C local WB_FaceNotice = { bInitDoOnce = true; SelectColor = { R = 1., G = 0.51, B = 0.14, A = 1. }; NotSelectColor = { R = 1., G = 1., B = 1., A = 1. }; }; function WB_FaceNotice:Construct() self.Button_close.OnClicked:Add(self.CloseGuide, self) self.Button_left.OnClicked:Add(self.LastGuide, self) self.Button_right.OnClicked:Add(self.NextGuide, self) UGCEventSystem.SetTimer(self, function() self:CloseGuide(); end, DefaultSettings.ShowFaceNoticeTime); end function WB_FaceNotice:CloseGuide() UGCLogSystem.Log("[WB_FaceNotice:CloseGuide] 执行") WidgetManager:ClosePanel(WidgetConfig.EUIType.FaceNotice) self:SetVisibility(ESlateVisibility.Collapsed); end function WB_FaceNotice:LastGuide() self:UpdateIndex(self:GetNowIndex() - 1) end function WB_FaceNotice:NextGuide() self:UpdateIndex(self:GetNowIndex() + 1) end function WB_FaceNotice:GetNowIndex() return self.WidgetSwitcher_page:GetActiveWidgetIndex() end function WB_FaceNotice:UpdateIndex(NewIndex) if NewIndex >= self.WidgetSwitcher_page:GetChildrenCount() then NewIndex = 0 elseif NewIndex < 0 then NewIndex = self.WidgetSwitcher_page:GetChildrenCount() - 1 end self.WidgetSwitcher_page:SetActiveWidgetIndex(NewIndex) UITool.ForeachAllChildren(self.HorizontalBox_Paging, function(index, Widget) if (index - 1) == NewIndex then Widget:SetColorAndOpacity(self.SelectColor) else Widget:SetColorAndOpacity(self.NotSelectColor) end end); end -- function WB_FaceNotice:Tick(MyGeometry, InDeltaTime) -- end -- function WB_FaceNotice:Destruct() -- end function WB_FaceNotice:OnClosePanel(...) --- 显示一下选择武器 if self.bInitDoOnce then self.bInitDoOnce = false; end end return WB_FaceNotice;