parent
2501e3142b
commit
dbad362fae
|
|
@ -1838,6 +1838,7 @@ FUNCTION_OPEN_TYPE = {
|
|||
AutoSoliderDraw = 154, --自动抽小兵
|
||||
SoliderDraw = 155, --抽小兵
|
||||
Mingge = 157, --抽小兵
|
||||
Fabaojulingxinyuan = 158 --法宝巨灵心愿
|
||||
}
|
||||
|
||||
TaskGetBtnIconDef = {
|
||||
|
|
@ -2649,6 +2650,7 @@ GENERAL_POPUP_TYPE = {
|
|||
GiveLikeHotHero = 72, --英雄热度排行
|
||||
WishEquipDraw = 73, --心愿法宝抽卡
|
||||
IncarnationDes2 = 74,
|
||||
WishJulingDraw = 75, --心愿巨灵抽奖
|
||||
}
|
||||
|
||||
--通用信息弹窗类型
|
||||
|
|
|
|||
|
|
@ -677,8 +677,10 @@ function this.IsActivityOpenByJumpIndex(pageIndex, jumpIndex)
|
|||
if not ActivityGiftManager.IsQualifiled(tb[i].ActiveType) then
|
||||
return 1
|
||||
end
|
||||
LogError("ddddddddddddddddddddddddddddd" .. tostring(id) .. "/" .. tostring(tb[i].ActiveType))
|
||||
return id and id > 0 and ActivityGiftManager.IsQualifiled(tb[i].ActiveType)
|
||||
elseif tb[i].FunType > 0 then
|
||||
LogError("ddddddddddddddddddddddddddddd")
|
||||
return ActTimeCtrlManager.SingleFuncState(tb[i].FunType)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,67 +7,69 @@ local sorting = 0
|
|||
--子模块脚本
|
||||
local contentScripts = {
|
||||
--易经宝库
|
||||
[GENERAL_POPUP_TYPE.YiJingBaoKu] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKu"), panelName = "GeneralBigPopup_YiJingBaoKu"},
|
||||
[GENERAL_POPUP_TYPE.YiJingBaoKu] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKu"), panelName = "GeneralBigPopup_YiJingBaoKu" },
|
||||
--易经宝库奖励预览
|
||||
[GENERAL_POPUP_TYPE.YiJingBaoKuRewardPreview] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKuRewardPreview"), panelName = "GeneralBigPopup_YiJingBaoKuRewardPreview"},
|
||||
[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"},
|
||||
[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"},
|
||||
[GENERAL_POPUP_TYPE.PracticeStatePreview] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_PracticeStatePreview"), panelName = "GeneralBigPopup_PracticeStatePreview" },
|
||||
[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" },
|
||||
--修行选择附身英雄
|
||||
[GENERAL_POPUP_TYPE.XiuXingSelectHero] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_XiuXingSelectHero"), panelName = "GeneralBigPopup_XiuXingSelectHero"},
|
||||
[GENERAL_POPUP_TYPE.XiuXingSelectHero] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_XiuXingSelectHero"), panelName = "GeneralBigPopup_XiuXingSelectHero" },
|
||||
--神应属性
|
||||
[GENERAL_POPUP_TYPE.ShenYingShuXing] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_ShenYingShuXing"), panelName = "GeneralBigPopup_ShenYingShuXing"},
|
||||
--四灵试炼助战
|
||||
[GENERAL_POPUP_TYPE.FourElementHelpFight] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_FourElementHelpFight"), panelName = "GeneralBigPopup_FourElementHelpFight"},
|
||||
[GENERAL_POPUP_TYPE.WuJinShuXing] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_WuJinShuXing"), panelName = "GeneralBigPopup_WuJinShuXing"},
|
||||
[GENERAL_POPUP_TYPE.JinJieYuLan] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_JinJieYuLan"), panelName = "GeneralBigPopup_JinJieYuLan"},
|
||||
[GENERAL_POPUP_TYPE.ShenYingShuXing] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_ShenYingShuXing"), panelName = "GeneralBigPopup_ShenYingShuXing" },
|
||||
--四灵试炼助战
|
||||
[GENERAL_POPUP_TYPE.FourElementHelpFight] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_FourElementHelpFight"), panelName = "GeneralBigPopup_FourElementHelpFight" },
|
||||
[GENERAL_POPUP_TYPE.WuJinShuXing] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_WuJinShuXing"), panelName = "GeneralBigPopup_WuJinShuXing" },
|
||||
[GENERAL_POPUP_TYPE.JinJieYuLan] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_JinJieYuLan"), panelName = "GeneralBigPopup_JinJieYuLan" },
|
||||
--心愿抽卡
|
||||
[GENERAL_POPUP_TYPE.WishDraw] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_WishDraw"), panelName = "GeneralBigPopup_WishDraw"},
|
||||
[GENERAL_POPUP_TYPE.WishDraw] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_WishDraw"), panelName = "GeneralBigPopup_WishDraw" },
|
||||
--七界试炼遗物
|
||||
[GENERAL_POPUP_TYPE.QiJieTreasure] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_QiJieTreasure"), panelName = "GeneralBigPopup_QiJieTreasure"},
|
||||
[GENERAL_POPUP_TYPE.QiJieTreasure] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_QiJieTreasure"), panelName = "GeneralBigPopup_QiJieTreasure" },
|
||||
--寻宝迷踪奖励
|
||||
[GENERAL_POPUP_TYPE.XunBaoMiZong] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_XunBaoMiZong"), panelName = "GeneralBigPopup_XunBaoMiZong"},
|
||||
[GENERAL_POPUP_TYPE.XunBaoMiZong] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_XunBaoMiZong"), panelName = "GeneralBigPopup_XunBaoMiZong" },
|
||||
--神魂
|
||||
[GENERAL_POPUP_TYPE.ShenHun] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_RoleGodSoulUp"), panelName = "GeneralBigPopup_RoleGodSoulUp"},
|
||||
[GENERAL_POPUP_TYPE.ShenHun] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_RoleGodSoulUp"), panelName = "GeneralBigPopup_RoleGodSoulUp" },
|
||||
--御剑行竞猜
|
||||
[GENERAL_POPUP_TYPE.YuJianLastResult] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YuJianLastResult"), panelName = "GeneralBigPopup_YuJianLastResult"},
|
||||
[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"},
|
||||
[GENERAL_POPUP_TYPE.ShenHunShuXing] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_ShenhunDes"), panelName = "GeneralBigPopup_ShenhunDes"},
|
||||
[GENERAL_POPUP_TYPE.YuJianBet] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_YuJianBet"), panelName = "GeneralBigPopup_YuJianBet" },
|
||||
[GENERAL_POPUP_TYPE.ShenHunShuXing] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_ShenhunDes"), panelName = "GeneralBigPopup_ShenhunDes" },
|
||||
--灵脉秘境纪录
|
||||
[GENERAL_POPUP_TYPE.LingMaiRecord] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_LingMaiRecord"), panelName = "GeneralBigPopup_LingMaiRecord"},
|
||||
[GENERAL_POPUP_TYPE.IncarnationDes] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_IncarnationDes"), panelName = "GeneralBigPopup_IncarnationDes"},
|
||||
[GENERAL_POPUP_TYPE.IncarnationDes2] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_IncarnationDes2"), panelName = "GeneralBigPopup_IncarnationDes2"},
|
||||
[GENERAL_POPUP_TYPE.chooseTailsManSoul] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_WishTailsmanSoulChip"), panelName = "GeneralBigPopup_WishTailsmanSoulChip"},
|
||||
[GENERAL_POPUP_TYPE.LingMaiRecord] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_LingMaiRecord"), panelName = "GeneralBigPopup_LingMaiRecord" },
|
||||
[GENERAL_POPUP_TYPE.IncarnationDes] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_IncarnationDes"), panelName = "GeneralBigPopup_IncarnationDes" },
|
||||
[GENERAL_POPUP_TYPE.IncarnationDes2] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_IncarnationDes2"), panelName = "GeneralBigPopup_IncarnationDes2" },
|
||||
[GENERAL_POPUP_TYPE.chooseTailsManSoul] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_WishTailsmanSoulChip"), panelName = "GeneralBigPopup_WishTailsmanSoulChip" },
|
||||
--寻仙招募选择up英雄
|
||||
[GENERAL_POPUP_TYPE.ChooseUpHero] = {view = require("Modules/Popup/View/GeneralPopup_ChooseUpHero"), panelName = "GeneralBigPopup_ChooseUpHero"},
|
||||
[GENERAL_POPUP_TYPE.ChooseUpHero] = { view = require("Modules/Popup/View/GeneralPopup_ChooseUpHero"), panelName = "GeneralBigPopup_ChooseUpHero" },
|
||||
--命格选择命石
|
||||
[GENERAL_POPUP_TYPE.SelectGem] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_SelectGem"), panelName = "GeneralBigPopup_SelectGem"},
|
||||
[GENERAL_POPUP_TYPE.SelectGem] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_SelectGem"), panelName = "GeneralBigPopup_SelectGem" },
|
||||
--命石合成
|
||||
[GENERAL_POPUP_TYPE.GemCompound] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_GemCompound"), panelName = "GeneralBigPopup_GemCompound"},
|
||||
[GENERAL_POPUP_TYPE.GemCompound] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_GemCompound"), panelName = "GeneralBigPopup_GemCompound" },
|
||||
--神印
|
||||
[GENERAL_POPUP_TYPE.GodPrintUp ] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_GodPrintUp"), panelName = "GeneralBigPopup_GodPrintUp"},
|
||||
[GENERAL_POPUP_TYPE.GodPrintUp] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_GodPrintUp"), panelName = "GeneralBigPopup_GodPrintUp" },
|
||||
--选择心愿法宝
|
||||
[GENERAL_POPUP_TYPE.WishEquipDraw] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_WishEquipDraw"), panelName = "GeneralBigPopup_WishEquipDraw"},
|
||||
[GENERAL_POPUP_TYPE.WishEquipDraw] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_WishEquipDraw"), panelName = "GeneralBigPopup_WishEquipDraw" },
|
||||
--英雄热度排行榜
|
||||
[GENERAL_POPUP_TYPE.GiveLikeHotHero ] = {view = require("Modules/Popup/View/GeneralBigPopup_GiveLikeHotHero"), panelName = "GeneralBigPopup_GiveLikeHotHero"},
|
||||
|
||||
[GENERAL_POPUP_TYPE.GiveLikeHotHero] = { view = require("Modules/Popup/View/GeneralBigPopup_GiveLikeHotHero"), panelName = "GeneralBigPopup_GiveLikeHotHero" },
|
||||
--选择心愿法宝巨灵
|
||||
[GENERAL_POPUP_TYPE.WishJulingDraw] = { view = require("Modules/GeneralPanel/View/GeneralBigPopup_WishJulingDraw"), panelName = "GeneralBigPopup_WishJulingDraw" },
|
||||
|
||||
}
|
||||
--子模块预设
|
||||
local contentPrefabs={}
|
||||
local contentPrefabs = {}
|
||||
--打开弹窗类型
|
||||
local popupType
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
function GeneralBigPopup:InitComponent()
|
||||
this.spLoader = SpriteLoader.New()
|
||||
this.contents=Util.GetGameObject(this.gameObject,"Contents")
|
||||
this.backBtn=Util.GetGameObject(this.contents,"BG/BackBtn")
|
||||
this.backBtn2=Util.GetGameObject(this.contents,"BG2/BackBtn")
|
||||
this.BG=Util.GetGameObject(this.contents,"BG")
|
||||
this.BG2=Util.GetGameObject(this.contents,"BG2")
|
||||
this.Mask=Util.GetGameObject(this.gameObject,"Mask")
|
||||
this.contents = Util.GetGameObject(this.gameObject, "Contents")
|
||||
this.backBtn = Util.GetGameObject(this.contents, "BG/BackBtn")
|
||||
this.backBtn2 = Util.GetGameObject(this.contents, "BG2/BackBtn")
|
||||
this.BG = Util.GetGameObject(this.contents, "BG")
|
||||
this.BG2 = Util.GetGameObject(this.contents, "BG2")
|
||||
this.Mask = Util.GetGameObject(this.gameObject, "Mask")
|
||||
this.BG:SetActive(true)
|
||||
this.Mask:SetActive(true)
|
||||
--子模块脚本初始化
|
||||
|
|
@ -76,7 +78,7 @@ function GeneralBigPopup:InitComponent()
|
|||
end
|
||||
--预设赋值
|
||||
for key, value in pairs(contentScripts) do
|
||||
contentPrefabs[key]=Util.GetGameObject(this.contents,value.panelName)
|
||||
contentPrefabs[key] = Util.GetGameObject(this.contents, value.panelName)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -85,16 +87,16 @@ function GeneralBigPopup:BindEvent()
|
|||
for key, value in pairs(contentScripts) do
|
||||
value.view:BindEvent()
|
||||
end
|
||||
--返回按钮
|
||||
Util.AddClick(this.backBtn,function()
|
||||
--返回按钮
|
||||
Util.AddClick(this.backBtn, function()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged)
|
||||
self:ClosePanel()
|
||||
end)
|
||||
Util.AddClick(this.backBtn2,function()
|
||||
Util.AddClick(this.backBtn2, function()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged)
|
||||
self:ClosePanel()
|
||||
end)
|
||||
Util.AddClick(this.Mask,function()
|
||||
Util.AddClick(this.Mask, function()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged)
|
||||
self:ClosePanel()
|
||||
end)
|
||||
|
|
@ -115,9 +117,10 @@ end
|
|||
function GeneralBigPopup:OnSortingOrderChange()
|
||||
this.sortingOrder = self.sortingOrder
|
||||
end
|
||||
local onOpenArgs--临时接的参数 需要onshow刷新的调用
|
||||
function GeneralBigPopup:OnOpen(popupKey,...)
|
||||
onOpenArgs = {...}
|
||||
|
||||
local onOpenArgs --临时接的参数 需要onshow刷新的调用
|
||||
function GeneralBigPopup:OnOpen(popupKey, ...)
|
||||
onOpenArgs = { ... }
|
||||
for key, value in pairs(contentPrefabs) do
|
||||
value.gameObject:SetActive(false)
|
||||
end
|
||||
|
|
@ -125,12 +128,12 @@ function GeneralBigPopup:OnOpen(popupKey,...)
|
|||
this.BG:SetActive(popupKey ~= GENERAL_POPUP_TYPE.Onhook)
|
||||
this.BG2:SetActive(popupKey == GENERAL_POPUP_TYPE.GiveLikeHotHero)
|
||||
this.popupKey = popupKey
|
||||
contentScripts[this.popupKey].view:OnShow(this,onOpenArgs)--1、传入自己 2、传入不定参
|
||||
contentScripts[this.popupKey].view:OnShow(this, onOpenArgs) --1、传入自己 2、传入不定参
|
||||
end
|
||||
|
||||
function GeneralBigPopup:OnShow()
|
||||
contentPrefabs[this.popupKey].gameObject:SetActive(true)
|
||||
contentScripts[this.popupKey].view:OnShow(this,onOpenArgs)--1、传入自己 2、传入不定参
|
||||
contentScripts[this.popupKey].view:OnShow(this, onOpenArgs) --1、传入自己 2、传入不定参
|
||||
end
|
||||
|
||||
function GeneralBigPopup:OnClose()
|
||||
|
|
@ -146,4 +149,4 @@ function GeneralBigPopup:OnDestroy()
|
|||
end
|
||||
end
|
||||
|
||||
return GeneralBigPopup
|
||||
return GeneralBigPopup
|
||||
|
|
|
|||
|
|
@ -0,0 +1,239 @@
|
|||
----- 心愿抽卡弹窗 -----
|
||||
local this = {}
|
||||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
|
||||
local specialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig)
|
||||
|
||||
function this:InitComponent(gameObject)
|
||||
self.spLoader = SpriteLoader.New()
|
||||
self.okBtn = Util.GetGameObject(gameObject, "okBtn")
|
||||
self.helpBtn = Util.GetGameObject(gameObject, "helpBtn")
|
||||
self.scroll = Util.GetGameObject(gameObject, "selectList")
|
||||
self.itemPre = Util.GetGameObject(gameObject, "itemPre")
|
||||
-- 设置循环滚动,万一内容不停地加
|
||||
local rootHight = self.scroll.transform.rect.height
|
||||
local width = self.scroll.transform.rect.width
|
||||
self.infoTxt = Util.GetGameObject(gameObject, "Bg/tiao1/Text (1)"):GetComponent("Text")
|
||||
self.scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.scroll.transform,
|
||||
self.itemPre, nil, Vector2.New(width, rootHight), 1, 5, Vector2.New(20, 60))
|
||||
self.scrollView.moveTween.MomentumAmount = 1
|
||||
self.scrollView.moveTween.Strength = 2
|
||||
|
||||
self.itemList = {}
|
||||
self.maskList = {}
|
||||
--wishList
|
||||
self.wishListObj = {}
|
||||
self.bgObjlist = {}
|
||||
for i = 1, 3 do
|
||||
self.wishListObj[i] = Util.GetGameObject(gameObject, "wishList/hero (" .. i .. ")")
|
||||
self.bgObjlist[i] = Util.GetGameObject(gameObject, "Bg/bglist/obj" .. i)
|
||||
Util.GetGameObject(self.bgObjlist[i], "frame"):GetComponent("Image").sprite = self.spLoader:LoadSprite(
|
||||
"r_characterbg_goden")
|
||||
--心愿神将现在只显示一个
|
||||
if i > 1 then
|
||||
self.wishListObj[i]:SetActive(false)
|
||||
self.bgObjlist[i]:SetActive(false)
|
||||
else
|
||||
self.wishListObj[i]:SetActive(true)
|
||||
self.bgObjlist[i]:SetActive(true)
|
||||
end
|
||||
end
|
||||
--tabList
|
||||
self.tabListObj = {}
|
||||
self.selectBtn = Util.GetGameObject(gameObject, "Tabs/grid/selectBtn")
|
||||
for j = 1, 4 do
|
||||
self.maskList[j] = {}
|
||||
self.itemList[j] = {}
|
||||
self.tabListObj[j] = Util.GetGameObject(gameObject, "Tabs/grid/Btn" .. j)
|
||||
end
|
||||
Util.GetGameObject(gameObject, "Tabs"):SetActive(false)
|
||||
|
||||
self.helpPosition = self.helpBtn:GetComponent("RectTransform").localPosition
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
for i = 1, 4 do
|
||||
Util.AddOnceClick(self.tabListObj[i], function()
|
||||
self.curSelect = i
|
||||
this:Refresh(true, false)
|
||||
end)
|
||||
end
|
||||
for i = 1, 3 do
|
||||
Util.AddOnceClick(self.bgObjlist[i], function()
|
||||
--心愿只能选一个神将
|
||||
if i > 1 then
|
||||
return
|
||||
end
|
||||
self.curSelect = RecruitManager.CheckIndex()
|
||||
this:Refresh(true, false)
|
||||
end)
|
||||
end
|
||||
|
||||
Util.AddOnceClick(self.okBtn, function()
|
||||
LogError("点击确定按钮")
|
||||
self.parent:ClosePanel()
|
||||
end)
|
||||
|
||||
--帮助按钮
|
||||
Util.AddClick(self.helpBtn, function()
|
||||
LogError("点击帮助按钮")
|
||||
UIManager.OpenPanel(UIName.HelpPopup, HELP_TYPE.WishCard, self.helpPosition.x, self.helpPosition.y)
|
||||
end)
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
end
|
||||
|
||||
function this:OnShow(_parent, _Data)
|
||||
self.parent = _parent
|
||||
self.sortingOrder = _parent.sortingOrder
|
||||
local args = _Data
|
||||
--NetManager.ChoiceWishHeroRequest(nil,function ()
|
||||
if args[1] then
|
||||
self.curSelect = args[1]
|
||||
else
|
||||
self.curSelect = 1 -- RecruitManager.CheckIndex()
|
||||
end
|
||||
this:Refresh(true, false)
|
||||
--end)
|
||||
end
|
||||
|
||||
function this:Refresh(isTop, isAni)
|
||||
local data = tonumber(specialConfig[119].Value)
|
||||
if not RecruitManager.drawTimes[4] or RecruitManager.drawTimes[4] < data then
|
||||
self.parent:ClosePanel()
|
||||
return
|
||||
end
|
||||
local aaa = string.format(Language[11085], RecruitManager.GetWishPro(), "%")
|
||||
self.infoTxt.text = aaa
|
||||
self.selectBtn:SetActive(false)
|
||||
--self.selectBtn:GetComponent("RectTransform").localPosition = self.tabListObj[self.curSelect]:GetComponent("RectTransform").localPosition
|
||||
this:SetHeroList(isTop, isAni)
|
||||
this:SetUpHero()
|
||||
end
|
||||
|
||||
function this:SetUpHero()
|
||||
for i = 1, 1 do
|
||||
local go = self.wishListObj[i]
|
||||
|
||||
local frame = Util.GetGameObject(go, "frame"):GetComponent("Image")
|
||||
local icon = Util.GetGameObject(go, "icon"):GetComponent("Image")
|
||||
local proIcon = Util.GetGameObject(go, "proIcon"):GetComponent("Image")
|
||||
local starGrid = Util.GetGameObject(go, "star")
|
||||
local choosed = Util.GetGameObject(go, "choosed")
|
||||
local heroId = 0
|
||||
if RecruitManager.WishEquipData[i] then
|
||||
heroId = RecruitManager.WishEquipData[i].heroTid
|
||||
end
|
||||
choosed:SetActive(false)
|
||||
if heroId > 0 then
|
||||
go:SetActive(true)
|
||||
local heroData = itemConfig[heroId]
|
||||
frame.sprite = self.spLoader:LoadSprite(GetBgByHeroNatural(heroData.Quantity))
|
||||
icon.sprite = self.spLoader:LoadSprite(GetResourcePath(heroData.ResourceID))
|
||||
proIcon.gameObject:SetActive(false)
|
||||
--proIcon.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(heroData.Name))
|
||||
--SetHeroStars(self.spLoader,starGrid, heroData.Star)
|
||||
choosed:SetActive(RecruitManager.WishEquipData[i].status == 1)
|
||||
Util.AddOnceClick(go, function()
|
||||
if RecruitManager.WishEquipData[i].status == 1 then
|
||||
PopupTipPanel.ShowTip(Language[11082])
|
||||
elseif RecruitManager.WishEquipData[i].status == 0 then
|
||||
RecruitManager.ChangeEquip(2, heroId, function()
|
||||
this:Refresh(false, false)
|
||||
end) --英雄变更:1增加、2卸下
|
||||
end
|
||||
end)
|
||||
else
|
||||
go:SetActive(false)
|
||||
end
|
||||
LogError("i===================" .. i)
|
||||
if i > 1 then
|
||||
self.wishListObj[i]:SetActive(false)
|
||||
LogError("false false")
|
||||
end
|
||||
Util.AddLongPressClick(go, function()
|
||||
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, heroId, 5)
|
||||
end, 0.5)
|
||||
end
|
||||
end
|
||||
|
||||
function this:SetHeroList(isTop, isAni)
|
||||
local heroList = RecruitManager.allTailsMans --RecruitManager.GetCurHeroTalismanaList(0)
|
||||
self.scrollView:SetData(heroList, function(index, item)
|
||||
this:ShowSingleHero(item, heroList[index], index)
|
||||
end, not isTop, not isAni)
|
||||
end
|
||||
|
||||
function this:ShowSingleHero(go, data, index)
|
||||
local equipId = data
|
||||
local heroData = itemConfig[equipId]
|
||||
self.itemList[self.curSelect][index] = go
|
||||
Util.GetGameObject(go, "frame"):GetComponent("Image").sprite = self.spLoader:LoadSprite(GetBgByHeroNatural(heroData
|
||||
.Quantity))
|
||||
Util.GetGameObject(go, "icon"):GetComponent("Image").sprite = self.spLoader:LoadSprite(GetResourcePath(heroData
|
||||
.ResourceID))
|
||||
--Util.GetGameObject(go, "proIcon"):GetComponent("Image").sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(heroData.PropertyName))
|
||||
Util.GetGameObject(go, "proIcon"):SetActive(false)
|
||||
Util.GetGameObject(go, "name"):GetComponent("Text").text = GetLanguageStrById(heroData.Name)
|
||||
Util.GetGameObject(go, "heroName"):GetComponent("Text").text = GetLanguageStrById(itemConfig[data].Name)
|
||||
Util.GetGameObject(go, "name").gameObject:SetActive(false)
|
||||
local starGrid = Util.GetGameObject(go, "star")
|
||||
-- SetHeroStars(self.spLoader,starGrid, heroData.Star)
|
||||
self.maskList[self.curSelect][index] = Util.GetGameObject(go, "choosed")
|
||||
self.maskList[self.curSelect][index]:SetActive(false)
|
||||
Util.SetGray(self.itemList[self.curSelect][index], false)
|
||||
|
||||
local value = RecruitManager.CheckCurTalismanaState(equipId)
|
||||
LogError("value===========================================" .. value)
|
||||
if value == 0 then --上方存在相同阵营
|
||||
Util.SetGray(self.itemList[self.curSelect][index], true)
|
||||
Util.AddOnceClick(go, function()
|
||||
--PopupTipPanel.ShowTip("同系法宝只可选择一位~")
|
||||
PopupTipPanel.ShowTip(Language[11086])
|
||||
end)
|
||||
elseif value == 2 then --上方选满
|
||||
Util.SetGray(self.itemList[self.curSelect][index], true)
|
||||
Util.AddOnceClick(go, function()
|
||||
PopupTipPanel.ShowTip(Language[11086])
|
||||
end)
|
||||
elseif value == 1 then --上方存在自己
|
||||
self.maskList[self.curSelect][index]:SetActive(true)
|
||||
Util.AddOnceClick(go, function()
|
||||
RecruitManager.ChangeEquip(2, equipId, function()
|
||||
this:Refresh(false, false)
|
||||
end) --英雄变更:1增加、2卸下
|
||||
end)
|
||||
elseif value == 4 then --上方存在自己,但已经出过该英雄了
|
||||
self.maskList[self.curSelect][index]:SetActive(true)
|
||||
Util.AddOnceClick(go, function()
|
||||
PopupTipPanel.ShowTip(Language[11082])
|
||||
end)
|
||||
elseif value == 3 then --可选
|
||||
Util.AddOnceClick(go, function()
|
||||
RecruitManager.ChangeEquip(1, equipId, function()
|
||||
this:Refresh(false, false)
|
||||
end) --英雄变更:1增加、2卸下
|
||||
end)
|
||||
end
|
||||
Util.AddLongPressClick(go, function()
|
||||
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup, heroData.Id)
|
||||
--UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, data, 5)
|
||||
end, 0.5)
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
self.itemList = {}
|
||||
self.maskList = {}
|
||||
self.wishListObj = {}
|
||||
self.tabListObj = {}
|
||||
self.spLoader:Destroy()
|
||||
end
|
||||
|
||||
return this
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 106ee367223a7ed4895ea36074aed017
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -756,6 +756,9 @@ local jumpDic = {
|
|||
[20015] = function(data)
|
||||
this.JumpActivity(20015, data[1])
|
||||
end,
|
||||
[20019] = function(data)
|
||||
this.JumpActivity(20019, data[1])
|
||||
end,
|
||||
[JumpType.LingShouTehui] = function(data) --零售特惠
|
||||
this.JumpActivity(JumpType.LingShouTehui, data[1])
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -101,13 +101,24 @@ end
|
|||
|
||||
function RecruitEquipPanelNew:BindEvent()
|
||||
Util.AddOnceClick(self.lsth, function()
|
||||
local isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
|
||||
local tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
|
||||
local isOpen
|
||||
local tip
|
||||
if self.config.ShopData[1][1] == 4 then
|
||||
isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
|
||||
tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
|
||||
else
|
||||
isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.Fabaojulingxinyuan)
|
||||
tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.Fabaojulingxinyuan)
|
||||
end
|
||||
if isOpen == false then
|
||||
PopupTipPanel.ShowTip(tip)
|
||||
return
|
||||
end
|
||||
JumpManager.GoJump(40082)
|
||||
if self.config.ShopData[1][1] == 4 then
|
||||
JumpManager.GoJump(40082)
|
||||
else
|
||||
JumpManager.GoJump(40089)
|
||||
end
|
||||
end)
|
||||
--帮助按钮
|
||||
Util.AddClick(self.helpBtn, function()
|
||||
|
|
@ -273,7 +284,11 @@ function RecruitEquipPanelNew:UpdataWishPanel()
|
|||
if RecruitManager.drawTimes[self.config.ShopData[1][1]] then
|
||||
RecruitManager.curWishType = self.config.ShopData[1][1]
|
||||
if RecruitManager.drawTimes[self.config.ShopData[1][1]] >= tempdata then
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup, GENERAL_POPUP_TYPE.WishEquipDraw)
|
||||
if self.config.ShopData[1][1] == 4 then
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup, GENERAL_POPUP_TYPE.WishEquipDraw)
|
||||
else
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup, GENERAL_POPUP_TYPE.WishJulingDraw)
|
||||
end
|
||||
else
|
||||
PopupTipPanel.ShowTip(string.format(Language[12583],
|
||||
tempdata - RecruitManager.drawTimes[self.config.ShopData[1][1]]))
|
||||
|
|
@ -307,10 +322,10 @@ function RecruitEquipPanelNew:UpdataWishPanel()
|
|||
-- self.tenTipText.text = "<color=#FFB83B><size=30>每次十连</size><color=#FEDA90><size=30>必得</size></color></color><color=#FFB83B><size=30>五星</size></color><color=#FEDA90><size=30>神将法宝</size></color>"
|
||||
-- else
|
||||
if self.config.ShopData[1][1] == 4 then
|
||||
self.tenTipText.gameObject:SetActive(false)
|
||||
self.tenTip:SetActive(true)
|
||||
self.tenTipText.text = string.format(Language[12584], RecruitManager.GetRecruit2MustCount())
|
||||
else
|
||||
self.tenTipText.gameObject:SetActive(true)
|
||||
self.tenTip:SetActive(false)
|
||||
self.tenTipText.text = string.format(Language[12584], RecruitManager.GetRecruit2MustCount())
|
||||
end
|
||||
|
||||
|
|
@ -424,8 +439,15 @@ function RecruitEquipPanelNew:UpdatePanelData()
|
|||
end
|
||||
|
||||
Util.AddOnceClick(m.btn, function()
|
||||
local isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
|
||||
local tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
|
||||
local isOpen
|
||||
local tip
|
||||
if self.config.ShopData[1][1] == 4 then
|
||||
isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
|
||||
tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
|
||||
else
|
||||
isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.Fabaojulingxinyuan)
|
||||
tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.Fabaojulingxinyuan)
|
||||
end
|
||||
if isOpen == false then
|
||||
PopupTipPanel.ShowTip(tip)
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in New Issue