2020-05-09 13:31:21 +08:00
require ( " Base/BasePanel " )
require ( " Modules/Main/View/MainPlayerView " )
MainPanel = Inherit ( BasePanel )
local this = MainPanel
--local isPassChapter = {}
local endTime = 0
2020-06-13 11:47:13 +08:00
-- local GHZ_STAGE_IMAGE ={
-- [GUILD_FIGHT_STAGE.DEFEND] = "r_zjm_zhanbz",
-- [GUILD_FIGHT_STAGE.MATCHING] = "r_zjm_zhanpzz",
-- [GUILD_FIGHT_STAGE.COUNTING] = "r_zjm_zhanjjz",
-- }
2020-05-09 13:31:21 +08:00
--示意图轮回放
local imageList = { }
-- 主界面需要隐藏的功能
this.btnFunHide = { }
this.btnFunGray = { }
this.runHorseData = { }
this.operateIcon = { }
this.multiple = 0 --显示信息次数
this.isOpen = false
this.SystemInfo = " "
local orginLayer
this.patFaceCallList = Stack.New ( )
local timePressStarted
local curMianTaskData = { }
local canGetMsg = true
local moveTranList
--local isCanDragMsg = true
local supremHadSet = false
2020-06-03 19:09:01 +08:00
local isUpperMonthCardTimeShow = true
2020-05-09 13:31:21 +08:00
local moveSceneList = {
[ 1 ] = 0 ,
[ 2 ] = 0.02 ,
[ 3 ] = 0.05 ,
[ 4 ] = 0.432 ,
[ 5 ] = 0.5 ,
[ 6 ] = 0.65 ,
[ 7 ] = 0.84 ,
}
local lightList = {
[ 1 ] = { - 475 , 185 } ,
[ 2 ] = { - 1367 , - 950 } ,
[ 3 ] = { - 2447 , - 2397 } ,
}
function this : AddFuncItem ( btnGO , pos )
return { go = btnGO , open = Util.GetGameObject ( btnGO , " open " ) , lock = Util.GetGameObject ( btnGO , " lock " ) , pos = pos }
end
function this : InsertNewText ( btn )
local xinText = Util.GetGameObject ( btn , " new " )
return xinText
end
--初始化组件(用于子类重写)
function this : InitComponent ( )
orginLayer = 0
self.bg = Util.GetGameObject ( self.gameObject , " bg " )
self.sceneTran = Util.GetGameObject ( self.gameObject , " scene " ) : GetComponent ( " RectTransform " )
self.lightEffect = Util.GetGameObject ( self.gameObject , " scene/effect " )
self.lightEffectActive = false
self.bgTran = Util.GetGameObject ( self.gameObject , " bg " ) : GetComponent ( " RectTransform " )
self.mountainTran = Util.GetGameObject ( self.gameObject , " front " ) : GetComponent ( " RectTransform " )
this.npcRoot = Util.GetGameObject ( self.gameObject , " bg/npcRoot " )
this.decorateRoot = Util.GetGameObject ( self.gameObject , " bg/decorate " )
self.ctrl = Util.GetGameObject ( self.gameObject , " scene/ctrl " )
this.heroTeamPowerBtn = Util.GetGameObject ( self.gameObject , " LeftUp/powerBtn " )
this.heroTeamPower = Util.GetGameObject ( self.gameObject , " LeftUp/powerBtn/value " ) : GetComponent ( " Text " )
---------------topLeftPart----------------
--headBox
this.level = Util.GetGameObject ( self.gameObject , " LeftUp/headBox/lvFrame/lv " ) : GetComponent ( " Text " )
this.playName = Util.GetGameObject ( self.gameObject , " LeftUp/headBox/name " ) : GetComponent ( " Text " )
this.expSliderValue = Util.GetGameObject ( self.gameObject , " LeftUp/headBox/exp " ) : GetComponent ( " Slider " )
this.headBox = Util.GetGameObject ( self.gameObject , " LeftUp/headBox " )
this.headPos = Util.GetGameObject ( self.gameObject , " LeftUp/headBox/headpos " )
this.headRedpot = Util.GetGameObject ( self.gameObject , " LeftUp/headBox/redpot " )
-- 七日登陆奖励预览入口
this.sgBtn = Util.GetGameObject ( self.gameObject , " LeftUp/sevenGift " )
this.sgRoot = Util.GetGameObject ( this.sgBtn , " root " )
this.sgItemView = SubUIManager.Open ( SubUIConfig.ItemView , this.sgRoot . transform )
this.sgType = Util.GetGameObject ( this.sgBtn , " type " ) : GetComponent ( " Text " )
this.sgName = Util.GetGameObject ( this.sgBtn , " name " ) : GetComponent ( " Text " )
this.sgInfo = Util.GetGameObject ( this.sgBtn , " info " ) : GetComponent ( " Text " )
this.sgEffect = { }
for i = 1 , 2 do
this.sgEffect [ i ] = Util.GetGameObject ( this.sgBtn , " effect/effect " .. i )
end
effectAdapte ( Util.GetGameObject ( this.sgEffect [ 2 ] , " ziti mask (1) " ) )
-- 一堆的小活动
-- 充值
this.rechargeBtn = Util.GetGameObject ( self.gameObject , " RightUp/recharge " )
2020-05-15 16:52:35 +08:00
this.rechargeRedPoint = Util.GetGameObject ( this.rechargeBtn , " redPoint " )
2020-05-09 13:31:21 +08:00
-- 福利
this.packageGiftBtn = Util.GetGameObject ( self.gameObject , " RightUp/packageGift " )
this.packageGiftRedPoint = Util.GetGameObject ( this.packageGiftBtn , " redPoint " )
-- 首充
this.firstRechargeBtn = Util.GetGameObject ( self.gameObject , " RightUp/firstRecharge " )
this.firstRechargeRedPoint = Util.GetGameObject ( this.firstRechargeBtn , " redPoint " )
-- 七日狂欢
this.sevenDayCarnivalBtn = Util.GetGameObject ( self.gameObject , " RightUp/sevenDay " )
this.SevenDayStage1 = Util.GetGameObject ( self.sevenDayCarnivalBtn , " stage1 " )
this.SevenDayStage2 = Util.GetGameObject ( self.sevenDayCarnivalBtn , " stage2 " )
this.sevenDayCarnivalRedPoint = Util.GetGameObject ( this.sevenDayCarnivalBtn , " redPoint " )
-- 每日首充
this.dailyRechargeBtn = Util.GetGameObject ( self.transform , " RightUp/dailyRecharge " )
this.dailyRechargeRedPoint = Util.GetGameObject ( this.dailyRechargeBtn , " redPoint " )
--月基金
this.upperMonthCardBtn = Util.GetGameObject ( self.transform , " RightUp/upperMonthCardBtn " )
this.upperMonthCardRedPoint = Util.GetGameObject ( this.upperMonthCardBtn , " redPoint " )
2020-06-03 19:09:01 +08:00
this.upperMonthCardTimeBg = Util.GetGameObject ( this.upperMonthCardBtn , " Image_1 " )
this.upperMonthCardTime = Util.GetGameObject ( this.upperMonthCardBtn , " time " ) : GetComponent ( " Text " )
2020-05-09 13:31:21 +08:00
2020-06-18 20:39:29 +08:00
--限时折扣
this.upGradePackageBtn = Util.GetGameObject ( self.transform , " RightUp/upGradePackageBtn " )
this.upGradePackageTime = Util.GetGameObject ( this.upGradePackageBtn , " time " ) : GetComponent ( " Text " )
2020-05-09 13:31:21 +08:00
--百宝商会
this.treasureStoreBtn = Util.GetGameObject ( self.transform , " RightUp/treasureStoreBtn " )
this.treasureStoreRedPoint = Util.GetGameObject ( this.treasureStoreBtn , " redPoint " )
---- 招财猫
--this.luckyCatBtn = Util.GetGameObject(self.gameObject, "RightUp/luckyCat")
--this.luckyCatRedPoint = Util.GetGameObject(self.gameObject, "RightUp/luckyCat/redPoint")
-- 开服有礼
this.courtesyDress = Util.GetGameObject ( self.gameObject , " RightUp/sevenDayGift " )
--开服有礼红点
this.courtesyDressRedPoint = Util.GetGameObject ( this.courtesyDress , " sevenDayRedPoint " )
-- 云梦祈福
this.paryGift = Util.GetGameObject ( self.gameObject , " RightUp/paryGift " )
-- 战力排行
this.warPowerSort = Util.GetGameObject ( self.gameObject , " RightUp/warPowerSort " )
this.warPowerSortRedPoint = Util.GetGameObject ( this.warPowerSort , " chapterRedPoint " )
-- 限时活动
this.expert = Util.GetGameObject ( self.gameObject , " RightUp/expert " )
this.expertRedPoint = Util.GetGameObject ( this.expert , " chapterRedPoint " )
-- 孙龙宝藏
this.treasureOfSl = Util.GetGameObject ( self.gameObject , " RightUp/treasureOfSl " )
this.treasureOfSlRedPoint = Util.GetGameObject ( this.treasureOfSl , " redPoint " )
-- 问卷
this.questionnaireBtn = Util.GetGameObject ( self.gameObject , " RightUp/questionnaire " )
--东海寻仙
this.findFairyBtn = Util.GetGameObject ( self.gameObject , " RightUp/findFairy " )
this.findFairyRedPoint = Util.GetGameObject ( this.findFairyBtn , " redPoint " )
--幸运转盘
this.luckyTurnBtn = Util.GetGameObject ( self.gameObject , " RightUp/luckyTurn " )
this.luckyTurnRedPoint = Util.GetGameObject ( this.luckyTurnBtn , " redPoint " )
--远征
--this.expeditionBtn=Util.GetGameObject(self.gameObject,"RightUp/expedition")
--this.expeditionRedPoint=Util.GetGameObject(this.expeditionBtn,"redPoint")
--成就
this.AchievementBtn = Util.GetGameObject ( self.gameObject , " RightUp/Achievement " )
2020-06-03 19:09:01 +08:00
this.AchievementBtn : SetActive ( false )
--this.AchievementRedPoint=Util.GetGameObject(this.AchievementBtn,"redPoint")
2020-05-09 13:31:21 +08:00
-- 特权
this.vipPrivilegeBtn = Util.GetGameObject ( self.gameObject , " LeftUp/vipPrivilege/vipPrivilegeBtn " )
this.vipLevelText = Util.GetGameObject ( this.vipPrivilegeBtn , " bg/vip " ) : GetComponent ( " Image " )
this.vipRedPoint = Util.GetGameObject ( self.gameObject , " LeftUp/vipPrivilege/redPoint " )
screenAdapte ( this.vipPrivilegeBtn )
---------------topRightPart----------------
-- 邮件
this.btnYouJian = Util.GetGameObject ( self.gameObject , " LeftDown/btnRoot/btnYouJian " )
this.mailRedPoint = Util.GetGameObject ( this.btnYouJian , " redPoint " )
-- 日常
this.btnDailyMission = Util.GetGameObject ( self.gameObject , " LeftDown/btnRoot/btnDailyMission " )
this.DailyRedPoint = Util.GetGameObject ( this.btnDailyMission , " redPoint " )
-- 好友
this.btnFriend = Util.GetGameObject ( self.gameObject , " LeftDown/btnRoot/btnfriend " )
this.friendRed = Util.GetGameObject ( this.btnFriend , " redPoint " )
2020-06-18 20:39:29 +08:00
-- 排行
this.btnRank = Util.GetGameObject ( self.gameObject , " LeftDown/btnRoot/btnRank " )
this.rankRed = Util.GetGameObject ( this.btnRank , " redPoint " )
2020-05-09 13:31:21 +08:00
-- 设置
--this.btnSet = Util.GetGameObject(self.gameObject, "LeftDown/btnRoot/btnSetting")
--this.setRed = Util.GetGameObject(this.btnSet, "redPoint")
-------------------场景中的按钮------------------------
-- 按钮
this.btnMonster = Util.GetGameObject ( this.gameObject , " scene/layer2/btnShouchaolaixi " )
this.btnExpedition = Util.GetGameObject ( this.gameObject , " scene/layer2/btnexpedition " )
this.btnJingjichang = Util.GetGameObject ( this.gameObject , " scene/layer4/btnJingjichang " )
this.btnGonghui = Util.GetGameObject ( this.gameObject , " scene/layer3/btnGonghui " )
2020-06-13 11:47:13 +08:00
-- this.btnGonghui:SetActive(false)
2020-06-18 20:39:29 +08:00
this.btnFenjie = Util.GetGameObject ( this.gameObject , " scene/layer7/btnFenjie " )
2020-05-09 13:31:21 +08:00
--this.btnTujian = Util.GetGameObject(this.gameObject, "scene/layer7/btnTujian")
this.btnShangdian = Util.GetGameObject ( this.gameObject , " scene/layer7/btnShangdian " )
2020-06-18 20:39:29 +08:00
this.btnEquipCompound = Util.GetGameObject ( this.gameObject , " scene/layer3/btnEquipCompound " )
-- this.btnPaihangbang = Util.GetGameObject(this.gameObject, "scene/layer4/btnPaihangbang")
2020-05-09 13:31:21 +08:00
-- this.btnGuanxing = Util.GetGameObject(this.gameObject, "scene/layer4/btnGuanxing")
this.btnRecruit = Util.GetGameObject ( this.gameObject , " scene/layer6/btnRecruit " )
2020-06-18 20:39:29 +08:00
this.btnElementDrawCard = Util.GetGameObject ( this.gameObject , " scene/layer4/btnElementDrawCard " )
2020-05-09 13:31:21 +08:00
this.btnSecretBox = Util.GetGameObject ( this.gameObject , " scene/layer4/btnSecretBox " )
this.btnYiYao = Util.GetGameObject ( this.gameObject , " scene/layer4/btnYiYao " )
-- this.btnTianFu = Util.GetGameObject(this.gameObject, "scene/layer6/btnTianFu")
this.btnWaiDi = Util.GetGameObject ( this.gameObject , " scene/layer4/btnWaiDi " )
2020-06-18 20:39:29 +08:00
this.btnColorfulWorld = Util.GetGameObject ( this.gameObject , " scene/layer6/btnColorfulWorld " )
2020-05-09 13:31:21 +08:00
this.btnWaiDi : SetActive ( false )
this.operateIcon = {
2020-06-18 20:39:29 +08:00
[ FUNCTION_OPEN_TYPE.SHOP ] = this : AddFuncItem ( this.btnShangdian , 50 ) ,
-- [FUNCTION_OPEN_TYPE.ALLRANKING] = this:AddFuncItem(this.btnPaihangbang, -2715),
2020-05-09 13:31:21 +08:00
-- [FUNCTION_OPEN_TYPE.ASPECT_STAR] = this:AddFuncItem(this.btnGuanxing, -2715),
2020-06-18 20:39:29 +08:00
[ FUNCTION_OPEN_TYPE.HERO_RESOLVE ] = this : AddFuncItem ( this.btnFenjie , - 200 ) ,
2020-05-09 13:31:21 +08:00
--[FUNCTION_OPEN_TYPE.HAND_BOOK] = this:AddFuncItem(this.btnTujian,-2715),
[ FUNCTION_OPEN_TYPE.ARENA ] = this : AddFuncItem ( this.btnJingjichang , - 200 ) ,
2020-06-18 20:39:29 +08:00
[ FUNCTION_OPEN_TYPE.TRIAL ] = this : AddFuncItem ( this.btnColorfulWorld , - 1000 ) ,
-- [FUNCTION_OPEN_TYPE.MONSTER_COMING] = this:AddFuncItem(this.btnMonster, -110),
-- [FUNCTION_OPEN_TYPE.EXPEDITION] = this:AddFuncItem(this.btnExpedition, -110),
[ FUNCTION_OPEN_TYPE.COMPOUND ] = this : AddFuncItem ( this.btnEquipCompound , - 200 ) ,
2020-05-09 13:31:21 +08:00
[ FUNCTION_OPEN_TYPE.RECURITY ] = this : AddFuncItem ( this.btnRecruit , - 56 ) ,
2020-06-18 20:39:29 +08:00
[ FUNCTION_OPEN_TYPE.ELEMENT_RECURITY ] = this : AddFuncItem ( this.btnElementDrawCard , 0 ) ,
-- [FUNCTION_OPEN_TYPE.SECRETBOX] = this:AddFuncItem(this.btnSecretBox, 0),
2020-05-09 13:31:21 +08:00
-- [FUNCTION_OPEN_TYPE.TALENT_TREE] = this:AddFuncItem(this.btnTianFu, -1179),
2020-06-18 20:39:29 +08:00
-- [FUNCTION_OPEN_TYPE.DIFFER_DEMONS] = this:AddFuncItem(this.btnYiYao, 0),
-- [FUNCTION_OPEN_TYPE.FIGHT_ALIEN] = this:AddFuncItem(this.btnWaiDi, 0),
2020-05-09 13:31:21 +08:00
}
this.operateNewText = {
[ FUNCTION_OPEN_TYPE.SHOP ] = this : InsertNewText ( this.btnShangdian ) ,
2020-06-18 20:39:29 +08:00
-- [FUNCTION_OPEN_TYPE.ALLRANKING] = this:InsertNewText(this.btnPaihangbang),
2020-05-09 13:31:21 +08:00
-- [FUNCTION_OPEN_TYPE.ASPECT_STAR] = this:InsertNewText(this.btnGuanxing),
[ FUNCTION_OPEN_TYPE.HERO_RESOLVE ] = this : InsertNewText ( this.btnFenjie ) ,
--[FUNCTION_OPEN_TYPE.HAND_BOOK] = this:InsertNewText(this.btnTujian),
[ FUNCTION_OPEN_TYPE.ARENA ] = this : InsertNewText ( this.btnJingjichang ) ,
2020-06-18 20:39:29 +08:00
[ FUNCTION_OPEN_TYPE.TRIAL ] = this : InsertNewText ( this.btnColorfulWorld ) ,
-- [FUNCTION_OPEN_TYPE.MONSTER_COMING] = this:InsertNewText(this.btnMonster),
2020-05-09 13:31:21 +08:00
--[FUNCTION_OPEN_TYPE.EXPEDITION] = this:InsertNewText(this.btnExpedition),
2020-06-18 20:39:29 +08:00
[ FUNCTION_OPEN_TYPE.COMPOUND ] = this : InsertNewText ( this.btnEquipCompound ) ,
2020-05-09 13:31:21 +08:00
[ FUNCTION_OPEN_TYPE.RECURITY ] = this : InsertNewText ( this.btnRecruit ) ,
[ FUNCTION_OPEN_TYPE.ELEMENT_RECURITY ] = this : InsertNewText ( this.btnElementDrawCard ) ,
2020-06-18 20:39:29 +08:00
-- [FUNCTION_OPEN_TYPE.SECRETBOX] = this:InsertNewText(this.btnSecretBox),
2020-05-09 13:31:21 +08:00
-- [FUNCTION_OPEN_TYPE.TALENT_TREE] = this:InsertNewText(this.btnTianFu),
2020-06-18 20:39:29 +08:00
-- [FUNCTION_OPEN_TYPE.DIFFER_DEMONS] = this:InsertNewText(this.btnYiYao),
-- [FUNCTION_OPEN_TYPE.FIGHT_ALIEN] = this:InsertNewText(this.btnWaiDi),
2020-05-09 13:31:21 +08:00
}
-- 红点
this.rpShangdian = Util.GetGameObject ( this.btnShangdian , " redPoint " )
this.rpJingjichang = Util.GetGameObject ( this.btnJingjichang , " redPoint " )
this.rpExpedition = Util.GetGameObject ( this.btnExpedition , " redPoint " )
--this.rpMijing = Util.GetGameObject(this.btnMijing, "redPoint")
--this.rpGuShi = Util.GetGameObject(this.btnGuShi, "redPoint") -- 暂时没用的
--this.rpMonster = Util.GetGameObject(this.btnMonster, "redPoint")
--this.rpZhaomu = Util.GetGameObject(this.btnZhaomu, "redPoint")
2020-06-13 11:47:13 +08:00
-- this.rpGonghui = Util.GetGameObject(this.btnGonghui, "redPoint")
2020-05-09 13:31:21 +08:00
this.rpRecruit = Util.GetGameObject ( this.btnRecruit , " redPoint " )
this.rpElementDrawCard = Util.GetGameObject ( this.btnElementDrawCard , " redPoint " )
this.rpSecretBox = Util.GetGameObject ( this.btnSecretBox , " redPoint " )
this.rpYiYao = Util.GetGameObject ( this.btnYiYao , " redPoint " )
-- this.rpTianFu = Util.GetGameObject(this.btnTianFu, "redPoint")
--this.rpXuezhandaodi = Util.GetGameObject(this.btnXuezhandaodi, "redPoint")
--this.rpFenjie = Util.GetGameObject(this.btnFenjie, "redPoint")
--this.rpTujian = Util.GetGameObject(this.btnTujian, "redPoint")
--this.rpPaihangbang = Util.GetGameObject(this.btnPaihangbang, "redPoint")
--this.rpGuanxing = Util.GetGameObject(this.btnGuanxing, "redPoint")
this.rpAlien = Util.GetGameObject ( this.btnWaiDi , " redPoint " )
2020-06-18 20:39:29 +08:00
this.rpColorfulWorld = Util.GetGameObject ( this.btnColorfulWorld , " redPoint " )
2020-05-09 13:31:21 +08:00
this.BtView = SubUIManager.Open ( SubUIConfig.BtView , self.transform )
this.UpView = SubUIManager.Open ( SubUIConfig.UpView , self.transform )
2020-05-25 19:16:23 +08:00
-- this.HorseRaceLampView = SubUIManager.Open(SubUIConfig.HorseRaceLampView, self.transform)
2020-05-09 13:31:21 +08:00
this.ChatTipView = SubUIManager.Open ( SubUIConfig.ChatTipView , self.transform , 1 )
--this.RefreshChangeName()
----==================== npc按钮 ========================
-- 云游商人
this.yunyou = Util.GetGameObject ( this.npcRoot , " npcYunyou " )
this.btnYunyou = Util.GetGameObject ( this.yunyou , " button " )
this.timeYunyou = Util.GetGameObject ( this.btnYunyou , " time " ) : GetComponent ( " Text " )
this.rpYunyou = Util.GetGameObject ( this.btnYunyou , " redPoint " )
poolManager : LoadLive ( " live2d_r_MapEffect_NewEvent_014 " , Util.GetTransform ( this.yunyou , " liveRoot " ) , Vector3.one , Vector3.zero )
-- 精英怪
this.jingying = Util.GetGameObject ( this.npcRoot , " npcJingying " )
this.btnJingying = Util.GetGameObject ( this.jingying , " button " )
this.eliteMonsterTimeText = Util.GetGameObject ( this.btnJingying , " time " ) : GetComponent ( " Text " )
this.rpJingying = Util.GetGameObject ( this.btnJingying , " redPoint " )
poolManager : LoadLive ( " live2d_r_Map_NewEvent_015 " , Util.GetTransform ( this.jingying , " liveRoot " ) , Vector3.one , Vector3.zero )
-- 公会战
--this.gonghuizhan = Util.GetGameObject(this.npcRoot, "npcGonghuizhan")
--this.btnGonghuizhan = Util.GetGameObject(this.gonghuizhan, "button")
--this.timeGonghuizhan = Util.GetGameObject(this.gonghuizhan, "time"):GetComponent("Text")
--this.rpGonghuizhan = Util.GetGameObject(this.btnGonghuizhan, "redPoint")
--poolManager:LoadLive("live2d_r_Map_NewEvent_015", Util.GetTransform(this.gonghuizhan, "liveRoot"), Vector3.one, Vector3.zero)
2020-06-13 11:47:13 +08:00
-- this.GHZStageImage = Util.GetGameObject(this.btnGonghui, "stageEffect/Image"):GetComponent("Image")
-- this.GHZStageAttackEffect = Util.GetGameObject(this.btnGonghui, "stageEffect/fight")
-- this.isGHZShow = false
-- this.GHZ_Stage = nil
2020-05-09 13:31:21 +08:00
-- 外敌
this.alienNPC = Util.GetGameObject ( this.npcRoot , " npcAlien " )
this.btnAlienNPC = Util.GetGameObject ( this.alienNPC , " button " )
this.timeAlienNPC = Util.GetGameObject ( this.alienNPC , " time " ) : GetComponent ( " Text " )
this.rpAlienNPC = Util.GetGameObject ( this.alienNPC , " redPoint " )
--poolManager:LoadLive("live2d_r_Map_NewEvent_015", Util.GetTransform(this.alienNPC, "liveRoot"), Vector3.one, Vector3.zero)
moveTranList = { }
for i = 1 , # moveSceneList do
table.insert ( moveTranList , Util.GetGameObject ( self.gameObject , " scene/layer " .. i ) : GetComponent ( " RectTransform " ) )
end
this.btnClickMove = Util.GetGameObject ( this.bg , " btnClickMove " )
-- 主线任务显示
this.mainTask = Util.GetGameObject ( self.gameObject , " RightDown/mainTask " )
this.titleText = Util.GetGameObject ( self.gameObject , " RightDown/mainTask/progressLayout/titleText " ) : GetComponent ( " Text " )
this.progressText = Util.GetGameObject ( self.gameObject , " RightDown/mainTask/progressLayout/progressText " ) : GetComponent ( " Text " )
this.getRewardButton = Util.GetGameObject ( self.gameObject , " RightDown/mainTask/getRewardButton " )
this.mainTaskGRewardImage = Util.GetGameObject ( self.gameObject , " RightDown/mainTask/getRewardButton/getRewardImage " )
this.mainTaskJumpImage = Util.GetGameObject ( self.gameObject , " RightDown/mainTask/getRewardButton/jumpImage " )
2020-05-25 19:16:23 +08:00
this.mainTask : SetActive ( false ) -- 删除
2020-05-09 13:31:21 +08:00
this.GuideEffectGo = poolManager : LoadAsset ( " GuideEffect " , PoolManager.AssetType . GameObject )
this.GuideEffectGo . transform : SetParent ( this.mainTaskGRewardImage . transform )
this.GuideEffectGo . transform.localPosition = Vector3.zero
this.GuideEffectGo . transform.localScale = Vector3.one
Util.GetGameObject ( this.GuideEffectGo , " GameObject " ) : SetActive ( false )
this.GuideJumpEffectGo = poolManager : LoadAsset ( " GuideEffect " , PoolManager.AssetType . GameObject )
this.GuideJumpEffectGo . transform : SetParent ( this.mainTaskJumpImage . transform )
this.GuideJumpEffectGo . transform.localPosition = Vector3.zero
this.GuideJumpEffectGo . transform.localScale = Vector3.one
Util.GetGameObject ( this.GuideJumpEffectGo , " GameObject " ) : SetActive ( false )
this.GuideJumpEffectGo : SetActive ( false )
this.btnFunHide [ FUNCTION_OPEN_TYPE.DAILY_TASK ] = this.btnDailyMission
this.btnFunHide [ FUNCTION_OPEN_TYPE.PRAY ] = this.paryGift
this.btnFunHide [ FUNCTION_OPEN_TYPE.SUNLONG ] = this.treasureOfSl
this.btnFunHide [ FUNCTION_OPEN_TYPE.EMAIL ] = this.btnYouJian
this.btnFunHide [ FUNCTION_OPEN_TYPE.GOODFRIEND ] = this.btnFriend
2020-06-18 20:39:29 +08:00
this.btnFunHide [ FUNCTION_OPEN_TYPE.ALLRANKING ] = this.btnRank
2020-05-09 13:31:21 +08:00
--this.btnFunGray[FUNCTION_OPEN_TYPE.NORMALCARBON] = this.btnFuBen
--this.btnFunGray[FUNCTION_OPEN_TYPE.MONSTER_COMING] = this.btnMonster
--this.btnFunGray[FUNCTION_OPEN_TYPE.ADVENTURE] = this.btnMijing
--this.btnFunGray[FUNCTION_OPEN_TYPE.RECURITY] = this.btnZhaomu
--this.btnFunGray[FUNCTION_OPEN_TYPE.ARENA] = this.btnJingjichang
--this.btnFunGray[FUNCTION_OPEN_TYPE.GUILD] = this.btnGonghui
--this.btnFunGray[FUNCTION_OPEN_TYPE.BLOODY_BATTLE] = this.btnXuezhandaodi
--this.btnFunGray[FUNCTION_OPEN_TYPE.HERO_RESOLVE] = this.btnFenjie
--this.btnFunGray[FUNCTION_OPEN_TYPE.HAND_BOOK] = this.btnTujian
--this.btnFunGray[FUNCTION_OPEN_TYPE.SHOP] = this.btnShangdian
--this.btnFunGray[FUNCTION_OPEN_TYPE.ALLRANKING] = this.btnPaihangbang
--this.btnFunGray[FUNCTION_OPEN_TYPE.ASPECT_STAR] = this.btnGuanxing
--this.btnFunGray[FUNCTION_OPEN_TYPE.RECURITY] = this.btnRecruit
--this.btnFunGray[FUNCTION_OPEN_TYPE.ELEMENT_RECURITY] = this.btnElementDrawCard
--this.btnFunGray[FUNCTION_OPEN_TYPE.SECRETBOX] = this.btnSecretBox
-- 隱藏秘境
--this.btnMijing:SetActive(false)
--跑马灯
--this.horseRaceLamp = Util.GetGameObject(self.gameObject, "horseRaceLamp")
--this.titleInfo = Util.GetGameObject(self.gameObject, "horseRaceLamp/bgImage/mask/titleInfo")
--this.horseMask = Util.GetGameObject(self.gameObject, "horseRaceLamp/bgImage/mask")
this.animRoot = Util.GetGameObject ( self.gameObject , " scene " )
this.btnSupreme = Util.GetGameObject ( self.gameObject , " RightUp/supreme " )
2020-07-25 20:35:32 +08:00
this.btnSupreme : SetActive ( false )
2020-05-09 13:31:21 +08:00
this.supremeRedPoint = Util.GetGameObject ( this.btnSupreme , " redPoint " )
this.supremeTime = Util.GetGameObject ( this.btnSupreme , " time " ) : GetComponent ( " Text " )
2020-06-13 11:47:13 +08:00
this.btnUpGradePackage = Util.GetGameObject ( self.gameObject , " RightUp/upGradePackageBtn " ) --升级限时礼包
2020-05-09 13:31:21 +08:00
this.btnGrowGift = Util.GetGameObject ( self.gameObject , " RightUp/growGift " )
this.btnGrowGift : SetActive ( false )
end
function this : SetPosFunc ( v2 )
self.bgTran . anchoredPosition = v2
for i = 1 , # moveSceneList do
moveTranList [ i ] . anchoredPosition = Vector2.New ( v2.x * moveSceneList [ i ] , v2.y )
end
local isShowLight = false
for i = 1 , # lightList do
if v2.x >= lightList [ i ] [ 1 ] and v2.x <= lightList [ i ] [ 2 ] then
isShowLight = true
break
end
end
if self.lightEffectActive ~= isShowLight then
self.lightEffect : SetActive ( isShowLight )
self.lightEffectActive = isShowLight
end
self.mountainTran . anchoredPosition = Vector2.New ( v2.x * 1.2 , v2.y )
end
--绑定事件(用于子类重写)
function this : BindEvent ( )
self.trigger = Util.GetEventTriggerListener ( self.ctrl )
self.moveTween = self.bg : GetComponent ( typeof ( UITweenSpring ) )
if not self.moveTween then
self.moveTween = self.bg : AddComponent ( typeof ( UITweenSpring ) )
end
self.moveTween . enabled = false
local setPosFunc = function ( v2 )
local av2 = self.bgTran . anchoredPosition
2020-06-18 20:39:29 +08:00
local dv2 = Vector2.New ( math.clamp ( v2.x + av2.x , - 1000 , 50 ) , av2.y )
if v2.x + av2.x < - 1000 or v2.x + av2.x > 50 then
2020-05-09 13:31:21 +08:00
self.moveTween : Rebound ( 1 , 0.1 )
end
this : SetPosFunc ( dv2 )
end
self.moveTween . OnUpdate = setPosFunc
self.moveTween . MomentumAmount = 1
self.moveTween . Strength = 1
self.trigger . onBeginDrag = self.trigger . onBeginDrag + function ( p , d )
self.moveTween . enabled = true
self.moveTween . Momentum = Vector3.zero
self.moveTween . IsUseCallBack = false
end
self.trigger . onDrag = self.trigger . onDrag + function ( p , d )
self.moveTween : LerpMomentum ( d.delta )
setPosFunc ( d.delta )
end
self.trigger . onEndDrag = self.trigger . onEndDrag + function ( p , d )
self.moveTween . IsUseCallBack = true
setPosFunc ( d.delta )
end
local btnClickMoveTran = this.btnClickMove : GetComponent ( " RectTransform " )
local rect = btnClickMoveTran.rect
math.randomseed ( os.time ( ) )
for i = 1 , 10 do
local view = MainPlayerView.New ( false , this.btnClickMove , rect , Vector2.New ( math.random ( rect.xMin , rect.xMax ) , math.random ( rect.yMin , rect.yMax ) ) )
view.NameText . text = NameManager.GetLocalRandomName ( )
view : SetAutoMove ( )
end
self.playerView = MainPlayerView.New ( true , this.btnClickMove , rect , Vector2.New ( - 1210 , 0 ) )
--角色点击行走
self.trigger . onPointerClick = self.trigger . onPointerClick + function ( p , d )
local x , v2 = RectTransformUtility.ScreenPointToLocalPointInRectangle ( btnClickMoveTran , Input.mousePosition , UIManager.camera , nil )
if not self.moveTween . enabled then
local b1 = v2.x < rect.xMax and v2.x > rect.xMin and v2.y < rect.yMax and v2.y > rect.yMin
if b1 then
self.playerView : SetRolePos ( v2 )
end
end
end
--GM工具
Util.AddClick ( this.headBox , function ( )
if AppConst.isOpenGM then
UIManager.OpenPanel ( UIName.GMPanel )
else
UIManager.OpenPanel ( UIName.SettingPanel )
end
end )
Util.AddClick ( this.questionnaireBtn , function ( )
QuestionnaireManager.OpenQuestionnairePanel ( )
end )
-- 充值按钮
Util.AddClick ( this.rechargeBtn , function ( )
2020-05-15 16:52:35 +08:00
-- if not ShopManager.IsActive(SHOP_TYPE.SOUL_STONE_SHOP) then
-- PopupTipPanel.ShowTip("商店暂未开放")
-- return
-- end
-- UIManager.OpenPanel(UIName.MainShopPanel, SHOP_TYPE.SOUL_STONE_SHOP)
UIManager.OpenPanel ( UIName.MainRechargePanel )
2020-05-09 13:31:21 +08:00
end )
--礼包
Util.AddClick ( this.packageGiftBtn , function ( )
2020-06-13 11:47:13 +08:00
UIManager.OpenPanel ( UIName.OperatingPanel )
2020-05-09 13:31:21 +08:00
end )
--特权
Util.AddClick ( this.vipPrivilegeBtn , function ( )
2020-05-25 19:16:23 +08:00
UIManager.OpenPanel ( UIName.VipPanelV2 )
2020-05-09 13:31:21 +08:00
end )
--首充
Util.AddClick ( this.firstRechargeBtn , function ( )
UIManager.OpenPanel ( UIName.FirstRechargePanel )
end )
--七日狂欢
Util.AddClick ( this.sevenDayCarnivalBtn , function ( )
UIManager.OpenPanel ( UIName.SevenDayCarnivalPanelV2 , SevenDayCarnivalManager.GetPriorityDayNumber ( ) )
end )
--每日首充
Util.AddClick ( this.dailyRechargeBtn , function ( )
UIManager.OpenPanel ( UIName.DailyRechargePanel )
end )
--超值基金
Util.AddClick ( this.upperMonthCardBtn , function ( )
UIManager.OpenPanel ( UIName.OperatingPanel , { tabIndex = 7 , extraParam = 2 , showType = 2 } )
end )
-- 百宝商会
Util.AddClick ( this.treasureStoreBtn , function ( )
UIManager.OpenPanel ( UIName.TreasureStorePopup )
end )
--八日登陆礼预览
Util.AddClick ( this.sgBtn , function ( )
--UIManager.OpenPanel(UIName.PassGiftPopup,true)ActivityTypeDef.SevenDayRegister
--JumpManager.GoJump(15001)
UIManager.OpenPanel ( UIName.EightDayGiftPanel )
end )
--日常任务
Util.AddClick ( this.btnDailyMission , function ( )
2020-06-13 11:47:13 +08:00
UIManager.OpenPanel ( UIName.MissionDailyPanel )
2020-05-09 13:31:21 +08:00
end )
--邮件
Util.AddClick ( this.btnYouJian , function ( )
UIManager.OpenPanel ( UIName.MailMainPanel )
end )
-- 精英怪
Util.AddClick ( this.btnJingying , function ( )
if not EliteMonsterManager.HasEliteMonster ( ) then
2020-06-23 18:36:24 +08:00
PopupTipPanel.ShowTip ( Language [ 10474 ] )
2020-05-09 13:31:21 +08:00
return
end
UIManager.OpenPanel ( UIName.EliteMonsterPanel , 1 )
end )
----打开招财猫
--Util.AddClick(this.luckyCatBtn, function()
-- UIManager.OpenPanel(UIName.LuckyCatPanel)
--end)
-- 打开开服有礼
Util.AddClick ( this.courtesyDress , function ( )
UIManager.OpenPanel ( UIName.CourtesyDressPanel )
end )
Util.AddClick ( this.paryGift , function ( )
UIManager.OpenPanel ( UIName.PrayMainPanel )
end )
Util.AddClick ( this.warPowerSort , function ( )
UIManager.OpenPanel ( UIName.WarPowerSortPanel )
end )
Util.AddClick ( this.expert , function ( )
UIManager.OpenPanel ( UIName.ExpertPanel )
end )
--戒灵秘宝
Util.AddClick ( this.treasureOfSl , function ( )
local page , extra = TreasureOfSomebodyManagerV2.GetTreasureRedPointShow ( )
UIManager.OpenPanel ( UIName.TreasureOfSomebodyPanelV2 , {
tabIndex = page ,
extraParam = extra
} )
end )
2020-05-25 19:16:23 +08:00
-- --天宫秘宝
-- Util.AddClick(this.treasureOfSl, function()
-- local page, extra = TreasureOfHeavenManagerV2.GetTreasureRedPointShow()
-- UIManager.OpenPanel(UIName.TreasureOfHeavenPanel, {
-- tabIndex = page,
-- extraParam = extra
-- })
-- end)
2020-05-09 13:31:21 +08:00
--东海寻仙
Util.AddClick ( this.findFairyBtn , function ( )
UIManager.OpenPanel ( UIName.FindFairyPanel )
end )
--幸运转盘
Util.AddClick ( this.luckyTurnBtn , function ( )
UIManager.OpenPanel ( UIName.LuckyTurnTablePanel )
end )
--成就
2020-06-03 19:09:01 +08:00
--Util.AddClick(this.AchievementBtn,function()
-- UIManager.OpenPanel(UIName.AchievementPanel)
--end)
2020-05-09 13:31:21 +08:00
--群英招募
Util.AddClick ( this.btnRecruit , function ( )
--UIManager.OpenPanel(UIName.RecruitPanel)
this.FunctionClickEvent ( FUNCTION_OPEN_TYPE.RECURITY , function ( )
UIManager.OpenPanel ( UIName.RecruitPanel )
end )
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.RECURITY )
end )
--元素招募
Util.AddClick ( this.btnElementDrawCard , function ( )
this.FunctionClickEvent ( FUNCTION_OPEN_TYPE.ELEMENT_RECURITY , function ( )
UIManager.OpenPanel ( UIName.ElementDrawCardPanel )
end )
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.ELEMENT_RECURITY )
end )
--秘盒
Util.AddClick ( this.btnSecretBox , function ( )
this.FunctionClickEvent ( FUNCTION_OPEN_TYPE.SECRETBOX , function ( )
UIManager.OpenPanel ( UIName.SecretBoxPanel )
end )
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.SECRETBOX )
end )
-- 给他一个点击事件吧,不然说个不停
Util.AddClick ( this.btnYunyou , function ( )
UIManager.OpenPanel ( UIName.MainShopPanel , SHOP_TYPE.ROAM_SHOP )
end )
-- 打开怪兽来袭界面t
Util.AddClick ( this.btnMonster , function ( )
JumpManager.GoJump ( 1011 )
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.MONSTER_COMING )
end )
--Util.AddClick(this.btnZhaomu, function()
-- if (RecruitManager.CheckRecuritRedPoint() or SecretBoxManager.CheckSecretRedPoint()) then
-- if (RecruitManager.CheckRecuritRedPoint()) then
-- JumpManager.GoJump(1023)
-- else
-- if(ActTimeCtrlManager.SingleFuncState(21)) then
-- if (SecretBoxManager.CheckSecretRedPoint()) then
-- JumpManager.GoJump(21001)
-- end
-- else
-- JumpManager.GoJump(1023)
-- end
-- end
-- else
-- JumpManager.GoJump(1023)
-- end
--end)
Util.AddClick ( this.btnJingjichang , function ( )
-- JumpManager.GoJump(8001)
if ( ActTimeCtrlManager.SingleFuncState ( FUNCTION_OPEN_TYPE.ARENA ) ) then
UIManager.OpenPanel ( UIName.ArenaTypePanel )
else
local tip = ActTimeCtrlManager.GetFuncTip ( FUNCTION_OPEN_TYPE.ARENA )
PopupTipPanel.ShowTip ( tip )
end
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.ARENA )
end )
2020-06-18 20:39:29 +08:00
Util.AddClick ( this.btnColorfulWorld , function ( )
2020-07-23 16:01:26 +08:00
if ActTimeCtrlManager.SingleFuncState ( FUNCTION_OPEN_TYPE.TRIAL ) then
UIManager.OpenPanel ( UIName.CarbonTypePanelV2 , 2 )
else
PopupTipPanel.ShowTip ( ActTimeCtrlManager.GetFuncTip ( FUNCTION_OPEN_TYPE.TRIAL ) )
end
2020-05-09 13:31:21 +08:00
end )
Util.AddClick ( this.btnFenjie , function ( )
JumpManager.GoJump ( 24001 )
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.HERO_RESOLVE )
end )
--Util.AddClick(this.btnTujian, function()
-- UIManager.OpenPanel(UIName.HandBookMainPanel)
-- this.ScenceBtnClick(FUNCTION_OPEN_TYPE.HAND_BOOK)
--end)
Util.AddClick ( this.btnShangdian , function ( )
JumpManager.GoJump ( 20003 )
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.SHOP )
end )
Util.AddClick ( this.btnEquipCompound , function ( )
--JumpManager.GoJump(20003)
--this.ScenceBtnClick(FUNCTION_OPEN_TYPE.SHOP)
if ActTimeCtrlManager.IsQualifiled ( 66 ) then
UIManager.OpenPanel ( UIName.CompoundPanel )
end
2020-06-19 20:19:35 +08:00
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.COMPOUND )
2020-05-09 13:31:21 +08:00
end )
2020-06-18 20:39:29 +08:00
Util.AddClick ( this.btnRank , function ( )
2020-05-09 13:31:21 +08:00
if ( ActTimeCtrlManager.SingleFuncState ( FUNCTION_OPEN_TYPE.ALLRANKING ) ) then
2020-06-08 13:57:30 +08:00
local types = { }
local activiteIds = { }
for i = 1 , # rankKingList do
2020-07-20 16:38:26 +08:00
if rankKingList [ i ] . isRankingMainPanelShow then
table.insert ( types , rankKingList [ i ] . rankType )
table.insert ( activiteIds , rankKingList [ i ] . activiteId )
end
2020-06-08 13:57:30 +08:00
end
NetManager.RankFirstRequest ( types , activiteIds , function ( msg )
UIManager.OpenPanel ( UIName.RankingListMainPanel , msg )
end )
2020-05-09 13:31:21 +08:00
else
local tip = ActTimeCtrlManager.GetFuncTip ( FUNCTION_OPEN_TYPE.ALLRANKING )
PopupTipPanel.ShowTip ( tip )
end
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.ALLRANKING )
end )
-- Util.AddClick(this.btnGuanxing, function()
-- JumpManager.GoJump(1024)
-- this.ScenceBtnClick(FUNCTION_OPEN_TYPE.ASPECT_STAR)
-- end)
-- 好友
Util.AddClick ( this.btnFriend , function ( )
UIManager.OpenPanel ( UIName.GoodFriendMainPanel )
end )
--Util.AddClick(this.btnSet, function()
-- UIManager.OpenPanel(UIName.SettingPanel)
--end)
--Util.AddClick(this.btnGonghuizhan, function()
-- if PlayerManager.familyId == 0 then
-- PopupTipPanel.ShowTip("尚未加入公会")
-- return
-- end
-- if not GuildFightManager.IsInGuildFight() then
-- PopupTipPanel.ShowTip("公会战未开始")
-- return
-- end
-- JumpManager.GoJump(4001)
--end)
-- 外敌(NPC按钮)
Util.AddClick ( this.btnAlienNPC , function ( )
this.FunctionClickEvent ( FUNCTION_OPEN_TYPE.FIGHT_ALIEN , function ( )
-- 外敌展示界面
local list = AdventureManager.GetAdventureEnemyList ( )
if not list or # list <= 0 or GetTimeStamp ( ) > list [ 1 ] . levelTime then
2020-06-23 18:36:24 +08:00
PopupTipPanel.ShowTip ( Language [ 10703 ] )
2020-05-09 13:31:21 +08:00
return
end
UIManager.OpenPanel ( UIName.MonsterShowPanel , list [ 1 ] . bossGroupId , function ( )
UIManager.OpenPanel ( UIName.FormationPanel , FORMATION_TYPE.ADVENTURE_BOSS , list [ 1 ] )
end , function ( ) end , true , 4 )
end )
end )
-- 场景中的外敌
Util.AddClick ( this.btnWaiDi , function ( )
this.FunctionClickEvent ( FUNCTION_OPEN_TYPE.FIGHT_ALIEN , function ( )
UIManager.OpenPanel ( UIName.AlienMainPanel )
end )
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.FIGHT_ALIEN )
end )
-- 天赋
-- Util.AddClick(this.btnTianFu, function ()
-- this.FunctionClickEvent(FUNCTION_OPEN_TYPE.TALENT_TREE, function ()
-- UIManager.OpenPanel(UIName.WorkShowTechnologPanel, 1)
-- end)
-- this.ScenceBtnClick(FUNCTION_OPEN_TYPE.TALENT_TREE)
-- end)
-- 异妖
Util.AddClick ( this.btnYiYao , function ( )
this.FunctionClickEvent ( FUNCTION_OPEN_TYPE.DIFFER_DEMONS , function ( )
UIManager.OpenPanel ( UIName.DiffMonsterPanel )
end )
this.ScenceBtnClick ( FUNCTION_OPEN_TYPE.DIFFER_DEMONS )
end )
Util.AddClick ( this.btnSupreme , function ( )
UIManager.OpenPanel ( UIName.SupremeHeroPopup )
end )
2020-06-13 11:47:13 +08:00
Util.AddClick ( this.btnUpGradePackage , function ( )
UIManager.OpenPanel ( UIName.UpGradePackagePanel )
end )
2020-05-09 13:31:21 +08:00
this.BindRedPoint ( )
end
--点击时检测功能
function this . FunctionClickEvent ( funcId , callback )
if not funcId or funcId == 0 or not callback then return end
local isOpen = ActTimeCtrlManager.SingleFuncState ( funcId )
if isOpen then
if callback then callback ( ) end
else
PopupTipPanel.ShowTip ( ActTimeCtrlManager.GetFuncTip ( funcId ) )
end
end
-- 所有按钮的额外点击事件
function this . ScenceBtnClick ( funcId )
if ActTimeCtrlManager.IsQualifiled ( funcId ) then
if funcId == FUNCTION_OPEN_TYPE.GUILD then
this.operateNewText [ FUNCTION_OPEN_TYPE.GUILD ] : SetActive ( false )
this.BtView : CheckMainCityNew ( )
end
end
FunctionOpenMananger.CleadNewText ( funcId )
end
-- 设置图标动画
function this . SetAnim ( )
local isOpen = FunctionOpenMananger.GetRootState ( PanelTypeView.MainCity )
if isOpen then
PlayUIAnim ( this.animRoot )
else
PlayUIAnimBack ( this.animRoot )
end
end
-- 绑定红点
function this . BindRedPoint ( )
-- 绑定红点
2020-05-15 16:52:35 +08:00
BindRedPointObject ( RedPointType.Recharge , this.rechargeRedPoint )
2020-05-09 13:31:21 +08:00
BindRedPointObject ( RedPointType.Operating , this.packageGiftRedPoint )
BindRedPointObject ( RedPointType.VipPrivilege , this.vipRedPoint )
BindRedPointObject ( RedPointType.FirstRecharge , this.firstRechargeRedPoint )
BindRedPointObject ( RedPointType.Mail , this.mailRedPoint )
2020-06-03 19:09:01 +08:00
BindRedPointObject ( RedPointType.DailyTaskMain , this.DailyRedPoint )
2020-05-09 13:31:21 +08:00
BindRedPointObject ( RedPointType.Shop , this.rpShangdian )
BindRedPointObject ( RedPointType.Shop_Roam_Check , this.rpYunyou )
BindRedPointObject ( RedPointType.TreasureOfSl , this.treasureOfSlRedPoint )
BindRedPointObject ( RedPointType.Expert , this.expertRedPoint )
BindRedPointObject ( RedPointType.WarPowerSort , this.warPowerSortRedPoint )
BindRedPointObject ( RedPointType.SevenDayCarnival , this.sevenDayCarnivalRedPoint )
BindRedPointObject ( RedPointType.DailyRecharge , this.dailyRechargeRedPoint )
BindRedPointObject ( RedPointType.CourtesyDress , this.courtesyDressRedPoint )
--BindRedPointObject(RedPointType.LuckyCat, this.luckyCatRedPoint)
--BindRedPointObject(RedPointType.SecretTer, this.rpMijing)
BindRedPointObject ( RedPointType.Arena , this.rpJingjichang )
BindRedPointObject ( RedPointType.Friend , this.friendRed )
2020-06-30 18:59:44 +08:00
BindRedPointObject ( RedPointType.RankingSort , this.rankRed )
2020-05-09 13:31:21 +08:00
--BindRedPointObject(RedPointType.Setting, this.setRed)
BindRedPointObject ( RedPointType.Setting , this.headRedpot )
--BindRedPointObject(RedPointType.Recruit, this.rpZhaomu)
2020-06-13 11:47:13 +08:00
-- BindRedPointObject(RedPointType.Guild, this.rpGonghui)
2020-05-09 13:31:21 +08:00
BindRedPointObject ( RedPointType.Recruit , this.rpRecruit )
BindRedPointObject ( RedPointType.SecretBox , this.rpSecretBox )
BindRedPointObject ( RedPointType.Alien , this.rpAlien )
BindRedPointObject ( RedPointType.DiffMonster , this.rpYiYao )
BindRedPointObject ( RedPointType.SupremeHero , this.supremeRedPoint )
BindRedPointObject ( RedPointType.LuckyTurn , this.luckyTurnRedPoint )
BindRedPointObject ( RedPointType.FindFairy , this.findFairyRedPoint )
2020-06-03 19:09:01 +08:00
--BindRedPointObject(RedPointType.Achievement_Main, this.AchievementRedPoint)
2020-05-09 13:31:21 +08:00
end
-- 绑定红点
function this . ClearRedPoint ( )
-- 绑定红点
2020-05-15 16:52:35 +08:00
ClearRedPointObject ( RedPointType.Recharge , this.rechargeRedPoint )
2020-05-09 13:31:21 +08:00
ClearRedPointObject ( RedPointType.Operating , this.packageGiftRedPoint )
ClearRedPointObject ( RedPointType.VipPrivilege , this.vipRedPoint )
ClearRedPointObject ( RedPointType.FirstRecharge , this.firstRechargeRedPoint )
ClearRedPointObject ( RedPointType.Mail , this.mailRedPoint )
2020-06-03 19:09:01 +08:00
ClearRedPointObject ( RedPointType.DailyTaskMain , this.DailyRedPoint )
2020-05-09 13:31:21 +08:00
ClearRedPointObject ( RedPointType.Shop , this.rpShangdian )
ClearRedPointObject ( RedPointType.Shop_Roam_Check , this.rpYunyou )
ClearRedPointObject ( RedPointType.TreasureOfSl , this.treasureOfSlRedPoint )
ClearRedPointObject ( RedPointType.Expert , this.expertRedPoint )
ClearRedPointObject ( RedPointType.WarPowerSort , this.warPowerSortRedPoint )
ClearRedPointObject ( RedPointType.SevenDayCarnival , this.sevenDayCarnivalRedPoint )
ClearRedPointObject ( RedPointType.DailyRecharge , this.dailyRechargeRedPoint )
ClearRedPointObject ( RedPointType.CourtesyDress , this.courtesyDressRedPoint )
--ClearRedPointObject(RedPointType.LuckyCat, this.luckyCatRedPoint)
--ClearRedPointObject(RedPointType.SecretTer, this.rpMijing)
ClearRedPointObject ( RedPointType.Arena , this.rpJingjichang )
ClearRedPointObject ( RedPointType.Friend , this.friendRed )
2020-06-30 18:59:44 +08:00
ClearRedPointObject ( RedPointType.RankingSort , this.rankRed )
2020-05-09 13:31:21 +08:00
--ClearRedPointObject(RedPointType.Setting, this.setRed)
ClearRedPointObject ( RedPointType.Setting , this.headRedpot )
--ClearRedPointObject(RedPointType.Recruit, this.rpZhaomu)
2020-06-13 11:47:13 +08:00
-- ClearRedPointObject(RedPointType.Guild, this.rpGonghui)
2020-05-09 13:31:21 +08:00
ClearRedPointObject ( RedPointType.Recruit , this.rpRecruit )
ClearRedPointObject ( RedPointType.SecretBox , this.rpSecretBox )
ClearRedPointObject ( RedPointType.Alien , this.rpAlien )
ClearRedPointObject ( RedPointType.DiffMonster , this.rpYiYao )
ClearRedPointObject ( RedPointType.SupremeHero , this.supremeRedPoint )
ClearRedPointObject ( RedPointType.LuckyTurn , this.luckyTurnRedPoint )
ClearRedPointObject ( RedPointType.FindFairy , this.findFairyRedPoint )
2020-06-03 19:09:01 +08:00
--ClearRedPointObject(RedPointType.Achievement_Main, this.AchievementRedPoint)
2020-05-09 13:31:21 +08:00
end
--添加事件监听(用于子类重写)
function this : AddListener ( )
Game.GlobalEvent : AddEvent ( GameEvent.Player . OnChangeName , this.RefreshChangeName )
Game.GlobalEvent : AddEvent ( GameEvent.FunctionCtrl . OnFunctionOpen , this.InitFuncShow )
Game.GlobalEvent : AddEvent ( GameEvent.FunctionCtrl . OnFunctionClose , this.InitFuncShow )
Game.GlobalEvent : AddEvent ( GameEvent.Activity . OnActivityOpenOrClose , this.RefreshActivityBtn )
2020-05-25 19:16:23 +08:00
-- Game.GlobalEvent:AddEvent(GameEvent.MissionDaily.OnMissionDailyChanged, this.RefreshMainTaskShow)
2020-05-09 13:31:21 +08:00
Game.GlobalEvent : AddEvent ( GameEvent.Activity . OnPatFaceRedRefresh , this.RefreshShowPatPaceActivity )
Game.GlobalEvent : AddEvent ( GameEvent.Questionnaire . OnQuestionnaireChange , this.OnQuestionnaireCallBack )
Game.GlobalEvent : AddEvent ( GameEvent.Adventure . OnEnemyListChanged , this.OnAlienListChanged )
Game.GlobalEvent : AddEvent ( GameEvent.Player . OnPlayerLvChange , this.RefreshPlayerInfoShow )
2020-05-15 16:52:35 +08:00
Game.GlobalEvent : AddEvent ( GameEvent.EightDay . GetRewardSuccess , this.RefreshEightGiftPreview )
Game.GlobalEvent : AddEvent ( GameEvent.FiveAMRefresh . ServerNotifyRefresh , this.RefreshEightGiftPreview )
2020-05-25 19:16:23 +08:00
Game.GlobalEvent : AddEvent ( GameEvent.FindFairy . RefreshBuyOpenState , this.RefreshGiftBtnShow )
2020-05-09 13:31:21 +08:00
end
--移除事件监听(用于子类重写)
function this : RemoveListener ( )
Game.GlobalEvent : RemoveEvent ( GameEvent.Player . OnChangeName , this.RefreshChangeName )
Game.GlobalEvent : RemoveEvent ( GameEvent.FunctionCtrl . OnFunctionOpen , this.InitFuncShow )
Game.GlobalEvent : RemoveEvent ( GameEvent.FunctionCtrl . OnFunctionClose , this.InitFuncShow )
Game.GlobalEvent : RemoveEvent ( GameEvent.Activity . OnActivityOpenOrClose , this.RefreshActivityBtn )
2020-05-25 19:16:23 +08:00
-- Game.GlobalEvent:RemoveEvent(GameEvent.MissionDaily.OnMissionDailyChanged, this.RefreshMainTaskShow)
2020-05-09 13:31:21 +08:00
Game.GlobalEvent : RemoveEvent ( GameEvent.Activity . OnPatFaceRedRefresh , this.RefreshShowPatPaceActivity )
Game.GlobalEvent : RemoveEvent ( GameEvent.Questionnaire . OnQuestionnaireChange , this.OnQuestionnaireCallBack )
Game.GlobalEvent : RemoveEvent ( GameEvent.Adventure . OnEnemyListChanged , this.OnAlienListChanged )
Game.GlobalEvent : RemoveEvent ( GameEvent.Player . OnPlayerLvChange , this.RefreshPlayerInfoShow )
2020-05-15 16:52:35 +08:00
Game.GlobalEvent : RemoveEvent ( GameEvent.EightDay . GetRewardSuccess , this.RefreshEightGiftPreview )
Game.GlobalEvent : RemoveEvent ( GameEvent.FiveAMRefresh . ServerNotifyRefresh , this.RefreshEightGiftPreview )
2020-05-25 19:16:23 +08:00
Game.GlobalEvent : RemoveEvent ( GameEvent.FindFairy . RefreshBuyOpenState , this.RefreshGiftBtnShow )
2020-05-09 13:31:21 +08:00
end
function this : OnSortingOrderChange ( )
self.sceneTran . gameObject : GetComponent ( " Canvas " ) . sortingOrder = self.sortingOrder - 4
Util.GetGameObject ( self.sceneTran . gameObject , " layer7 " ) : GetComponent ( " Canvas " ) . sortingOrder = self.sortingOrder - 3
this.npcRoot : GetComponent ( " Canvas " ) . sortingOrder = self.sortingOrder - 2
this.decorateRoot : GetComponent ( " Canvas " ) . sortingOrder = self.sortingOrder - 1
Util.AddParticleSortLayer ( this.btnClickMove , self.sortingOrder - orginLayer )
Util.AddParticleSortLayer ( this.sceneTran . gameObject , self.sortingOrder - orginLayer )
Util.AddParticleSortLayer ( this.mountainTran . gameObject , self.sortingOrder - orginLayer )
Util.AddParticleSortLayer ( Util.GetGameObject ( this.decorateRoot , " effect " ) , self.sortingOrder - orginLayer )
Util.AddParticleSortLayer ( this.sgEffect [ 1 ] , self.sortingOrder - orginLayer )
Util.AddParticleSortLayer ( this.sgEffect [ 2 ] , self.sortingOrder - orginLayer )
Util.AddParticleSortLayer ( this.vipPrivilegeBtn , self.sortingOrder - orginLayer )
if orginLayer < 100 then
Util.AddParticleSortLayer ( self.GuideEffectGo , self.sortingOrder )
Util.AddParticleSortLayer ( self.GuideJumpEffectGo , self.sortingOrder )
else
Util.AddParticleSortLayer ( self.GuideEffectGo , self.sortingOrder - orginLayer )
Util.AddParticleSortLayer ( self.GuideJumpEffectGo , self.sortingOrder - orginLayer )
end
orginLayer = self.sortingOrder
2020-06-08 13:57:30 +08:00
this.BtView : SetOrderStatus ( { sortOrder = self.sortingOrder } )
2020-05-09 13:31:21 +08:00
end
--界面打开时调用(用于子类重写)
function this : OnShow ( )
this.vipLevelText . sprite = VipManager.SetVipLevelImg ( )
timePressStarted = Time.realtimeSinceStartup
SoundManager.PlayMusic ( SoundConfig.BGM_Main )
this.level . text = PlayerManager.level
this.expSliderValue . value = PlayerManager.exp / PlayerManager.userLevelData [ PlayerManager.level ] . Exp
this.playName . text = PlayerManager.nickName
this.heroTeamPower . text = FormationManager.GetFormationPower ( FormationManager.curFormationIndex )
if not this.playerHead then
this.playerHead = SubUIManager.Open ( SubUIConfig.PlayerHeadView , this.headPos . transform )
end
this.playerHead : SetHead ( PlayerManager.head )
this.playerHead : SetFrame ( PlayerManager.frame )
this.playerHead : SetScale ( Vector3.one * 0.9 )
this.playerHead : SetPosition ( Vector3.New ( - 5 , 0 , 0 ) )
Log ( string.format ( " ---------------------%s " , BagManager.GetItemCountById ( 14 ) ) )
this.UpView : OnOpen ( { showType = UpViewOpenType.ShowRight , panelType = PanelType.Main } )
this.BtView : OnOpen ( { sortOrder = self.sortingOrder , panelType = PanelTypeView.MainCity } )
-- 刷新功能显示
this.InitFuncShow ( )
this.RefreshActivityShow ( )
this.RefreshFuncNewText ( )
2020-05-25 19:16:23 +08:00
this.RefreshGiftBtnShow ( )
2020-05-09 13:31:21 +08:00
-- 主界面time创建
endTime = ActivityGiftManager.GetTaskEndTime ( ActivityTypeDef.SupremeHero )
this.TimeFormat ( )
if not this._TimeCounter then
this._TimeCounter = Timer.New ( this.TimeFormat , 1 , - 1 , true )
this._TimeCounter : Start ( )
end
--
if ( AdventureManager.drop ~= nil and AdventureManager.offlineTime ~= 0 ) then
if AdventureManager.isFirstEnterGetReward and # AdventureManager.drop . itemlist > 0 then
UIManager.OpenPanel ( UIName.AdventureProgressPopup )
AdventureManager.isFirstEnterGetReward = false
end
end
-- 开始定时刷新聊天数据
this.ChatTipView : StartCheck ( )
--显示主线
2020-05-25 19:16:23 +08:00
-- this.RefreshMainTaskShow()
2020-05-09 13:31:21 +08:00
-- 刷新拍脸
local patFaceAllData = PatFaceManager.GetPatFaceAllDataTabs ( )
if patFaceAllData and # patFaceAllData <= 0 and not UIManager.IsOpen ( UIName.PatFacePanel ) then
2020-07-17 20:52:44 +08:00
if FirstRechargeManager.isFirstRecharge == 1 and FirstRechargeManager.PlayerPrefsGetStrItemId ( ) == 0 and ActTimeCtrlManager.IsQualifiled ( 38 ) and FirstRechargeManager.GetFirstRechargeExist ( ) then
2020-07-17 13:56:30 +08:00
FirstRechargeManager.PlayerPrefsSetStrItemId ( 1 )
UIManager.OpenPanel ( UIName.FirstRechargePanel , nil , function ( )
AdventureManager.GetIsMaxTime ( )
end )
else
AdventureManager.GetIsMaxTime ( )
end
2020-05-09 13:31:21 +08:00
end
--主城调了两边 所以做特殊判断
if not UIManager.IsOpen ( UIName.PatFacePanel ) then
this.RefreshShowPatPaceActivity ( )
end
2020-07-17 13:56:30 +08:00
2020-05-09 13:31:21 +08:00
-- 设置主城小人名字
if self.playerView then
self.playerView : SetName ( )
end
-- 检测公会tip
GuildManager.CheckGuildTip ( )
--远征主城红点
--Log("ExpeditionManager.GetNodeBoxnIsShowRedPoint() "..tostring(ExpeditionManager.GetNodeBoxnIsShowRedPoint() ))
--Log(" ExpeditionManager.GetActivityIsShowRedPoint(false) "..tostring( ExpeditionManager.GetActivityIsShowRedPoint(false)))
2020-06-30 18:59:44 +08:00
--this.rpExpedition:SetActive(ExpeditionManager.GetNodeBoxnIsShowRedPoint() or ExpeditionManager.GetActivityIsShowRedPoint(false))
2020-05-09 13:31:21 +08:00
--this.horseRaceLamp:SetActive(false)
--if UIManager.IsOpen(UIName.RewardItemSingleShowPopup) then
-- UIManager.ClosePanel(UIName.RewardItemSingleShowPopup)
--end
2020-06-30 18:59:44 +08:00
CheckRedPointStatus ( RedPointType.RankingSort )
2020-05-09 13:31:21 +08:00
end
-- 刷新玩家基础信息显示
function this . RefreshPlayerInfoShow ( )
this.vipLevelText . sprite = VipManager.SetVipLevelImg ( )
this.level . text = PlayerManager.level
this.expSliderValue . value = PlayerManager.exp / PlayerManager.userLevelData [ PlayerManager.level ] . Exp
this.playName . text = PlayerManager.nickName
this.heroTeamPower . text = FormationManager.GetFormationPower ( FormationManager.curFormationIndex )
end
local isCanShowMainTaskJumpEffect = true
function this : Update ( )
if curMianTaskData and curMianTaskData.state == 0 then
if isCanShowMainTaskJumpEffect then
if Time.realtimeSinceStartup - timePressStarted > 5 then
isCanShowMainTaskJumpEffect = false
this.GuideJumpEffectGo : SetActive ( true )
end
end
if Input.GetMouseButtonDown ( 0 ) then
timePressStarted = Time.realtimeSinceStartup
isCanShowMainTaskJumpEffect = true
this.GuideJumpEffectGo : SetActive ( false )
end
end
2020-06-13 11:47:13 +08:00
2020-06-03 19:09:01 +08:00
if Input.GetMouseButtonDown ( 1 ) then
if ActTimeCtrlManager.SingleFuncState ( 30 ) then
CarbonManager.difficulty = 2
local trialDataConfig = ConfigManager.GetConfig ( ConfigName.TrialConfig )
if MapTrialManager.curTowerLevel > 10000 then
2020-06-18 20:39:29 +08:00
MapManager.curMapId = MapTrialManager.GetSurprisedLevelMapId ( )
2020-06-03 19:09:01 +08:00
else
MapManager.curMapId = trialDataConfig [ MapTrialManager.curTowerLevel ] . MapId
end
NetManager.MapInfoRequest ( MapManager.curMapId , FormationTypeDef.FORMATION_DREAMLAND , function ( msg )
MapManager.isReloadEnter = false
MapTrialManager.firstEnter = true
MapManager.SetViewSize ( 20 ) --设置视野范围(明雷形式)
MapManager.curAreaId = FormationTypeDef.FORMATION_DREAMLAND
MapManager.trialHeroInfo = msg.infos
SwitchPanel.OpenPanel ( UIName.MapPanel )
end )
-- local curMapId = trialDataConfig[MapTrialManager.curTowerLevel].MapId
-- UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.CARBON, curMapId)
-- UIManager.OpenPanel(UIName.TrialCarbonPanel)
-- RedPointManager.PlayerPrefsSetStr(PlayerManager.uid .. "Trial", 1)
-- CheckRedPointStatus(RedPointType.EpicExplore_OpenCarbon)
-- this.RefreshOpenText(CARBON_TYPE.TRIAL, FUNCTION_OPEN_TYPE.TRIAL)
-- FunctionOpenMananger.CleadNewText(FUNCTION_OPEN_TYPE.TRIAL)
2020-07-16 16:59:46 +08:00
-- LogBlue(Language[11163])
2020-06-03 19:09:01 +08:00
else
PopupTipPanel.ShowTip ( ActTimeCtrlManager.GetFuncTip ( FUNCTION_OPEN_TYPE.TRIAL ) )
end
end
2020-05-09 13:31:21 +08:00
end
-- 刷新功能显示
function this . InitFuncShow ( funcType )
--判断开服有礼是否全部领完
if not funcType or funcType == FUNCTION_OPEN_TYPE.SERVER_START_GIFT then
if ActTimeCtrlManager.SingleFuncState ( FUNCTION_OPEN_TYPE.SERVER_START_GIFT ) then
if not ActivityGiftManager.onlineOpen and not ActivityGiftManager.sevenDayOpen and not ActivityGiftManager.chapterOpen then
this.courtesyDress : SetActive ( false )
else
this.courtesyDress : SetActive ( true )
end
else
this.courtesyDress : SetActive ( false )
end
if funcType == FUNCTION_OPEN_TYPE.SERVER_START_GIFT then
return
end
end
-- 公会战显示
2020-06-13 11:47:13 +08:00
-- if not funcType or funcType == FUNCTION_OPEN_TYPE.GUILD then
-- this.RefreshGuildFightShow()
-- end
2020-05-09 13:31:21 +08:00
-- 外敌npc显示
--if not funcType or funcType == FUNCTION_OPEN_TYPE.FIGHT_ALIEN then
-- local isAlienActive = ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.FIGHT_ALIEN)
-- if isAlienActive then
-- local list = AdventureManager.GetAdventureEnemyList()
-- if not list or #list <= 0 or GetTimeStamp() > list[1].levelTime then
-- this.alienNPC:SetActive(false)
-- else
-- this.alienNPC:SetActive(false) -- todo: 美术说暂时没有资源,策划说暂时隐藏,程序这里不让他显示
-- this.timeAlienNPC.text = TimeToHMS(list[1].levelTime - GetTimeStamp())
-- end
-- else
-- this.alienNPC:SetActive(false)
-- end
--end
-- 需要显示隐藏的功能检测
if funcType then
if this.btnFunHide [ funcType ] then
ActTimeCtrlManager.SetFuncLockState ( this.btnFunHide [ funcType ] , funcType , false )
return
end
else
for i , v in pairs ( this.btnFunHide ) do
ActTimeCtrlManager.SetFuncLockState ( v , i , false )
end
end
---- 新版解锁图标
if funcType then
if this.operateIcon [ funcType ] then
local isOpen = ActTimeCtrlManager.SingleFuncState ( funcType )
Util.SetColor ( this.operateIcon [ funcType ] . lock , Color.New ( 1 , 1 , 1 , 0.59 ) )
this.operateIcon [ funcType ] . lock : SetActive ( not isOpen )
this.operateIcon [ funcType ] . open : SetActive ( isOpen )
return
end
else
for i , v in pairs ( this.operateIcon ) do
local isOpen = ActTimeCtrlManager.SingleFuncState ( i )
v.lock : SetActive ( not isOpen )
Util.SetColor ( v.lock , Color.New ( 1 , 1 , 1 , 0.59 ) )
v.open : SetActive ( isOpen )
end
end
-- 精英怪按钮显隐设置
this.jingying : SetActive ( EliteMonsterManager.HasEliteMonster ( ) )
this.yunyou : SetActive ( ShopManager.IsActive ( SHOP_TYPE.ROAM_SHOP ) )
this.RefreshFuncNewText ( )
this.SetAnim ( )
end
function this . RefreshFuncNewText ( )
for i , v in pairs ( this.operateNewText ) do
--Log("当前ID是 === " .. i)
v : SetActive ( FunctionOpenMananger.GetModuleOpen ( i ) )
end
end
-- 时间格式化
function this . TimeFormat ( )
-- 如果逮到一个云游商人
local isRoamActive = ShopManager.IsActive ( SHOP_TYPE.ROAM_SHOP )
this.yunyou : SetActive ( isRoamActive )
if isRoamActive then
local closeTime = ShopManager.GetShopCloseTime ( SHOP_TYPE.ROAM_SHOP )
if closeTime >= 0 then
this.timeYunyou . text = TimeToMS ( closeTime )
end
end
-- 刷新精英怪
if this.jingying . activeSelf then
local leftTime = EliteMonsterManager.GetLeftTime ( )
this.eliteMonsterTimeText . text = TimeToMS ( leftTime )
if leftTime <= 0 then
this.jingying : SetActive ( false )
end
end
-- 判断是否显示工会战
2020-06-13 11:47:13 +08:00
-- this.RefreshGuildFightShow()
2020-05-09 13:31:21 +08:00
--local isShow = PlayerManager.familyId ~= 0 and GuildFightManager.IsInGuildFight()
--if this.isGHZShow ~= isShow then
-- this.RefreshGuildFightShow()
--end
-- 刷新外敌次数刷新时间
--if this.alienNPC.activeSelf then
-- local list = AdventureManager.GetAdventureEnemyList()
-- if not list or #list == 0 then
-- this.alienNPC:SetActive(false)
-- else
-- local curTimeStamp = GetTimeStamp()
-- local remainTime = list[1].levelTime - curTimeStamp
-- if remainTime <= 0 then
-- this.alienNPC:SetActive(false)
-- else
-- this.timeAlienNPC.text = TimeToHMS(remainTime)
-- end
-- end
--end
-- 显示活动倒计时
local isOpen = ActivityGiftManager.IsActivityTypeOpen ( ActivityTypeDef.SupremeHero )
2020-07-25 19:31:55 +08:00
if isOpen and isOpen > 0 and ActivityGiftManager.GetRewardState ( 42 ) ~= 3 then --活动开启并且未领取完毕
if endTime - PlayerManager.serverTime > 0 then
2020-05-09 13:31:21 +08:00
-- 第一次解锁
if supremHadSet then
2020-07-25 19:31:55 +08:00
--this.btnSupreme:SetActive(true)
this.btnSupreme : SetActive ( false )
2020-05-09 13:31:21 +08:00
end
this.supremeTime . text = TimeToHMS ( ( endTime - PlayerManager.serverTime ) )
supremHadSet = false
else
this.btnSupreme : SetActive ( false )
end
else
if not supremHadSet then
this.btnSupreme : SetActive ( false )
end
supremHadSet = true
end
2020-06-03 19:09:01 +08:00
-- 超值基金
local isOpen_128 = OperatingManager.IsBaseOpen ( GoodsTypeDef.MONTHCARD_128 )
local isOpen_328 = OperatingManager.IsBaseOpen ( GoodsTypeDef.MONTHCARD_328 )
local cardType = nil
if isOpen_328 then
cardType = GoodsTypeDef.MONTHCARD_328
end
if not cardType and isOpen_128 then
cardType = GoodsTypeDef.MONTHCARD_328
end
local isShow = false
if cardType then
-- local leftTime = OperatingManager.GetGoodsEndTime(cardType)
-- if leftTime and leftTime > 0 then
-- this.upperMonthCardTime.text = TimeToHMS(leftTime)
-- else
local data = OperatingManager.GetGiftGoodsInfo ( cardType )
if data then
this.upperMonthCardTime . text = TimeToHMS ( data.endTime - PlayerManager.serverTime )
isShow = true
end
-- end
end
if isUpperMonthCardTimeShow ~= isShow then
this.upperMonthCardTimeBg : SetActive ( isShow )
this.upperMonthCardTime . gameObject : SetActive ( isShow )
isUpperMonthCardTimeShow = isShow
end
2020-05-09 13:31:21 +08:00
2020-06-18 20:39:29 +08:00
--限时折扣
local giftList = { }
giftList = this : GetInfoList ( )
if giftList ~= 0 then
local conditon = false
for i = 1 , # giftList do
if giftList [ i ] . dynamicBuyTimes ~= 0 then
conditon = true
break
end
end
if conditon then
this.upGradePackageBtn : SetActive ( true )
this.upGradePackageTime . text = TimeToHMS ( giftList [ 1 ] . endTime - GetTimeStamp ( ) )
end
end
end
--为限时折扣写的
function this : GetInfoList ( )
local giftList = { }
local infoList = OperatingManager.GetGiftGoodsInfoList ( GoodsTypeDef.DirectPurchaseGift ) --拿取所有类型5礼包信息(包含需要的礼包)
local infoList2 = ConfigManager.GetAllConfigsDataByKey ( ConfigName.RechargeCommodityConfig , " ShowType " , 21 )
for index , value in pairs ( infoList ) do
for i = 1 , # infoList2 do
if infoList2 [ i ] . Id == value.goodsId then
table.insert ( giftList , value )
end
end
end
return giftList
2020-05-09 13:31:21 +08:00
end
-- function this:OnCloseBefore(action)
-- PlayUIAnimBacks(this.gameObject, action)
-- end
--界面关闭时调用(用于子类重写)
function this : OnClose ( )
-- 关闭定时刷新数据
this.ChatTipView : StopCheck ( )
PatFaceManager.isLogin = false
--if patFaceCallList then
-- patFaceCallList:Clear()
--end
end
--界面销毁时调用(用于子类重写)
function this : OnDestroy ( )
SubUIManager.Close ( this.UpView )
SubUIManager.Close ( this.BtView )
2020-05-25 19:16:23 +08:00
-- SubUIManager.Close(this.HorseRaceLampView)
2020-05-09 13:31:21 +08:00
SubUIManager.Close ( this.ChatTipView )
-- 清楚红点
this.ClearRedPoint ( )
-- 头像回收
if this.playerHead then
this.playerHead : Recycle ( )
this.playerHead = nil
end
-- 计时器
if this._TimeCounter then
this._TimeCounter : Stop ( )
this._TimeCounter = nil
end
if this.timer then
this.timer : Stop ( )
this.timer = nil
end
end
--更改姓名刷新
function this . RefreshChangeName ( )
if ( NameManager.GetRoleName ( ) ~= " " ) then
PlayerManager.nickName = NameManager.GetRoleName ( )
end
end
2020-05-25 19:16:23 +08:00
-- 刷新一些购买活动的按钮限时
function this . RefreshGiftBtnShow ( )
2020-06-03 19:09:01 +08:00
local isOpen_128 = OperatingManager.IsBaseOpen ( GoodsTypeDef.MONTHCARD_128 )
local isOpen_328 = OperatingManager.IsBaseOpen ( GoodsTypeDef.MONTHCARD_328 )
this.upperMonthCardBtn : SetActive ( isOpen_128 or isOpen_328 )
2020-06-18 20:39:29 +08:00
local isOpen_upgrade = OperatingManager.IsBaseOpen ( GoodsTypeDef.UpgradePackage )
this.upGradePackageBtn : SetActive ( isOpen_upgrade )
2020-05-25 19:16:23 +08:00
end
2020-05-09 13:31:21 +08:00
--后台推送
function this . RefreshActivityBtn ( context )
Log ( " context.type1 " .. context.type .. " " .. context.status )
if context.type == ActivityTypeDef.TreasureOfSomeBody then
if ActTimeCtrlManager.IsQualifiled ( 35 ) then
this.treasureOfSl : SetActive ( context.status == 1 )
end
elseif context.type == ActivityTypeDef.Pray then
this.paryGift : SetActive ( context.status == 1 )
elseif context.type == ActivityTypeDef.WarPowerSort then
if ActTimeCtrlManager.IsQualifiled ( 43 ) then
Log ( " context.type1 " .. context.type .. " " .. context.status )
this.warPowerSort : SetActive ( context.status == 1 )
end
elseif context.type == ActivityTypeDef.SevenDayCarnival then
if ActTimeCtrlManager.IsQualifiled ( 39 ) then
this.sevenDayCarnivalBtn : SetActive ( context.status == 1 )
if this.sevenDayCarnivalBtn . activeSelf then
this.SetSevenDayCarnivalName ( )
end
end
elseif context.type == ActivityTypeDef.FirstRecharge then
if ActTimeCtrlManager.IsQualifiled ( 38 ) then
this.firstRechargeBtn : SetActive ( context.status == 1 )
--if not this.firstRechargeBtn.activeSelf then
if ActTimeCtrlManager.IsQualifiled ( 41 ) then
this.dailyRechargeBtn : SetActive ( DailyRechargeManager.GetDailyRechargeExist ( ) )
end
--end
end
elseif context.type == ActivityTypeDef.DailyRecharge then
if ActTimeCtrlManager.IsQualifiled ( 41 ) then
--if not this.firstRechargeBtn.activeSelf then
this.dailyRechargeBtn : SetActive ( context.status == 1 )
--end
end
--elseif context.type == ActivityTypeDef.LuckyCat then
-- this.luckyCatBtn:SetActive(context.status == 1)
-- if(context.status == 1) then
-- LuckyCatManager.isOpenLuckyCat=true
-- else
-- LuckyCatManager.isOpenLuckyCat=false
-- end
elseif context.type == ActivityTypeDef.SupremeHero then
if ActivityGiftManager.IsActivityTypeOpen ( ActivityTypeDef.SupremeHero ) then
2020-07-25 19:31:55 +08:00
this.btnSupreme : SetActive ( false ) --ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.SupremeHero) > 0 and ActivityGiftManager.GetRewardState(42)~=3)
2020-05-09 13:31:21 +08:00
end
elseif context.type == ActivityTypeDef.FindFairy then
2020-06-28 17:48:49 +08:00
this.findFairyBtn : SetActive ( false ) --not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy))
2020-05-09 13:31:21 +08:00
end
if ActTimeCtrlManager.IsQualifiled ( 42 ) then
this.expert : SetActive ( ActivityGiftManager.GetExpertActiveisOpen ( ) > 0 )
end
end
--客户端自己Show刷新
function this . RefreshActivityShow ( )
if ActTimeCtrlManager.IsQualifiled ( 35 ) then
this.treasureOfSl : SetActive ( not not ActivityGiftManager.IsActivityTypeOpen ( ActivityTypeDef.TreasureOfSomeBody ) )
else
this.treasureOfSl : SetActive ( false )
end
if ActTimeCtrlManager.IsQualifiled ( 39 ) then
this.sevenDayCarnivalBtn : SetActive ( not not ActivityGiftManager.IsActivityTypeOpen ( ActivityTypeDef.SevenDayCarnival ) )
if this.sevenDayCarnivalBtn . activeSelf then
this.SetSevenDayCarnivalName ( )
end
else
this.sevenDayCarnivalBtn : SetActive ( false )
end
if ActTimeCtrlManager.IsQualifiled ( 38 ) then
this.firstRechargeBtn : SetActive ( FirstRechargeManager.GetFirstRechargeExist ( ) )
else
this.firstRechargeBtn : SetActive ( false )
end
if ActTimeCtrlManager.IsQualifiled ( 41 ) then
--if not this.firstRechargeBtn.activeSelf then
this.dailyRechargeBtn : SetActive ( DailyRechargeManager.GetDailyRechargeExist ( ) )
--else
-- this.dailyRechargeBtn:SetActive(false)
--end
else
this.dailyRechargeBtn : SetActive ( false )
end
if ActTimeCtrlManager.IsQualifiled ( 42 ) then
this.expert : SetActive ( ActivityGiftManager.GetExpertActiveisOpen ( ) > 0 )
else
this.expert : SetActive ( false )
end
if ActTimeCtrlManager.IsQualifiled ( 43 ) then
this.warPowerSort : SetActive ( not not ActivityGiftManager.IsActivityTypeOpen ( ActivityTypeDef.WarPowerSort ) )
else
this.warPowerSort : SetActive ( false )
end
2020-05-15 16:52:35 +08:00
--八日登陆
this.RefreshEightGiftPreview ( )
2020-05-09 13:31:21 +08:00
--东海寻仙
2020-06-28 17:48:49 +08:00
this.findFairyBtn : SetActive ( false ) --not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy))
2020-05-09 13:31:21 +08:00
--幸运转盘
this.luckyTurnBtn : SetActive ( ActTimeCtrlManager.IsQualifiled ( FUNCTION_OPEN_TYPE.LUCKYTURN ) )
2020-06-03 19:09:01 +08:00
--this.AchievementBtn:SetActive(ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.Achiecement))
2020-05-09 13:31:21 +08:00
--远征
--this.expeditionBtn:SetActive(ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.EXPEDITION))
this.paryGift : SetActive ( not not ActivityGiftManager.IsActivityTypeOpen ( ActivityTypeDef.Pray ) )
--this.luckyCatBtn:SetActive(not not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LuckyCat))
2020-07-21 11:31:05 +08:00
this.rechargeBtn : SetActive ( ActTimeCtrlManager.IsQualifiled ( 36 ) ) --ActTimeCtrlManager.IsQualifiled(36))
2020-05-09 13:31:21 +08:00
this.packageGiftBtn : SetActive ( ActTimeCtrlManager.IsQualifiled ( 40 ) )
this.questionnaireBtn : SetActive ( QuestionnaireManager.GetQuestionState ( ) == 0 )
end
function this . SetSevenDayCarnivalName ( )
if this.sevenDayCarnivalBtn . activeSelf then
local activityId = ActivityGiftManager.IsActivityTypeOpen ( ActivityTypeDef.SevenDayCarnival )
this.SevenDayStage1 : SetActive ( activityId == 10 )
this.SevenDayStage2 : SetActive ( activityId ~= 10 )
end
end
function this . OnQuestionnaireCallBack ( )
this.questionnaireBtn : SetActive ( QuestionnaireManager.GetQuestionState ( ) == 0 )
end
2020-05-25 19:16:23 +08:00
-- function this.RefreshMainTaskShow()
-- curMianTaskData = TaskManager.GetMianTaskCurActiveTaskData()
-- if curMianTaskData then
-- local curSConFigData = ConfigManager.GetConfigData(ConfigName.BeginnerTask, curMianTaskData.missionId)
-- if curSConFigData then
-- this.titleText.text = curSConFigData.Show .. " "
-- this.progressText.text = "(" .. curMianTaskData.progress .. "/" .. curSConFigData.TaskValue[2][1] .. ")"
-- if curMianTaskData.state == 0 then
-- this.mainTaskGRewardImage:SetActive(false)
-- this.mainTaskJumpImage:SetActive(true)
-- elseif curMianTaskData.state == 1 then
-- this.mainTaskGRewardImage:SetActive(true)
-- this.mainTaskJumpImage:SetActive(false)
-- elseif curMianTaskData.state == 2 then
-- this.mainTaskGRewardImage:SetActive(false)
-- this.mainTaskJumpImage:SetActive(true)
-- end
-- Util.AddOnceClick(this.getRewardButton, function()
-- if curMianTaskData.state == 0 then
-- JumpManager.GoJump(curSConFigData.Jump[1])
-- elseif curMianTaskData.state == 1 then
-- NetManager.TakeMissionRewardRequest(TaskTypeDef.MainTask, curMianTaskData.missionId, function(msg)
-- UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1, function()
-- this.RefreshMainTaskShow()
-- end)
-- end)
-- elseif curMianTaskData.state == 2 then
-- PopupTipPanel.ShowTip("已领取!")
-- this.RefreshMainTaskShow()
-- end
-- end)
-- this.mainTask:SetActive(true)
-- end
-- else
-- this.mainTask:SetActive(false)
-- end
-- this.mainTask:SetActive(false)
-- end
2020-05-09 13:31:21 +08:00
function this . RefreshShowPatPaceActivity ( )
local patFaceAllData = PatFaceManager.GetPatFaceAllDataTabs ( )
if patFaceAllData and not GuideManager.IsFunctionGuideExist ( ) then
Log ( " #patFaceAllData " .. # patFaceAllData )
if # patFaceAllData > 0 then
this.patFaceCallList : Clear ( )
this.patFaceCallList : Push ( function ( )
2020-06-23 18:36:24 +08:00
Log ( Language [ 10583 ] )
2020-05-09 13:31:21 +08:00
Game.GlobalEvent : DispatchEvent ( GameEvent.PatFace . PatFaceSendFinish )
AdventureManager.GetIsMaxTime ( )
end )
for i = # patFaceAllData , 1 , - 1 do
this.patFaceCallList : Push ( function ( )
PatFaceManager.SetisFirstLogVal ( 1 , { patFaceAllData [ i ] } )
UIManager.OpenPanel ( UIName.PatFacePanel , patFaceAllData [ i ] , function ( )
local time2 = Timer.New ( function ( )
this.patFaceCallList : Pop ( ) ( )
end , 0.5 )
time2 : Start ( )
end )
end )
end
this.patFaceCallList : Pop ( ) ( )
else
Game.GlobalEvent : DispatchEvent ( GameEvent.PatFace . PatFaceSendFinish )
end
end
end
-- 外敌数据变化检测主界面npc显示状态
function this . OnAlienListChanged ( )
this.InitFuncShow ( FUNCTION_OPEN_TYPE.FIGHT_ALIEN )
end
2020-05-15 16:52:35 +08:00
--八日登录奖励预览
function this . RefreshEightGiftPreview ( )
2020-06-18 20:39:29 +08:00
local state = false
local getRewardState = ActivityGiftManager.sevenDayGetRewardState
for i , v in pairs ( getRewardState ) do
if ( v == 0 ) then
state = true
2020-05-15 16:52:35 +08:00
end
2020-06-18 20:39:29 +08:00
end
if ActivityGiftManager.IsActivityTypeOpen ( ActivityTypeDef.EightDayGift ) and state then
this.RefreshSevenGiftPreview ( )
this.sgBtn : SetActive ( true )
2020-05-15 16:52:35 +08:00
else
this.sgBtn : SetActive ( false )
end
end
2020-05-09 13:31:21 +08:00
-- 七日登陆奖励预览
function this . RefreshSevenGiftPreview ( )
--判断今日是否有可领取
local isHaveGift = ActivityGiftManager.CheckSevenDayRed ( )
2020-06-23 18:36:24 +08:00
local curDay = math.ceil ( ( CalculateSecondsNowTo_N_OClock ( 24 ) + GetTimeStamp ( ) - PlayerManager.userCreateTime ) / 86400 )
2020-05-09 13:31:21 +08:00
local itemId = 0
if isHaveGift then
local haveGiftList = nil
for j = 1 , # ActivityGiftManager.sevenDayGetRewardState do
2020-06-23 18:36:24 +08:00
if ActivityGiftManager.sevenDayGetRewardState [ j ] == 0 and j <= curDay then
2020-05-09 13:31:21 +08:00
if haveGiftList == nil then
2020-06-18 20:39:29 +08:00
haveGiftList = ConfigManager.GetConfigDataByDoubleKey ( ConfigName.ActivityRewardConfig , " ActivityId " , 56 , " Sort " , j )
2020-05-09 13:31:21 +08:00
end
end
end
itemId = haveGiftList.Reward [ 1 ] [ 1 ]
2020-05-25 19:16:23 +08:00
local Gift = ConfigManager.GetConfigDataByKey ( ConfigName.ItemConfig , " Id " , itemId )
this.sgType . text = Gift.Name
2020-06-23 18:36:24 +08:00
this.sgInfo . text = Language [ 11164 ]
2020-05-09 13:31:21 +08:00
this.sgEffect [ 1 ] . gameObject : SetActive ( false )
this.sgEffect [ 2 ] . gameObject : SetActive ( true )
else
2020-05-15 16:52:35 +08:00
if ( ActivityGiftManager.canRewardDay + 1 ) >= 9 then
2020-05-09 13:31:21 +08:00
return
end
for i , v in pairs ( ActivityGiftManager.sevenDayData ) do
2020-06-23 18:36:24 +08:00
if v.Id == curDay + 1 then
2020-05-09 13:31:21 +08:00
itemId = v.Reward [ 1 ] [ 1 ]
2020-05-25 19:16:23 +08:00
local Gift = ConfigManager.GetConfigDataByKey ( ConfigName.ItemConfig , " Id " , itemId )
this.sgType . text = Gift.Name
2020-05-09 13:31:21 +08:00
break
end
end
2020-06-23 18:36:24 +08:00
this.sgInfo . text = Language [ 11165 ]
2020-05-09 13:31:21 +08:00
this.sgEffect [ 1 ] . gameObject : SetActive ( true )
this.sgEffect [ 2 ] . gameObject : SetActive ( false )
end
this.sgItemView : OnOpen ( false , { itemId , 0 } , 0.73 )
this.sgName . text = ConfigManager.GetConfigData ( ConfigName.ItemConfig , itemId ) . Name
end
-- 刷新公会战图标显示
2020-06-13 11:47:13 +08:00
-- function this.RefreshGuildFightShow()
-- local isActive = ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.GUILD)
-- local isInGuild = PlayerManager.familyId ~= 0
-- local isInFight = GuildFightManager.IsInGuildFight()
-- local isShow = isActive and isInFight and isInGuild
-- if not isShow then
-- if not this.isGHZShow then return end
-- this.GHZStageAttackEffect:SetActive(false)
-- this.GHZStageImage.gameObject:SetActive(false)
-- this.isGHZShow = false
-- this.GHZ_Stage = nil
-- else
-- local curStage = GuildFightManager.GetCurFightStage()
-- if this.GHZ_Stage ~= curStage then
-- if curStage == GUILD_FIGHT_STAGE.ATTACK then
-- this.GHZStageAttackEffect:SetActive(true)
-- this.GHZStageImage.gameObject:SetActive(false)
-- else
-- this.GHZStageAttackEffect:SetActive(false)
-- local imgName = GHZ_STAGE_IMAGE[curStage]
-- if not imgName then
-- this.GHZStageImage.gameObject:SetActive(false)
-- else
-- this.GHZStageImage.gameObject:SetActive(true)
-- this.GHZStageImage.sprite = Util.LoadSprite(imgName)
-- end
-- end
-- this.GHZ_Stage = curStage
-- end
-- this.isGHZShow = true
-- end
-- end
2020-06-23 18:36:24 +08:00
return MainPanel