ro-webgl/Assets/Lua/Managers/NewGotTipsMgr.lua
2026-02-11 16:08:51 +08:00

49 lines
1.4 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--[[
新获得提示,管理 UISuccessTips 的显示数据
]]
local NewGotTipsMgr = class("NewGotTipsMgr")
function NewGotTipsMgr:ctor()
self.showDatas = {}
end
function NewGotTipsMgr:Destroy()
self.showDatas = nil
end
function NewGotTipsMgr:GetShowData()
if self.showDatas then
local curData = self.showDatas[1]
if curData and curData.datas then
return curData.type, curData.datas[1]
end
end
return nil, nil
end
---@param type type为类型获得新技能解锁新功能等,1:为获得新技能)
---@param datas 技能时为List{skillType=Enum.SkillType.Active,skillId=10001}
function NewGotTipsMgr:AddShowData(type, datas)
if not self.showDatas then self.showDatas = {} end
table.insert(self.showDatas, {type = type, datas = datas})
if not ManagerContainer.LuaUIMgr:HasOpenPage(Enum.UIPageName.UISuccessTips) then
--ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UISuccessTips)
end
end
function NewGotTipsMgr:RemoveCurShowData()
if not self.showDatas then return false end
local curData = self.showDatas[1]
if curData and curData.datas then
table.remove(curData.datas, 1)
if #curData.datas <= 0 then
table.remove(self.showDatas, 1)
end
else
table.remove(self.showDatas, 1)
end
return self.showDatas[1] ~= nil
end
return NewGotTipsMgr