---@class WBP_GuideTips_2_C:WBP_GuideTipsBase_C ---@field CanvasPanel_Tips_1 UCanvasPanel ---@field CanvasPanel_Tips_2 UCanvasPanel ---@field CanvasPanel_Tips_3 UCanvasPanel ---@field CanvasPanel_Tips_4 UCanvasPanel ---@field Panel_Root UCanvasPanel ---@field Panel_Tips UCanvasPanel ---@field RichText_Tips_1 UUTRichTextBlock ---@field RichText_Tips_2 UUTRichTextBlock ---@field RichText_Tips_3 UUTRichTextBlock ---@field RichText_Tips_4 UUTRichTextBlock --Edit Below-- local GuideBase = require('Script.UI.Guide.WBP_GuideTipsBase') local WBP_GuideTips_2 = setmetatable( { bInitDoOnce = false, TipTextPanels = {}, TipRichTexts = {}, }, { __index = GuideBase, __metatable = GuideBase } ); function WBP_GuideTips_2:Construct() self.TipTextPanels = { [EGuideTextType.Right] = self.CanvasPanel_Tips_1, [EGuideTextType.Top] = self.CanvasPanel_Tips_2, [EGuideTextType.Left] = self.CanvasPanel_Tips_3, [EGuideTextType.Down] = self.CanvasPanel_Tips_4, } self.TipRichTexts = { [EGuideTextType.Right] = self.RichText_Tips_1, [EGuideTextType.Top] = self.RichText_Tips_2, [EGuideTextType.Left] = self.RichText_Tips_3, [EGuideTextType.Down] = self.RichText_Tips_4, } end function WBP_GuideTips_2:ResetPosition(UIConfig) local MappingWidget = UIConfig self.Panel_Root:SetVisibility(ESlateVisibility.HitTestInvisible) if MappingWidget then local SlotSize = MappingWidget.Slot:GetSize() local SlotAlignment = MappingWidget.Slot:GetAlignment() local _, Pos = SlateBlueprintLibrary.LocalToViewport(self, MappingWidget:GetCachedGeometry(), {X = SlotAlignment.X * SlotSize.X, Y = SlotAlignment.Y * SlotSize.Y}) Pos.X = Pos.X + SlotSize.X * (0.5 - SlotAlignment.X) Pos.Y = Pos.Y + SlotSize.Y * (0.5 - SlotAlignment.Y) self.Panel_Root.Slot:SetPosition(Pos) local GuideSize = self.Panel_Tips.Slot:GetSize() local HLXScale = SlotSize.X / self.Panel_Tips.Slot:GetSize().X local HLYScale = SlotSize.Y / self.Panel_Tips.Slot:GetSize().Y local TransScale = MappingWidget.RenderTransform.Scale local SizeXY = {X = GuideSize.X * HLXScale * TransScale.X, Y = GuideSize.Y * HLYScale * TransScale.Y} self.Panel_Tips.Slot:SetSize(SizeXY) else self:SetVisibility(ESlateVisibility.Collapsed); end end function WBP_GuideTips_2:ResetGuideText(TextConfig) local TextType = TextConfig.TextType local TipText = TextConfig.Text self:SetupTipPanel(TextType, TipText) end function WBP_GuideTips_2:SetupTipPanel(TextType, TipText) if TextType == nil or TextType <= EGuideTextType.None or TipText == nil or TipText == "" then for _, Panel in pairs(self.TipTextPanels) do Panel:SetVisibility(ESlateVisibility.Collapsed) end return end for Type, Panel in pairs(self.TipTextPanels) do if Type == TextType then Panel:SetVisibility(ESlateVisibility.HitTestInvisible) self.TipRichTexts[TextType]:SetText(TipText) else Panel:SetVisibility(ESlateVisibility.Collapsed) end end end return WBP_GuideTips_2;