---@class WBP_RollingNotice_C:WBP_NoticeBase_C ---@field FadeOut UWidgetAnimation ---@field FadeIn UWidgetAnimation ---@field TextBlock_Text UUTRichTextBlock --Edit Below-- local NoticeBase = require('Script.UI.Notice.WBP_NoticeBase') local WBP_RollingNotice = setmetatable( { bInitDoOnce = false, ParentWidget = nil, }, { __index = NoticeBase, __metatable = NoticeBase } ); function WBP_RollingNotice:SetParentWidget(InParent) self.ParentWidget = InParent end function WBP_RollingNotice:InitNoticeFromParam(InParams) local Type = InParams.Type local RichText = "" if Type == ERollingNoticeType.Gain then RichText = RichText..'获得' elseif Type == ERollingNoticeType.Drop then RichText = RichText..'丢弃' end RichText = RichText..string.format('%s', InParams.Color, InParams.Text) RichText = InParams.Num <= 0 and RichText or RichText..string.format('%s', '+'..tostring(InParams.Num)) self.TextBlock_Text:SetText(RichText) end function WBP_RollingNotice:GetEnterAnimation() return self.FadeIn end function WBP_RollingNotice:GetExitAnimation() return self.FadeOut end function WBP_RollingNotice:CloseNotice() if UE.IsValid(self.ParentWidget) then self.ParentWidget:RequestPopup() end end return WBP_RollingNotice;