2021-01-09 14:20:06 +08:00
|
|
|
|
----- 中号通用弹窗 -----
|
2020-11-04 19:51:58 +08:00
|
|
|
|
require("Base/BasePanel")
|
2020-11-05 19:10:20 +08:00
|
|
|
|
GeneralBigPopup = Inherit(BasePanel)
|
|
|
|
|
local this = GeneralBigPopup
|
2020-11-04 19:51:58 +08:00
|
|
|
|
local sorting = 0
|
|
|
|
|
|
|
|
|
|
--子模块脚本
|
|
|
|
|
local contentScripts = {
|
|
|
|
|
--易经宝库
|
2021-05-12 17:40:38 +08:00
|
|
|
|
[GENERAL_POPUP_TYPE.YiJingBaoKu] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKu"), panelName = "GeneralBigPopup_YiJingBaoKu"},
|
2020-11-06 13:36:48 +08:00
|
|
|
|
--易经宝库奖励预览
|
2021-05-12 17:40:38 +08:00
|
|
|
|
[GENERAL_POPUP_TYPE.YiJingBaoKuRewardPreview] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKuRewardPreview"), panelName = "GeneralBigPopup_YiJingBaoKuRewardPreview"},
|
|
|
|
|
--修行境界预览
|
|
|
|
|
[GENERAL_POPUP_TYPE.PracticeStatePreview] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_PracticeStatePreview"), panelName = "GeneralBigPopup_PracticeStatePreview"},
|
2021-05-17 10:54:36 +08:00
|
|
|
|
[GENERAL_POPUP_TYPE.RecrutReward] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_ExpertRewardSortPanel"), panelName = "GeneralBigPopup_ExpertRewardSortPanel"},
|
|
|
|
|
[GENERAL_POPUP_TYPE.RecrutDetail] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_RecrutDetail"), panelName = "GeneralBigPopup_RecrutDetail"},
|
2021-05-20 20:23:22 +08:00
|
|
|
|
--修行选择附身英雄
|
|
|
|
|
[GENERAL_POPUP_TYPE.XiuXingSelectHero] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_XiuXingSelectHero"), panelName = "GeneralBigPopup_XiuXingSelectHero"},
|
2020-12-11 16:03:27 +08:00
|
|
|
|
--神应属性
|
2021-05-24 16:39:34 +08:00
|
|
|
|
[GENERAL_POPUP_TYPE.ShenYingShuXing] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_ShenYingShuXing"), panelName = "GeneralBigPopup_ShenYingShuXing"},
|
2020-12-21 10:46:53 +08:00
|
|
|
|
--四灵试炼助战
|
2021-05-24 16:39:34 +08:00
|
|
|
|
[GENERAL_POPUP_TYPE.FourElementHelpFight] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_FourElementHelpFight"), panelName = "GeneralBigPopup_FourElementHelpFight"},
|
2021-05-24 13:53:28 +08:00
|
|
|
|
[GENERAL_POPUP_TYPE.WuJinShuXing] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_WuJinShuXing"), panelName = "GeneralBigPopup_WuJinShuXing"},
|
2021-06-16 11:16:41 +08:00
|
|
|
|
[GENERAL_POPUP_TYPE.JinJieYuLan] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_JinJieYuLan"), panelName = "GeneralBigPopup_JinJieYuLan"},
|
2021-06-29 11:30:26 +08:00
|
|
|
|
--心愿抽卡
|
|
|
|
|
[GENERAL_POPUP_TYPE.WishDraw] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_WishDraw"), panelName = "GeneralBigPopup_WishDraw"},
|
2021-09-08 16:26:40 +08:00
|
|
|
|
--七界试炼遗物
|
|
|
|
|
[GENERAL_POPUP_TYPE.QiJieTreasure] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_QiJieTreasure"), panelName = "GeneralBigPopup_QiJieTreasure"},
|
2021-09-15 14:29:14 +08:00
|
|
|
|
--寻宝迷踪奖励
|
|
|
|
|
[GENERAL_POPUP_TYPE.XunBaoMiZong] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_XunBaoMiZong"), panelName = "GeneralBigPopup_XunBaoMiZong"},
|
2021-10-22 15:47:59 +08:00
|
|
|
|
--神魂
|
|
|
|
|
[GENERAL_POPUP_TYPE.ShenHun] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_RoleGodSoulUp"), panelName = "GeneralBigPopup_RoleGodSoulUp"},
|
2021-10-08 20:49:25 +08:00
|
|
|
|
--御剑行竞猜
|
|
|
|
|
[GENERAL_POPUP_TYPE.YuJianLastResult] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YuJianLastResult"), panelName = "GeneralBigPopup_YuJianLastResult"},
|
|
|
|
|
--御剑行上轮奖励
|
|
|
|
|
[GENERAL_POPUP_TYPE.YuJianBet] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YuJianBet"), panelName = "GeneralBigPopup_YuJianBet"},
|
2021-10-27 15:24:46 +08:00
|
|
|
|
[GENERAL_POPUP_TYPE.ShenHunShuXing] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_ShenhunDes"), panelName = "GeneralBigPopup_ShenhunDes"},
|
2021-11-16 11:21:37 +08:00
|
|
|
|
--灵脉秘境纪录
|
|
|
|
|
[GENERAL_POPUP_TYPE.LingMaiRecord] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_LingMaiRecord"), panelName = "GeneralBigPopup_LingMaiRecord"},
|
2021-11-22 11:44:48 +08:00
|
|
|
|
[GENERAL_POPUP_TYPE.IncarnationDes] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_IncarnationDes"), panelName = "GeneralBigPopup_IncarnationDes"},
|
2020-11-04 19:51:58 +08:00
|
|
|
|
}
|
|
|
|
|
--子模块预设
|
|
|
|
|
local contentPrefabs={}
|
|
|
|
|
--打开弹窗类型
|
|
|
|
|
local popupType
|
|
|
|
|
|
|
|
|
|
--初始化组件(用于子类重写)
|
2020-11-05 19:10:20 +08:00
|
|
|
|
function GeneralBigPopup:InitComponent()
|
2021-05-19 14:12:37 +08:00
|
|
|
|
this.spLoader = SpriteLoader.New()
|
2020-11-04 19:51:58 +08:00
|
|
|
|
this.contents=Util.GetGameObject(this.gameObject,"Contents")
|
|
|
|
|
this.backBtn=Util.GetGameObject(this.contents,"BG/BackBtn")
|
|
|
|
|
this.BG=Util.GetGameObject(this.contents,"BG")
|
|
|
|
|
this.Mask=Util.GetGameObject(this.gameObject,"Mask")
|
2020-12-11 16:03:27 +08:00
|
|
|
|
this.BG:SetActive(true)
|
|
|
|
|
this.Mask:SetActive(true)
|
2020-11-04 19:51:58 +08:00
|
|
|
|
--子模块脚本初始化
|
2021-05-12 17:40:38 +08:00
|
|
|
|
for key, value in pairs(contentScripts) do
|
|
|
|
|
value.view:InitComponent(Util.GetGameObject(this.contents, value.panelName))
|
2020-11-04 19:51:58 +08:00
|
|
|
|
end
|
|
|
|
|
--预设赋值
|
2021-05-12 17:40:38 +08:00
|
|
|
|
for key, value in pairs(contentScripts) do
|
|
|
|
|
contentPrefabs[key]=Util.GetGameObject(this.contents,value.panelName)
|
2020-11-04 19:51:58 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--绑定事件(用于子类重写)
|
2020-11-05 19:10:20 +08:00
|
|
|
|
function GeneralBigPopup:BindEvent()
|
2021-05-12 17:40:38 +08:00
|
|
|
|
for key, value in pairs(contentScripts) do
|
|
|
|
|
value.view:BindEvent()
|
2020-11-04 19:51:58 +08:00
|
|
|
|
end
|
|
|
|
|
--返回按钮
|
2021-05-12 17:40:38 +08:00
|
|
|
|
Util.AddClick(this.backBtn,function()
|
|
|
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged)
|
|
|
|
|
self:ClosePanel()
|
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(this.Mask,function()
|
2020-11-04 19:51:58 +08:00
|
|
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged)
|
|
|
|
|
self:ClosePanel()
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
2020-11-05 19:10:20 +08:00
|
|
|
|
function GeneralBigPopup:AddListener()
|
2021-05-12 17:40:38 +08:00
|
|
|
|
for key, value in pairs(contentScripts) do
|
|
|
|
|
value.view:AddListener()
|
2020-11-04 19:51:58 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2020-11-05 19:10:20 +08:00
|
|
|
|
function GeneralBigPopup:RemoveListener()
|
2021-05-12 17:40:38 +08:00
|
|
|
|
for key, value in pairs(contentScripts) do
|
|
|
|
|
value.view:RemoveListener()
|
2020-11-04 19:51:58 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2020-11-05 19:10:20 +08:00
|
|
|
|
function GeneralBigPopup:OnSortingOrderChange()
|
2020-11-04 19:51:58 +08:00
|
|
|
|
this.sortingOrder = self.sortingOrder
|
|
|
|
|
end
|
2021-05-12 17:40:38 +08:00
|
|
|
|
function GeneralBigPopup:OnOpen(popupKey,...)
|
|
|
|
|
for key, value in pairs(contentPrefabs) do
|
|
|
|
|
value.gameObject:SetActive(false)
|
2020-11-04 19:51:58 +08:00
|
|
|
|
end
|
2021-05-12 17:40:38 +08:00
|
|
|
|
this.Mask:SetActive(popupKey ~= GENERAL_POPUP_TYPE.Onhook)
|
|
|
|
|
this.BG:SetActive(popupKey ~= GENERAL_POPUP_TYPE.Onhook)
|
2021-09-16 18:11:33 +08:00
|
|
|
|
this.popupKey = popupKey
|
2021-09-17 20:04:53 +08:00
|
|
|
|
this.args = {...}
|
2020-11-04 19:51:58 +08:00
|
|
|
|
end
|
|
|
|
|
|
2020-11-05 19:10:20 +08:00
|
|
|
|
function GeneralBigPopup:OnShow()
|
2021-09-16 18:11:33 +08:00
|
|
|
|
contentPrefabs[this.popupKey].gameObject:SetActive(true)
|
2021-09-18 17:58:28 +08:00
|
|
|
|
contentScripts[this.popupKey].view:OnShow(this,this.args)--1、传入自己 2、传入不定参
|
2020-11-04 19:51:58 +08:00
|
|
|
|
end
|
|
|
|
|
|
2020-11-05 19:10:20 +08:00
|
|
|
|
function GeneralBigPopup:OnClose()
|
2021-05-12 17:40:38 +08:00
|
|
|
|
for key, value in pairs(contentScripts) do
|
|
|
|
|
value.view:OnClose()
|
2020-11-04 19:51:58 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2020-11-05 19:10:20 +08:00
|
|
|
|
function GeneralBigPopup:OnDestroy()
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.spLoader:Destroy()
|
2021-05-12 17:40:38 +08:00
|
|
|
|
for key, value in pairs(contentScripts) do
|
|
|
|
|
value.view:OnDestroy()
|
2020-11-04 19:51:58 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2020-11-05 19:10:20 +08:00
|
|
|
|
return GeneralBigPopup
|