722 lines
34 KiB
Lua
722 lines
34 KiB
Lua
require("Base/BasePanel")
|
|
ExpertPanel = Inherit(BasePanel)
|
|
local this = ExpertPanel
|
|
local activeIndext = 0
|
|
local imageSprite = {
|
|
[1] = {"r_huodong_qirianniu_zh", "r_huodong_qirianniu_01_zh"},
|
|
[2] = {"s_sbtj_anniu_2_zh", "s_sbtj_anniu_1_zh"},
|
|
[3] = {"t_tsec_anniu_02_zh", "t_tsec_anniu_01_zh"},
|
|
[4] = {"r_zhouka_zhoukaanniu_01_zh", "r_zhouka_zhoukaanniu_zh"},
|
|
[5] = {"r_daren_fxgz_02_zh", "r_daren_fxgz_zh"},
|
|
[6] = {"x_xytb_icon_02_zh", "x_xytb_icon_01_zh"},
|
|
[7] = {"r_huodong_leijichengzhianniu_01_zh", "r_huodong_leijichengzhianniu_zh"},
|
|
[8] = {"r_xianshiduihuan_anniu_01_zh", "r_xianshiduihuan_anniu_zh"},
|
|
[9] = {"r_daren_jinjieanniu_01_zh", "r_daren_jinjieanniu_zh"},
|
|
[10] = {"x_xianshihuodong_jishudarenicon2_zh", "x_xianshihuodong_jishudarenicon1_zh"},
|
|
[11] = {"r_daren_jingjianniu_01_zh", "r_daren_jingjianniu_zh"},
|
|
[12] = {"r_daren_zhuangbeianniu_01_zh", "r_daren_zhuangbeianniu_zh"},
|
|
[13] = {"r_daren_dianjinanniu_01_zh", "r_daren_dianjinanniu_zh"},
|
|
[14] = {"r_daren_fubenanniu_01_zh", "r_daren_fubenanniu_zh"},
|
|
[15] = {"r_daren_tilianniu_01_zh", "r_daren_tilianniu_zh"},
|
|
[16] = {"r_daren_fabaoanniu_01_zh", "r_daren_fabaoanniu_zh"},
|
|
[17] = {"r_daren_hunyinanniu_01_zh", "r_daren_hunyinanniu_zh"},
|
|
[18] = {"r_xingjichengzhangli_anniu02_zh", "r_xingjichengzhangli_anniu01_zh"},
|
|
[19] = {"r_daren_xunbaoanniu_01_zh", "r_daren_xunbaoanniu_zh"},
|
|
[20] = {"r_daren_tanbaoaniu_01_zh", "r_daren_tanbaoaniu_zh"},
|
|
[21] = {"r_daren_zhengmuanniu_01_zh", "r_daren_zhengmuanniu_zh"},
|
|
[22] = {"r_daren_mibaoanniu_01_zh", "r_daren_mibaoanniu_zh"},
|
|
[23] = {"r_huodong_shengji_02_zh", "r_huodong_shengji_01_zh"},
|
|
[24] = {"r_jitianhaoli_anniu_01_zh", "r_jitianhaoli_anniu_zh"},
|
|
[25] = {"l_lbqg_icon2_zh", "l_lbqg_icon1_zh"},
|
|
[26] = {"g_gonghui_anniu_02_zh", "g_gonghui_anniu_01_zh"},
|
|
[27] = {"s_senluohuanjing_icon2_zh", "s_senluohuanjing_icon1_zh"},
|
|
}
|
|
|
|
local allActivityNum = #imageSprite
|
|
local tabBtns = {}
|
|
local expertRedPointGrid = {}--红点
|
|
--local LuckyTurn = require("Modules/LuckyTurnTable/LuckyTurnTablePanel")
|
|
-- local SevenDayGift = require("Modules/ActivityGift/View/SevenDayGift")
|
|
-- local LuckyCat = require("Modules/LuckyCat/View/LuckyCat")
|
|
-- local WeekCard = require("Modules/Expert/WeekCard")
|
|
-- local PatFace = require("Modules/Expert/PatFace")
|
|
-- local DiffMonsterBuy = require("Modules/Expert/DiffMonsterBuy")
|
|
local ExChange = require("Modules/Expert/ExChange")--4
|
|
local Expert = require("Modules/Expert/Expert")--1
|
|
-- local HeHeHe = require("Modules/Expert/HeroStarFeedPage")
|
|
local Expert_UpLv = require("Modules/Expert/Expert_UpLv")--2
|
|
local ContinuityRechargePage = require("Modules/Operating/ContinuityRechargePage") --积天豪礼3
|
|
--local GiftBuy = require("Modules/Expert/GiftBuy") --限时抢购
|
|
|
|
local diffMonsterBuyData = {}--异妖直购数据
|
|
local rechargeCommodityConfig
|
|
local GlobalActivityConfig = ConfigManager.GetConfig(ConfigName.GlobalActivity)
|
|
|
|
|
|
local cursortingOrder
|
|
this.isPlayingLackCatAni = false--招财猫动画是否播放完毕
|
|
--初始化组件(用于子类重写)
|
|
function ExpertPanel:InitComponent()
|
|
this.spLoader = SpriteLoader.New()
|
|
|
|
cursortingOrder = 0
|
|
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft })
|
|
self.btnBack = Util.GetGameObject(self.gameObject, "tabs/btnBack")
|
|
self.mask=Util.GetGameObject(self.gameObject,"Mask")
|
|
self.selectBtn = Util.GetGameObject(self.gameObject, "tabs/rect/grid/selectBtn")
|
|
for i = 1, allActivityNum do
|
|
tabBtns[i] = Util.GetGameObject(self.gameObject, "tabs/rect/grid/Btn (" .. i .. ")")
|
|
tabBtns[i]:GetComponent("Image").sprite = this.spLoader:LoadSprite(imageSprite[i][1])
|
|
tabBtns[i]:GetComponent("Image"):SetNativeSize()
|
|
expertRedPointGrid[i] = Util.GetGameObject(tabBtns[i], "redPoint")
|
|
expertRedPointGrid[i]:SetActive(false)
|
|
end
|
|
self.endBtnGrid = Util.GetGameObject(self.gameObject, "tabs/rect/grid")
|
|
--各种限时活动注册
|
|
--this.luckyTurn = LuckyTurn.new(self, Util.GetGameObject(self.transform, "downLayout/LuckyTurnTablePanel"))
|
|
-- this.sevenDayPanel = SevenDayGift.new(self, Util.GetGameObject(self.transform, "downLayout/CourtesyDressPanel"))
|
|
this.luckyCatPanel = LuckyCat.new(self, Util.GetGameObject(self.transform, "downLayout/LuckyCatPanel"))
|
|
this.weekCard = WeekCard.new(self, Util.GetGameObject(self.transform, "downLayout/WeekCardGrid"))
|
|
this.patFace = PatFace.new(self, Util.GetGameObject(self.transform, "downLayout/patFaceGrid"))
|
|
this.diffMonsterBuy = DiffMonsterBuy.new(self, Util.GetGameObject(self.transform, "downLayout/DiffMonsterBuy"))
|
|
this.exChange = ExChange.new(self, Util.GetGameObject(self.transform, "downLayout/exChangeGrid"))
|
|
this.expert = Expert.new(self, Util.GetGameObject(self.transform, "downLayout/expertRewardGrid"))
|
|
-- this.heroStarGift = HeHeHe:New(self, Util.GetGameObject(self.transform, "downLayout/GrowShitGiftPage"))
|
|
this.upLvRewardGrid = Expert_UpLv.new(self, Util.GetGameObject(self.transform, "downLayout/UpLvRewardGrid"))
|
|
this.continuityRechargePage = ContinuityRechargePage.new(self, Util.GetGameObject(self.transform, "downLayout/ContinuityRecharge"))
|
|
--this.giftBuy = GiftBuy.new(self, Util.GetGameObject(self.transform, "downLayout/GiftBuy"))
|
|
|
|
--this.luckyTurnTablePanel = Util.GetGameObject(this.gameObject, "downLayout/LuckyTurnTablePanel")
|
|
this.CourtesyDressPanel = Util.GetGameObject(this.gameObject, "downLayout/CourtesyDressPanel")
|
|
this.luckyCatPanelShow = Util.GetGameObject(this.gameObject, "downLayout/LuckyCatPanel")
|
|
this.weekCardPanel = Util.GetGameObject(this.gameObject, "downLayout/WeekCardGrid")
|
|
this.patFacePanel = Util.GetGameObject(this.gameObject, "downLayout/patFaceGrid")
|
|
this.diffMonsterBuyPanel = Util.GetGameObject(this.gameObject, "downLayout/DiffMonsterBuy")
|
|
this.exChangePanel = Util.GetGameObject(this.gameObject, "downLayout/exChangeGrid")
|
|
this.expertRewardGridPanel = Util.GetGameObject(this.gameObject, "downLayout/expertRewardGrid")
|
|
--this.giftBuyPanel = Util.GetGameObject(this.gameObject, "downLayout/GiftBuy")
|
|
self.luckyCatAnimator = Util.GetGameObject(self.transform, "downLayout/LuckyCatPanel"):GetComponent("Animator")
|
|
self.effext1 = Util.GetGameObject(self.transform, "downLayout/patFaceGrid/UI_effect_PatFacePanel_obg1_normal_particle")
|
|
self.effext2 = Util.GetGameObject(self.transform, "downLayout/DiffMonsterBuy/UI_effect_PatFacePanel_obg2_normal_particle")
|
|
self.effext3 = Util.GetGameObject(self.transform, "downLayout/LuckyCatPanel/UI_effect_LuckyCatPanel_normal")
|
|
self.effext4 = Util.GetGameObject(self.transform, "downLayout/LuckyCatPanel/UI_effect_LuckyCatPanel_start")
|
|
self.leijichongzhiEffect = Util.GetGameObject(self.transform, "downLayout/expertRewardGrid/effect/leijichongzhiEffect")
|
|
end
|
|
|
|
--绑定事件(用于子类重写)
|
|
function ExpertPanel:BindEvent()
|
|
-- this.heroStarGift:BindEvent()
|
|
this.upLvRewardGrid:BindEvent()
|
|
Util.AddClick(self.btnBack, function()
|
|
--self:ClosePanel()
|
|
if this.isPlayingLackCatAni == false then
|
|
-- UIManager.OpenPanel(UIName.MainPanel)
|
|
self:ClosePanel()
|
|
end
|
|
end)
|
|
for i = 1, allActivityNum do
|
|
Util.AddClick(tabBtns[i], function()
|
|
if this.isPlayingLackCatAni == false then
|
|
self:ActivityRewardShow(i,true)
|
|
end
|
|
end)
|
|
end
|
|
-- BindRedPointObject(RedPointType.CourtesyDress_SevenDay, expertRedPointGrid[1])
|
|
BindRedPointObject(RedPointType.Expert_WeekCard, expertRedPointGrid[4])
|
|
BindRedPointObject(RedPointType.LuckyCat, expertRedPointGrid[5])
|
|
--BindRedPointObject(RedPointType.Expert_LuckyTurn, expertRedPointGrid[6])
|
|
BindRedPointObject(RedPointType.Expert_AccumulativeRecharge, expertRedPointGrid[7])
|
|
BindRedPointObject(RedPointType.Expert_LimitExchange, expertRedPointGrid[8])
|
|
BindRedPointObject(RedPointType.Expert_UpStarExper, expertRedPointGrid[9])
|
|
BindRedPointObject(RedPointType.Expert_FastExplore, expertRedPointGrid[10])
|
|
BindRedPointObject(RedPointType.Expert_AreaExper, expertRedPointGrid[11])
|
|
BindRedPointObject(RedPointType.Expert_EquipExper, expertRedPointGrid[12])
|
|
BindRedPointObject(RedPointType.Expert_GoldExper, expertRedPointGrid[13])
|
|
BindRedPointObject(RedPointType.Expert_FightExper, expertRedPointGrid[14])
|
|
BindRedPointObject(RedPointType.Expert_EnergyExper, expertRedPointGrid[15])
|
|
BindRedPointObject(RedPointType.Expert_Talisman, expertRedPointGrid[16])
|
|
BindRedPointObject(RedPointType.Expert_SoulPrint, expertRedPointGrid[17])
|
|
BindRedPointObject(RedPointType.HERO_STAR_GIFT, expertRedPointGrid[18])
|
|
BindRedPointObject(RedPointType.Expert_FindTreasure, expertRedPointGrid[19])
|
|
BindRedPointObject(RedPointType.Expert_LuckyTurn, expertRedPointGrid[20])
|
|
BindRedPointObject(RedPointType.Expert_Recruit, expertRedPointGrid[21])
|
|
BindRedPointObject(RedPointType.Expert_SecretBox, expertRedPointGrid[22])
|
|
BindRedPointObject(RedPointType.Expert_UpLv, expertRedPointGrid[23])
|
|
BindRedPointObject(RedPointType.ContinuityRecharge, expertRedPointGrid[24])
|
|
BindRedPointObject(RedPointType.Expert_Expedition, expertRedPointGrid[26])
|
|
BindRedPointObject(RedPointType.Expert_Slhj, expertRedPointGrid[27])
|
|
|
|
|
|
end
|
|
|
|
--添加事件监听(用于子类重写)
|
|
function ExpertPanel:AddListener()
|
|
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose, self.RefreshActivityBtn, self)
|
|
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityProgressStateChange, self.RefreshActivityProgress, self)
|
|
Game.GlobalEvent:AddEvent(GameEvent.FiveAMRefresh.ServerNotifyRefresh, self.RefreshActivityProgress, self)
|
|
Game.GlobalEvent:AddEvent(GameEvent.MoneyPay.OnPayResultSuccess, self.RechargeSuccessFunc, self)
|
|
Game.GlobalEvent:AddEvent(GameEvent.PatFace.PatFaceHaveGrowGift, self.FreshGiftState, self)
|
|
--this.luckyTurn.AddListener()
|
|
-- this.sevenDayPanel.AddListener()
|
|
this.luckyCatPanel.AddListener()
|
|
-- this.heroStarGift:AddListener()
|
|
this.upLvRewardGrid:AddListener()
|
|
end
|
|
|
|
--移除事件监听(用于子类重写)
|
|
function ExpertPanel:RemoveListener()
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, self.RefreshActivityBtn, self)
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityProgressStateChange, self.RefreshActivityProgress, self)
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.FiveAMRefresh.ServerNotifyRefresh, self.RefreshActivityProgress, self)
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess, self.RechargeSuccessFunc, self)
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.PatFace.PatFaceHaveGrowGift, self.FreshGiftState, self)
|
|
--this.luckyTurn.RemoveListener()
|
|
-- this.sevenDayPanel.RemoveListener()
|
|
this.luckyCatPanel.RemoveListener()
|
|
-- this.heroStarGift:RemoveListener()
|
|
this.upLvRewardGrid:RemoveListener()
|
|
end
|
|
local defaultIndex = 0
|
|
local TreasureTypeVal = nil
|
|
--界面打开时调用(用于子类重写)
|
|
function ExpertPanel:OnOpen(_defaultIndex, _TreasureType)
|
|
this.isPlayingLackCatAni = false
|
|
defaultIndex = 0
|
|
if _defaultIndex then
|
|
defaultIndex = _defaultIndex
|
|
end
|
|
TreasureTypeVal = nil
|
|
if _TreasureType then
|
|
TreasureTypeVal = _TreasureType
|
|
end
|
|
if UIManager.IsOpen(UIName.RoleInfoPanel) then
|
|
UIManager.ClosePanel(UIName.RoleInfoPanel)
|
|
end
|
|
end
|
|
|
|
function ExpertPanel:FreshGiftState()
|
|
-- tabBtns[18]:SetActive(OperatingManager.IsHeroGiftActive())
|
|
tabBtns[18]:SetActive(false)
|
|
end
|
|
|
|
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
|
function ExpertPanel:OnShow()
|
|
-- --LogGreen("defaultIndex 1 "..defaultIndex)
|
|
if defaultIndex > 0 then
|
|
self:SetOpenActiveBtn()
|
|
else
|
|
defaultIndex = self:SetOpenActiveBtn()
|
|
|
|
-- --LogGreen("defaultIndex 2 "..defaultIndex)
|
|
defaultIndex = self:GetPriorityIndex(defaultIndex)
|
|
|
|
-- --LogGreen("defaultIndex 3 "..defaultIndex)
|
|
end
|
|
self:RefreshActivityShow()
|
|
if defaultIndex > 0 then
|
|
self:ActivityRewardShow(defaultIndex,true)
|
|
else
|
|
PopupTipPanel.ShowTip(Language[10575])
|
|
end
|
|
self:BtnGridMovePos()
|
|
end
|
|
function ExpertPanel:BtnGridMovePos()
|
|
local activeBtnNum = 0
|
|
local movedefaultIndex = 0
|
|
for idx, operateItem in ipairs(tabBtns) do
|
|
if operateItem.activeSelf then
|
|
activeBtnNum = activeBtnNum + 1
|
|
end
|
|
if defaultIndex == idx then
|
|
movedefaultIndex = activeBtnNum
|
|
end
|
|
end
|
|
if movedefaultIndex - 5 > 0 and activeBtnNum > 5 then
|
|
self.endBtnGrid.transform.localPosition = self.endBtnGrid.transform.localPosition +Vector3.New(-(movedefaultIndex - 5)*184-50,0,0)
|
|
end
|
|
end
|
|
function ExpertPanel:OnSortingOrderChange()
|
|
-- this.heroStarGift:OnSortingOrderChange(self.sortingOrder)
|
|
this.upLvRewardGrid:OnSortingOrderChange(self.sortingOrder)
|
|
this.continuityRechargePage:OnSortingOrderChange(self.sortingOrder)
|
|
--this.giftBuy:OnSortingOrderChange(self.sortingOrder)
|
|
this.exChange:OnSortingOrderChange(self.sortingOrder)
|
|
Util.AddParticleSortLayer( self.effext1, self.sortingOrder - cursortingOrder)
|
|
Util.AddParticleSortLayer( self.effext2, self.sortingOrder - cursortingOrder)
|
|
Util.AddParticleSortLayer( self.effext3, self.sortingOrder - cursortingOrder)
|
|
Util.AddParticleSortLayer( self.effext4, self.sortingOrder - cursortingOrder)
|
|
Util.AddParticleSortLayer( self.leijichongzhiEffect, self.sortingOrder - cursortingOrder)
|
|
cursortingOrder = self.sortingOrder
|
|
|
|
--特效穿透特殊处理
|
|
if activeIndext == ExperType.SevenDay then
|
|
-- this.sevenDayPanel.OnSortingOrderChange(self,self.sortingOrder)
|
|
else
|
|
this.expert.OnSortingOrderChange(self,self.sortingOrder)
|
|
end
|
|
|
|
end
|
|
--活动奖励1
|
|
function ExpertPanel:ActivityRewardShow(index,isPlayLuckCat)
|
|
this.weekCardPanel:SetActive(false)
|
|
this.expertRewardGridPanel:SetActive(false)
|
|
this.exChangePanel:SetActive(false)
|
|
this.patFacePanel:SetActive(false)
|
|
this.diffMonsterBuyPanel:SetActive(false)
|
|
--this.luckyTurnTablePanel:SetActive(false)
|
|
this.CourtesyDressPanel:SetActive(false)
|
|
this.luckyCatPanelShow:SetActive(false)
|
|
-- this.heroStarGift.gameObject:SetActive(index == ExperType.StarGrowGift)
|
|
this.upLvRewardGrid.gameObject:SetActive(index == ExperType.UpLv)
|
|
this.continuityRechargePage.gameObject:SetActive(false)
|
|
--this.giftBuy.gameObject:SetActive(index == ExperType.GiftBuy)
|
|
-- if index ~= ExperType.StarGrowGift then
|
|
-- this.heroStarGift:OnClose()
|
|
-- end
|
|
if index ~= ExperType.UpLv then
|
|
this.upLvRewardGrid:OnClose()
|
|
end
|
|
if index ~= ExperType.LuckyCat then
|
|
this.luckyCatPanel:OnClose()
|
|
end
|
|
|
|
activeIndext = index
|
|
if index == ExperType.WeekCard then
|
|
--周卡
|
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
|
this.weekCardPanel:SetActive(true)
|
|
self:ShowActivityData(index)
|
|
this.weekCard.OnShow()
|
|
elseif index == ExperType.ExChange then
|
|
--限时兑换活动
|
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.ExChange })
|
|
this.exChangePanel:SetActive(true)
|
|
self:ShowActivityData(index)
|
|
this.exChange.OnShow(self,self.sortingOrder)
|
|
elseif index == ExperType.PatFace then
|
|
--拍脸
|
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Recruit})
|
|
this.patFacePanel:SetActive(true)
|
|
self:ShowActivityData(index)
|
|
this.patFace.OnShow()
|
|
elseif index == ExperType.DiffMonster then
|
|
--拍脸2 天神恩赐
|
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
|
this.diffMonsterBuyPanel:SetActive(true)
|
|
self:ShowActivityData(index)
|
|
this.diffMonsterBuy.OnShow()
|
|
--elseif index == ExperType.LuckyTurn then
|
|
--幸运转盘
|
|
--this.luckyTurnTablePanel:SetActive(true)
|
|
--self:ShowActivityData(index)
|
|
--this.luckyTurn.OnShow(self,this.UpView,this,TreasureTypeVal)
|
|
-- elseif index == ExperType.SevenDay then
|
|
-- --七日登陆
|
|
-- this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
|
-- this.CourtesyDressPanel:SetActive(true)
|
|
-- self:ShowActivityData(index)
|
|
-- this.sevenDayPanel.OnShow(self,self.sortingOrder)
|
|
elseif index == ExperType.LuckyCat then
|
|
--福星高照
|
|
this.luckyCatPanelShow:SetActive(true)
|
|
self:ShowActivityData(index)
|
|
this.luckyCatPanel.OnShow(self,this.UpView,this)
|
|
self:LuckyCatAnimatorPlay(isPlayLuckCat)
|
|
-- elseif index == ExperType.StarGrowGift then
|
|
-- --- 什么乱七八糟的成长礼
|
|
-- if OperatingManager.GetHeroRedState() == 1 then
|
|
-- OperatingManager.SetHeroRedState(0)
|
|
-- CheckRedPointStatus(RedPointType.HERO_STAR_GIFT)
|
|
-- end
|
|
-- self:ShowActivityData(index)
|
|
-- this.heroStarGift:OnShow()
|
|
-- this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
|
elseif index == ExperType.UpLv then
|
|
self:ShowActivityData(index)
|
|
this.upLvRewardGrid:OnShow()
|
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
|
elseif index == ExperType.ContinueRecharge then
|
|
self:ShowActivityData(index)
|
|
this.continuityRechargePage:OnShow(self.sortingOrder)
|
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
|
-- elseif index == ExperType.GiftBuy then
|
|
-- self:ShowActivityData(index)
|
|
-- this.giftBuy:OnShow(self.sortingOrder)
|
|
-- this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
|
else
|
|
--达人
|
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
|
this.expertRewardGridPanel:SetActive(true)
|
|
self:ShowActivityData(index)
|
|
this.expert.OnShow(self, index,self.sortingOrder)
|
|
self.leijichongzhiEffect:SetActive( index == ExperType.AddUp )
|
|
end
|
|
end
|
|
function ExpertPanel:ShowActivityData(activityType)
|
|
self:SetSelectBtn(activityType)
|
|
end
|
|
function ExpertPanel:SetSelectBtn(index)
|
|
self.selectBtn.transform:SetParent(tabBtns[index].transform)
|
|
self.selectBtn.transform.localScale = Vector3.one
|
|
self.selectBtn.transform.localPosition = Vector3.zero;
|
|
self.selectBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite(imageSprite[index][2])
|
|
self.selectBtn:GetComponent("Image"):SetNativeSize()
|
|
end
|
|
function ExpertPanel:RefreshActivityBtn(context)
|
|
if context.type == ActivityTypeDef.FastExplore then
|
|
tabBtns[10]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.AreaExper then
|
|
tabBtns[11]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.UpStarExper then
|
|
tabBtns[9]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.EquipExper then
|
|
tabBtns[12]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.GoldExper then
|
|
tabBtns[13]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.FightExper then
|
|
tabBtns[14]:SetActive(context.status == 1)
|
|
-- elseif context.type == ActivityTypeDef.EnergyExper then
|
|
-- tabBtns[15]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.Talisman then
|
|
tabBtns[16]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.SoulPrint then
|
|
tabBtns[17]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.GrowthReward then
|
|
tabBtns[18]:SetActive(false)
|
|
elseif context.type == ActivityTypeDef.AccumulativeRechargeExper then
|
|
local tempId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.AccumulativeRechargeExper)
|
|
if tempId then
|
|
local config = ConfigManager.GetConfigData(ConfigName.GlobalActivity,tempId)
|
|
if config.ShowArt == 1 then
|
|
tabBtns[7]:SetActive(context.status == 1)
|
|
else
|
|
tabBtns[7]:SetActive(false)
|
|
end
|
|
else
|
|
tabBtns[7]:SetActive(false)
|
|
end
|
|
|
|
--elseif context.type == ActivityTypeDef.LuckyTurnTable_One then
|
|
-- tabBtns[6]:SetActive(context.status == 1)
|
|
-- elseif context.type == ActivityTypeDef.SevenDayRegister then
|
|
-- tabBtns[1]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.LuckyCat then
|
|
tabBtns[5]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.FindTreasureExper then
|
|
tabBtns[19]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.LuckyTurnExper then
|
|
tabBtns[20]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.RecruitExper then
|
|
tabBtns[21]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.SecretBoxExper then
|
|
tabBtns[22]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.UpLvAct then
|
|
tabBtns[23]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.ContinuityRecharge then
|
|
tabBtns[24]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.ExpeditionExper then
|
|
tabBtns[26]:SetActive(context.status == 1)
|
|
elseif context.type == ActivityTypeDef.slhjExper then
|
|
tabBtns[27]:SetActive(context.status == 1)
|
|
end
|
|
tabBtns[6]:SetActive(false)--探宝长久关闭
|
|
tabBtns[1]:SetActive(false)--七日登录奖励
|
|
defaultIndex = self:SetOpenActiveBtn()
|
|
defaultIndex = self:GetPriorityIndex(defaultIndex)
|
|
if defaultIndex > 0 then
|
|
self:ActivityRewardShow(defaultIndex,false)
|
|
else
|
|
PopupTipPanel.ShowTip(Language[10575])
|
|
UIManager.OpenPanel(UIName.MainPanel)
|
|
end
|
|
end
|
|
--客户端自己Show刷新
|
|
function ExpertPanel:RefreshActivityShow()
|
|
tabBtns[1]:SetActive(false)--not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.SevenDayRegister))
|
|
tabBtns[5]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LuckyCat))
|
|
tabBtns[6]:SetActive(false)--not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LuckyTurnTable_One))--探宝长久关闭
|
|
local tempId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.AccumulativeRechargeExper)
|
|
if tempId then
|
|
local config = ConfigManager.GetConfigData(ConfigName.GlobalActivity,tempId)
|
|
if config.ShowArt == 1 then
|
|
tabBtns[7]:SetActive(true)
|
|
else
|
|
tabBtns[7]:SetActive(false)
|
|
end
|
|
else
|
|
tabBtns[7]:SetActive(false)
|
|
end
|
|
tabBtns[9]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.UpStarExper))
|
|
tabBtns[10]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FastExplore))
|
|
tabBtns[11]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.AreaExper))
|
|
tabBtns[12]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.EquipExper))
|
|
tabBtns[13]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.GoldExper))
|
|
tabBtns[14]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FightExper))
|
|
-- tabBtns[15]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.EnergyExper))
|
|
tabBtns[16]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.Talisman))
|
|
tabBtns[17]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.SoulPrint))
|
|
tabBtns[18]:SetActive(false)--(OperatingManager.IsHeroGiftActive())
|
|
tabBtns[19]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindTreasureExper))
|
|
tabBtns[20]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LuckyTurnExper))
|
|
tabBtns[21]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.RecruitExper))
|
|
tabBtns[22]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.SecretBoxExper))
|
|
tabBtns[23]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.UpLvAct))
|
|
tabBtns[24]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.ContinuityRecharge))
|
|
tabBtns[25]:SetActive(false)
|
|
tabBtns[26]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.ExpeditionExper))
|
|
tabBtns[27]:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.slhjExper))
|
|
end
|
|
--事件刷新活动进度
|
|
function ExpertPanel:RefreshActivityProgress()
|
|
self:ActivityRewardShow(activeIndext,false)
|
|
end
|
|
--界面关闭时调用(用于子类重写)
|
|
function ExpertPanel:OnClose()
|
|
if PatFaceManager.timer then
|
|
PatFaceManager.timer:Stop()
|
|
PatFaceManager.timer = nil
|
|
end
|
|
--this.luckyTurn.OnClose()
|
|
this.exChange.OnClose()
|
|
-- this.heroStarGift:OnClose()
|
|
--this.giftBuy.OnClose()
|
|
this.upLvRewardGrid:OnClose()
|
|
defaultIndex = activeIndext
|
|
this.isPlayingLackCatAni = false
|
|
end
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
function ExpertPanel:OnDestroy()
|
|
-- ClearRedPointObject(RedPointType.CourtesyDress_SevenDay)
|
|
ClearRedPointObject(RedPointType.Expert_WeekCard)
|
|
ClearRedPointObject(RedPointType.LuckyCat)
|
|
--ClearRedPointObject(RedPointType.Expert_LuckyTurn)
|
|
ClearRedPointObject(RedPointType.Expert_AccumulativeRecharge)
|
|
ClearRedPointObject(RedPointType.Expert_LimitExchange)
|
|
ClearRedPointObject(RedPointType.Expert_UpStarExper)
|
|
ClearRedPointObject(RedPointType.Expert_FastExplore)
|
|
ClearRedPointObject(RedPointType.Expert_AreaExper)
|
|
ClearRedPointObject(RedPointType.Expert_EquipExper)
|
|
ClearRedPointObject(RedPointType.Expert_GoldExper)
|
|
ClearRedPointObject(RedPointType.Expert_FightExper)
|
|
ClearRedPointObject(RedPointType.Expert_EnergyExper)
|
|
ClearRedPointObject(RedPointType.Expert_Talisman)
|
|
ClearRedPointObject(RedPointType.Expert_FindTreasure)
|
|
ClearRedPointObject(RedPointType.Expert_LuckyTurn)
|
|
ClearRedPointObject(RedPointType.Expert_Recruit)
|
|
ClearRedPointObject(RedPointType.Expert_SecretBox)
|
|
ClearRedPointObject(RedPointType.Expert_UpLv)
|
|
ClearRedPointObject(RedPointType.Expert_SoulPrint)
|
|
ClearRedPointObject(RedPointType.HERO_STAR_GIFT)
|
|
ClearRedPointObject(RedPointType.ContinuityRecharge)
|
|
ClearRedPointObject(RedPointType.Expert_Expedition)
|
|
ClearRedPointObject(RedPointType.Expert_Slhj)
|
|
-- if LiveName then
|
|
-- poolManager:UnLoadLive(LiveName, LiveGO)
|
|
-- LiveName = nil
|
|
-- end
|
|
-- this.sevenDayPanel.OnDestroy()
|
|
this.luckyCatPanel.OnDestroy()
|
|
-- this.heroStarGift:OnDestroy()
|
|
this.upLvRewardGrid:OnDestroy()
|
|
this.exChange.OnDestroy()
|
|
--this.giftBuy.OnDestroy()
|
|
this.continuityRechargePage.OnDestroy()
|
|
this.spLoader:Destroy()
|
|
SubUIManager.Close(this.UpView)
|
|
end
|
|
--获取开启的活动 和 隐藏显示按钮
|
|
function ExpertPanel:SetOpenActiveBtn()
|
|
local defaultIndex = 0
|
|
-- 七日
|
|
-- local curActiveData = not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.SevenDayRegister)
|
|
-- if curActiveData then
|
|
-- if defaultIndex == 0 then
|
|
-- defaultIndex = 1
|
|
-- end
|
|
-- tabBtns[1]:SetActive(true)
|
|
-- else
|
|
-- tabBtns[1]:SetActive(false)
|
|
-- end
|
|
|
|
--拍脸
|
|
local patFaceAllData = nil--{ConfigManager.GetConfigData(ConfigName.LoginPosterConfig,1)}--PatFaceManager.GetPatFaceAllDataTabs()
|
|
if RecruitManager.isTenRecruit == 0 then
|
|
patFaceAllData = { ConfigManager.GetConfigData(ConfigName.LoginPosterConfig, 1) }
|
|
end
|
|
local isActive =not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.PatFace)
|
|
if isActive and patFaceAllData and #patFaceAllData > 0 then
|
|
tabBtns[ExperType.PatFace]:SetActive(true)
|
|
if defaultIndex == 0 or defaultIndex > ExperType.PatFace then
|
|
defaultIndex = ExperType.PatFace
|
|
end
|
|
else
|
|
tabBtns[ExperType.PatFace]:SetActive(false)
|
|
end
|
|
|
|
--拍脸 异妖直购
|
|
diffMonsterBuyData = nil
|
|
for i, v in ConfigPairs(ConfigManager.GetConfig(ConfigName.LoginPosterConfig)) do
|
|
if v.Type == 2 then
|
|
--异妖直购特殊处理
|
|
if v.OpenRules[1] == 1 then
|
|
if PlayerManager.level >= v.OpenRules[2] and PlayerManager.level <= v.CloseRules[2] then
|
|
local conFigData = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, v.ShopId)
|
|
local shopItemData = OperatingManager.GetGiftGoodsInfo(conFigData.Type, v.ShopId)
|
|
if shopItemData and diffMonsterBuyData == nil then
|
|
diffMonsterBuyData = v
|
|
tabBtns[ExperType.DiffMonster]:SetActive(true)
|
|
if defaultIndex == 0 or defaultIndex > ExperType.DiffMonster then
|
|
defaultIndex = ExperType.DiffMonster
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
if diffMonsterBuyData == nil then
|
|
tabBtns[ExperType.DiffMonster]:SetActive(false)
|
|
end
|
|
|
|
--周卡
|
|
local weekCardData = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.WeekCard, 12)
|
|
if weekCardData then
|
|
if weekCardData.endTime - GetTimeStamp() <= 0 then
|
|
tabBtns[ExperType.WeekCard]:SetActive(false)
|
|
else
|
|
tabBtns[ExperType.WeekCard]:SetActive(true)
|
|
if defaultIndex == 0 or defaultIndex > ExperType.WeekCard then
|
|
defaultIndex = ExperType.WeekCard
|
|
end
|
|
end
|
|
else
|
|
tabBtns[ExperType.WeekCard]:SetActive(false)
|
|
end
|
|
--福星高照
|
|
local curActiveData =not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LuckyCat)
|
|
if curActiveData then
|
|
if defaultIndex == 0 or defaultIndex > 5 then
|
|
defaultIndex = 5
|
|
end
|
|
tabBtns[5]:SetActive(true)
|
|
else
|
|
tabBtns[5]:SetActive(false)
|
|
end
|
|
--幸运探宝
|
|
--local curActiveData= not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LuckyTurnTable_One)
|
|
--if curActiveData then
|
|
-- if defaultIndex == 0 then
|
|
-- defaultIndex = 6
|
|
-- end
|
|
-- tabBtns[6]:SetActive(true)
|
|
--else
|
|
-- tabBtns[6]:SetActive(false)
|
|
--end
|
|
--所有达人
|
|
for i, v in pairs(numExChange) do
|
|
local curActiveData = ActivityGiftManager.GetActivityTypeInfo(v)
|
|
if v == ActivityTypeDef.AccumulativeRechargeExper then
|
|
local tempId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.AccumulativeRechargeExper)
|
|
if tempId and curActiveData then
|
|
local config = ConfigManager.GetConfigData(ConfigName.GlobalActivity,tempId)
|
|
if config.ShowArt == 1 then
|
|
if defaultIndex == 0 or defaultIndex > i then
|
|
defaultIndex = i
|
|
end
|
|
tabBtns[i]:SetActive(true)
|
|
else
|
|
tabBtns[i]:SetActive(false)
|
|
end
|
|
else
|
|
tabBtns[i]:SetActive(false)
|
|
end
|
|
else
|
|
if curActiveData then
|
|
if defaultIndex == 0 or defaultIndex > i then
|
|
defaultIndex = i
|
|
end
|
|
tabBtns[i]:SetActive(true)
|
|
else
|
|
tabBtns[i]:SetActive(false)
|
|
end
|
|
end
|
|
end
|
|
--限时兑换
|
|
local num = 1
|
|
local LimitExchange = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.LimitExchange)
|
|
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LimitExchange) then
|
|
num = GlobalActivityConfig[ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LimitExchange)].ShowArt
|
|
end
|
|
if LimitExchange and num == 1 then
|
|
if LimitExchange.endTime - GetTimeStamp() <= 0 then
|
|
tabBtns[ExperType.ExChange]:SetActive(false)
|
|
else
|
|
tabBtns[ExperType.ExChange]:SetActive(true)
|
|
if defaultIndex == 0 or defaultIndex > ExperType.ExChange then
|
|
defaultIndex = ExperType.ExChange
|
|
end
|
|
end
|
|
else
|
|
tabBtns[ExperType.ExChange]:SetActive(false)
|
|
end
|
|
--星级成长礼
|
|
-- if OperatingManager.IsHeroGiftActive() then
|
|
-- tabBtns[ExperType.StarGrowGift]:SetActive(true)
|
|
-- if defaultIndex == 0 then
|
|
-- defaultIndex = ExperType.StarGrowGift
|
|
-- end
|
|
-- end
|
|
-- --限时礼包
|
|
-- if OperatingManager.IsGiftBuyActive() then
|
|
-- tabBtns[ExperType.GiftBuy]:SetActive(true)
|
|
-- if defaultIndex == 0 or defaultIndex > ExperType.GiftBuy then
|
|
-- defaultIndex = ExperType.GiftBuy
|
|
-- end
|
|
-- else
|
|
-- tabBtns[ExperType.GiftBuy]:SetActive(false)
|
|
-- end
|
|
return defaultIndex
|
|
end
|
|
|
|
function ExpertPanel:GetPriorityIndex(defaultIndex)
|
|
local index = defaultIndex
|
|
for idx, operateItem in ipairs(tabBtns) do
|
|
if operateItem.activeSelf and Util.GetGameObject(operateItem, "redPoint").activeSelf then
|
|
index = idx
|
|
break
|
|
end
|
|
end
|
|
return index
|
|
end
|
|
--直购外网刷新界面
|
|
function ExpertPanel:RechargeSuccessFunc(id)
|
|
local curRechargeCommConfig = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig,id)
|
|
FirstRechargeManager.RefreshAccumRechargeValue(id)
|
|
OperatingManager.RefreshGiftGoodsBuyTimes(GoodsTypeDef.DirectPurchaseGift, id)
|
|
if curRechargeCommConfig.ShowType == 7 then
|
|
--周卡直购
|
|
this.weekCard.OnShow()
|
|
end
|
|
if id == rechargeCommodityConfig.Id then
|
|
--异妖直购
|
|
this.diffMonsterBuy.OnShow()
|
|
end
|
|
-- if curRechargeCommConfig.ShowType == 20 then
|
|
-- --限购礼包
|
|
-- this.giftBuy.OnShow()
|
|
-- end
|
|
end
|
|
--招财猫其实动画特效播放(单击招财猫才播放)
|
|
function ExpertPanel:LuckyCatAnimatorPlay(isPlayLuckCat)
|
|
if isPlayLuckCat then
|
|
this.isPlayingLackCatAni = true
|
|
self.luckyCatAnimator.enabled = true
|
|
self.effext4:SetActive(true)
|
|
Timer.New(function ()
|
|
self.luckyCatAnimator.enabled = false
|
|
self.effext4:SetActive(false)
|
|
this.isPlayingLackCatAni = false
|
|
end, 1.5):Start()
|
|
end
|
|
end
|
|
return ExpertPanel |