|
|
|
|
@ -3,73 +3,268 @@ CarbonTypePanelV2 = Inherit(BasePanel)
|
|
|
|
|
local this = CarbonTypePanelV2
|
|
|
|
|
local hasFresh = false
|
|
|
|
|
local orginLayer = 0
|
|
|
|
|
|
|
|
|
|
local type = {
|
|
|
|
|
[1] = {
|
|
|
|
|
title = "r_Dungeon_tonghefuben",
|
|
|
|
|
titlePos = Vector2(0, 1053.333),
|
|
|
|
|
titleSize = Vector2(308.8, 66.9),
|
|
|
|
|
namePos = Vector2(-300, 0),
|
|
|
|
|
nameSize = Vector2(247, 244),
|
|
|
|
|
[1] = {
|
|
|
|
|
id = FUNCTION_OPEN_TYPE.DAILYCHALLENGE_COIN, --日常
|
|
|
|
|
bg = "r_Dungeon_rendi_01",
|
|
|
|
|
name = "r_Dungeon_richangfuben",
|
|
|
|
|
live = "lingjijuyuan",
|
|
|
|
|
livePos = Vector2(149, 13),
|
|
|
|
|
liveSize = Vector2(1024, 1145)
|
|
|
|
|
},
|
|
|
|
|
[2] = {
|
|
|
|
|
id = 1011, --心魔
|
|
|
|
|
bg = "r_Dungeon_rendi_02",
|
|
|
|
|
name = "r_Dungeon_xinmoshilian",
|
|
|
|
|
live = "shixueguimo",
|
|
|
|
|
livePos = Vector2(77, -218),
|
|
|
|
|
liveSize = Vector2(1024, 1145)
|
|
|
|
|
},
|
|
|
|
|
[3] = {
|
|
|
|
|
id = FUNCTION_OPEN_TYPE.EXPEDITION, --大闹天宫
|
|
|
|
|
bg = "r_Dungeon_rendi_03",
|
|
|
|
|
name = "r_Dungeon_danaotiangong",
|
|
|
|
|
live = "w_wd_boss",
|
|
|
|
|
livePos = Vector2(192, 0),
|
|
|
|
|
liveSize = Vector2(1024, 1145)
|
|
|
|
|
},
|
|
|
|
|
[4] = {
|
|
|
|
|
id = 46, --车迟斗法
|
|
|
|
|
bg = "r_Dungeon_rendi_04",
|
|
|
|
|
name = "r_Dungeon_chechidoufa",
|
|
|
|
|
live = "m_syjm_0026_png",
|
|
|
|
|
livePos = Vector2(334, 32),
|
|
|
|
|
liveSize = Vector2(1024, 1145)
|
|
|
|
|
},
|
|
|
|
|
default = {id = -1,bg = "r_Dungeon_rendi_01"}
|
|
|
|
|
},
|
|
|
|
|
[2] = {
|
|
|
|
|
title = "r_Dungeon_wanxiangjing",
|
|
|
|
|
titlePos = Vector2(0, 1075.5),
|
|
|
|
|
titleSize = Vector2(293, 90),
|
|
|
|
|
namePos = Vector2(-323.01, 0),
|
|
|
|
|
nameSize = Vector2(257, 268),
|
|
|
|
|
[1] = {
|
|
|
|
|
id = 30, --森罗
|
|
|
|
|
bg = "r_Dungeon_rendi_03",
|
|
|
|
|
name = "r_Dungeon_senluohuanjing",
|
|
|
|
|
live = "m_chsm_0035",
|
|
|
|
|
livePos = Vector2(274.5, -408.1),
|
|
|
|
|
liveSize = Vector2(1612, 1802)
|
|
|
|
|
},
|
|
|
|
|
default = {id = -1,bg = "r_Dungeon_rendi_01"}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
local carbonType = 0
|
|
|
|
|
local carbons = {}
|
|
|
|
|
--初始化组件(用于子类重写)
|
|
|
|
|
function CarbonTypePanelV2:InitComponent()
|
|
|
|
|
this.btnNormal = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/normalRoot") -- 剧情
|
|
|
|
|
this.btnLegend = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/trialRoot") -- 无尽
|
|
|
|
|
this.btnEpic = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/eliteRoot") -- 试炼
|
|
|
|
|
this.btnHero = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/otherRoot") -- 精英
|
|
|
|
|
--日常副本
|
|
|
|
|
this.dailyCarbonBtn=Util.GetGameObject(self.gameObject,"DailyCarbonBtn")
|
|
|
|
|
this.dailyCarbonBtn = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/DailyCarbonBtn")
|
|
|
|
|
table.insert(carbons, this.dailyCarbonBtn)
|
|
|
|
|
this.btnEpic = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/eliteRoot")
|
|
|
|
|
table.insert(carbons, this.btnEpic)
|
|
|
|
|
this.btnNormal = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/normalRoot")
|
|
|
|
|
table.insert(carbons, this.btnNormal)
|
|
|
|
|
this.btnLegend = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/trialRoot")
|
|
|
|
|
table.insert(carbons, this.btnLegend)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.title = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/title")
|
|
|
|
|
this.effect = Util.GetGameObject(self.gameObject, "CarbonTypePanel_effect")
|
|
|
|
|
this.wind = Util.GetGameObject(self.gameObject, "CarbonTypePanel_effect/juneng_chenggong/GameObject")
|
|
|
|
|
|
|
|
|
|
orginLayer = 0
|
|
|
|
|
|
|
|
|
|
this.zonghe = Util.GetGameObject(self.gameObject, "BgRoot/GameObject")
|
|
|
|
|
this.backBtn = Util.GetGameObject(self.gameObject, "backBtn")
|
|
|
|
|
|
|
|
|
|
--头像、战力
|
|
|
|
|
this.level = Util.GetGameObject(self.gameObject, "BgRoot/LeftUp/headBox/lvFrame/lv"):GetComponent("Text")
|
|
|
|
|
this.playName = Util.GetGameObject(self.gameObject, "BgRoot/LeftUp/headBox/name"):GetComponent("Text")
|
|
|
|
|
this.expSliderValue = Util.GetGameObject(self.gameObject, "BgRoot/LeftUp/headBox/exp"):GetComponent("Slider")
|
|
|
|
|
this.headBox = Util.GetGameObject(self.gameObject, "BgRoot/LeftUp/headBox")
|
|
|
|
|
this.headPos = Util.GetGameObject(self.gameObject, "BgRoot/LeftUp/headBox/headpos")
|
|
|
|
|
this.headRedpot = Util.GetGameObject(self.gameObject, "BgRoot/LeftUp/headBox/redpot")
|
|
|
|
|
this.teamPower = Util.GetGameObject(self.gameObject, "BgRoot/LeftUp/powerBtn/value"):GetComponent("Text")
|
|
|
|
|
this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform)
|
|
|
|
|
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
|
|
|
|
|
this.level = Util.GetGameObject(this.zonghe, "LeftUp/headBox/lvFrame/lv"):GetComponent("Text")
|
|
|
|
|
this.playName = Util.GetGameObject(this.zonghe, "LeftUp/headBox/name"):GetComponent("Text")
|
|
|
|
|
this.expSliderValue = Util.GetGameObject(this.zonghe, "LeftUp/headBox/exp"):GetComponent("Slider")
|
|
|
|
|
this.headBox = Util.GetGameObject(this.zonghe, "LeftUp/headBox")
|
|
|
|
|
this.headPos = Util.GetGameObject(this.zonghe, "LeftUp/headBox/headpos")
|
|
|
|
|
this.headRedpot = Util.GetGameObject(this.zonghe, "LeftUp/headBox/redpot")
|
|
|
|
|
this.teamPower = Util.GetGameObject(this.zonghe, "LeftUp/powerBtn/value"):GetComponent("Text")
|
|
|
|
|
|
|
|
|
|
-- 特权
|
|
|
|
|
this.vipPrivilegeBtn = Util.GetGameObject(self.gameObject, "BgRoot/LeftUp/vipPrivilege/vipPrivilegeBtn")
|
|
|
|
|
this.vipPrivilegeBtn = Util.GetGameObject(this.zonghe, "LeftUp/vipPrivilege/vipPrivilegeBtn")
|
|
|
|
|
this.vipLevelText = Util.GetGameObject(this.vipPrivilegeBtn, "bg/vip"):GetComponent("Image")
|
|
|
|
|
this.vipRedPoint = Util.GetGameObject(self.gameObject, "BgRoot/LeftUp/vipPrivilege/redPoint")
|
|
|
|
|
this.vipRedPoint = Util.GetGameObject(this.zonghe, "LeftUp/vipPrivilege/redPoint")
|
|
|
|
|
screenAdapte(this.vipPrivilegeBtn)
|
|
|
|
|
|
|
|
|
|
this.AnimRoot = Util.GetGameObject(self.gameObject, "btnRoot/circle/root")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform)
|
|
|
|
|
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local index = 1
|
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
|
function CarbonTypePanelV2:BindEvent()
|
|
|
|
|
BindRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
|
|
|
|
|
Util.AddClick(
|
|
|
|
|
this.backBtn,
|
|
|
|
|
function()
|
|
|
|
|
this:ClosePanel()
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
-- BindRedPointObject(RedPointType.OrdinaryExplore, Util.GetGameObject(this.btnNormal, "redPoint"))
|
|
|
|
|
-- BindRedPointObject(RedPointType.EpicExplore, Util.GetGameObject(this.btnEpic, "redPoint"))
|
|
|
|
|
-- BindRedPointObject(RedPointType.HeroExplore, Util.GetGameObject(this.btnHero, "redPoint"))
|
|
|
|
|
-- BindRedPointObject(RedPointType.LegendExplore, Util.GetGameObject(this.btnLegend, "redPoint"))
|
|
|
|
|
-- 点击你的猪头
|
|
|
|
|
Util.AddClick(
|
|
|
|
|
this.headBox,
|
|
|
|
|
function()
|
|
|
|
|
UIManager.OpenPanel(UIName.SettingPanel)
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
BindRedPointObject(RedPointType.Setting, this.headRedpot)
|
|
|
|
|
|
|
|
|
|
-- 剧情副本(现改为猎妖之路)
|
|
|
|
|
Util.AddClick(this.btnNormal, function()
|
|
|
|
|
-- if ActTimeCtrlManager.SingleFuncState(17) then
|
|
|
|
|
-- CarbonManager.difficulty = 1
|
|
|
|
|
-- local jumpCarbonId = CarbonManager.NeedLockId(100, 1)
|
|
|
|
|
-- UIManager.OpenPanel(UIName.PlotCarbonPanel, jumpCarbonId)
|
|
|
|
|
-- CheckRedPointStatus(RedPointType.NormalExplore_OpenMap)
|
|
|
|
|
-- this.RefreshOpenText(CARBON_TYPE.NORMAL, FUNCTION_OPEN_TYPE.NORMALCARBON)
|
|
|
|
|
-- FunctionOpenMananger.CleadNewText( FUNCTION_OPEN_TYPE.NORMALCARBON)
|
|
|
|
|
-- else
|
|
|
|
|
-- PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip( FUNCTION_OPEN_TYPE.NORMALCARBON))
|
|
|
|
|
-- end
|
|
|
|
|
Util.AddClick(
|
|
|
|
|
this.vipPrivilegeBtn,
|
|
|
|
|
function()
|
|
|
|
|
UIManager.OpenPanel(UIName.VipPanelV2)
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
|
function CarbonTypePanelV2:AddListener()
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--移除事件监听(用于子类重写)
|
|
|
|
|
function CarbonTypePanelV2:RemoveListener()
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
--副本类型 1 综合 2 万象
|
|
|
|
|
function CarbonTypePanelV2:OnOpen(_type)
|
|
|
|
|
carbonType = _type
|
|
|
|
|
LogBlue("carbonType1:"..carbonType)
|
|
|
|
|
if carbonType == 1 then
|
|
|
|
|
-- 清除一下选得副本类型
|
|
|
|
|
CarbonManager.difficulty = 0
|
|
|
|
|
this.BtView.gameObject:SetActive(true)
|
|
|
|
|
this.BtView:OnOpen({sortOrder = self.sortingOrder, panelType = PanelTypeView.Carbon})
|
|
|
|
|
this.UpView:OnOpen({showType = UpViewOpenType.ShowRight, panelType = PanelType.Main})
|
|
|
|
|
elseif carbonType == 2 then
|
|
|
|
|
this.BtView.gameObject:SetActive(false)
|
|
|
|
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
|
|
|
|
else
|
|
|
|
|
-- 清除一下选得副本类型
|
|
|
|
|
CarbonManager.difficulty = 0
|
|
|
|
|
this.BtView.gameObject:SetActive(true)
|
|
|
|
|
this.BtView:OnOpen({sortOrder = self.sortingOrder, panelType = PanelTypeView.Carbon})
|
|
|
|
|
this.UpView:OnOpen({showType = UpViewOpenType.ShowRight, panelType = PanelType.Main})
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面打开时调用(用于子类重写)
|
|
|
|
|
function CarbonTypePanelV2:OnShow(...)
|
|
|
|
|
this.title:GetComponent("Image").sprite = Util.LoadSprite(type[carbonType].title)
|
|
|
|
|
this.title:GetComponent("RectTransform").localPosition = type[carbonType].titlePos
|
|
|
|
|
this.title:GetComponent("RectTransform").sizeDelta = type[carbonType].titleSize
|
|
|
|
|
if carbonType == 1 then
|
|
|
|
|
this.zonghe.gameObject:SetActive(true)
|
|
|
|
|
this.backBtn.gameObject:SetActive(false)
|
|
|
|
|
this.FreshPlayerInfo()
|
|
|
|
|
this.SetPlayerHead()
|
|
|
|
|
elseif carbonType == 2 then
|
|
|
|
|
this.zonghe.gameObject:SetActive(false)
|
|
|
|
|
this.backBtn.gameObject:SetActive(true)
|
|
|
|
|
else
|
|
|
|
|
this.zonghe.gameObject:SetActive(true)
|
|
|
|
|
this.backBtn.gameObject:SetActive(false)
|
|
|
|
|
this.FreshPlayerInfo()
|
|
|
|
|
this.SetPlayerHead()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
this.UpdateCarbonContent()
|
|
|
|
|
-- 音效
|
|
|
|
|
SoundManager.PlayMusic(SoundConfig.BGM_Carbon)
|
|
|
|
|
-- 播放动画
|
|
|
|
|
|
|
|
|
|
-- CarbonTypePanelV2:PlayAni()
|
|
|
|
|
CarbonManager.GetMissionLevelData()
|
|
|
|
|
this.PlayScaleAnim()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this.UpdateCarbonContent()
|
|
|
|
|
if not carbons then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
for k,v in ipairs(carbons) do
|
|
|
|
|
local data
|
|
|
|
|
if not type[carbonType][k] then
|
|
|
|
|
data = type[carbonType].default
|
|
|
|
|
else
|
|
|
|
|
data = type[carbonType][k]
|
|
|
|
|
end
|
|
|
|
|
Util.GetGameObject(v, "bg"):GetComponent("Image").sprite = Util.LoadSprite(data.bg)
|
|
|
|
|
local live = Util.GetGameObject(v, "bg/Live")
|
|
|
|
|
local name = Util.GetGameObject(v, "bg/Name")
|
|
|
|
|
if data.id == -1 then
|
|
|
|
|
live.gameObject:SetActive(false)
|
|
|
|
|
name.gameObject:SetActive(false)
|
|
|
|
|
Util.GetGameObject(v, "bg/Text").gameObject:SetActive(true)
|
|
|
|
|
v:GetComponent("Button").enabled = false
|
|
|
|
|
else
|
|
|
|
|
live.gameObject:SetActive(true)
|
|
|
|
|
name.gameObject:SetActive(true)
|
|
|
|
|
Util.GetGameObject(v, "bg/Text").gameObject:SetActive(false)
|
|
|
|
|
live:GetComponent("Image").sprite = Util.LoadSprite(data.live)
|
|
|
|
|
live:GetComponent("RectTransform").localPosition = data.livePos
|
|
|
|
|
live:GetComponent("RectTransform").sizeDelta = data.liveSize
|
|
|
|
|
name:GetComponent("Image").sprite = Util.LoadSprite(data.name)
|
|
|
|
|
name:GetComponent("RectTransform").localPosition = type[carbonType].namePos
|
|
|
|
|
name:GetComponent("RectTransform").sizeDelta = type[carbonType].nameSize
|
|
|
|
|
v:GetComponent("Button").enabled = true
|
|
|
|
|
Util.AddOnceClick(v,function()
|
|
|
|
|
this.BtnClick(data.id)
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
if data.id == -1 then
|
|
|
|
|
Util.SetGray(v,true)
|
|
|
|
|
elseif data.id == 1011 then
|
|
|
|
|
Util.SetGray(v,not ActTimeCtrlManager.SingleFuncState(30))
|
|
|
|
|
else
|
|
|
|
|
Util.SetGray(v,not ActTimeCtrlManager.SingleFuncState(data.id))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this.BtnClick(id)
|
|
|
|
|
if id == FUNCTION_OPEN_TYPE.DAILYCHALLENGE_COIN then
|
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(67) == false then --如果未解锁
|
|
|
|
|
PopupTipPanel.ShowTip(ActTimeCtrlManager.SystemOpenTip(FUNCTION_OPEN_TYPE.DAILYCHALLENGE_COIN))
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
UIManager.OpenPanel(UIName.DailyCarbonPanel)
|
|
|
|
|
elseif id == 1011 then
|
|
|
|
|
JumpManager.GoJump(1011)
|
|
|
|
|
elseif id == FUNCTION_OPEN_TYPE.EXPEDITION then
|
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(JumpType.Expedition) then
|
|
|
|
|
if #ExpeditionManager.nodeInfo <= 0 then
|
|
|
|
|
if ExpeditionManager.expeditionLeve == -1 then
|
|
|
|
|
NetManager.GetExpeditionRequest(2,function()
|
|
|
|
|
JumpManager.GoJump(64001)
|
|
|
|
|
end)
|
|
|
|
|
NetManager.GetExpeditionRequest(
|
|
|
|
|
2,
|
|
|
|
|
function()
|
|
|
|
|
JumpManager.GoJump(64001)
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
NetManager.GetExpeditionRequest(ExpeditionManager.expeditionLeve,function()
|
|
|
|
|
JumpManager.GoJump(64001)
|
|
|
|
|
end)
|
|
|
|
|
NetManager.GetExpeditionRequest(
|
|
|
|
|
ExpeditionManager.expeditionLeve,
|
|
|
|
|
function()
|
|
|
|
|
JumpManager.GoJump(64001)
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
JumpManager.GoJump(64001)
|
|
|
|
|
@ -81,117 +276,35 @@ function CarbonTypePanelV2:BindEvent()
|
|
|
|
|
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.EXPEDITION))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
-- 试炼副本(暂时改为心魔试练。原锁妖塔;兽潮来袭)
|
|
|
|
|
Util.AddClick(this.btnEpic, function()
|
|
|
|
|
JumpManager.GoJump(1011)
|
|
|
|
|
-- if ActTimeCtrlManager.SingleFuncState(30) then
|
|
|
|
|
-- CarbonManager.difficulty = 2
|
|
|
|
|
-- 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)
|
|
|
|
|
-- else
|
|
|
|
|
-- PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.TRIAL))
|
|
|
|
|
-- end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
-- 英雄副本
|
|
|
|
|
Util.AddClick(this.btnHero, function()
|
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(18) then
|
|
|
|
|
CarbonManager.difficulty = 3
|
|
|
|
|
UIManager.OpenPanel(UIName.EliteCarbonPanel)
|
|
|
|
|
CheckRedPointStatus(RedPointType.HeroExplore_OpenMap)
|
|
|
|
|
|
|
|
|
|
this.RefreshOpenText(CARBON_TYPE.HERO, FUNCTION_OPEN_TYPE.ELITE)
|
|
|
|
|
FunctionOpenMananger.CleadNewText(FUNCTION_OPEN_TYPE.ELITE)
|
|
|
|
|
else
|
|
|
|
|
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.ELITE))
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- 无尽副本(暂时改为车迟斗法)
|
|
|
|
|
Util.AddClick(this.btnLegend, function()
|
|
|
|
|
elseif id == 46 then
|
|
|
|
|
if PlayerManager.familyId == 0 then
|
|
|
|
|
PopupTipPanel.ShowTip(Language[10327])
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
UIManager.OpenPanel(UIName.GuildCarDelayMainPanel)
|
|
|
|
|
-- this.newText[CARBON_TYPE.ENDLESS]:SetActive(false)
|
|
|
|
|
-- FunctionOpenMananger.CleadNewText(FUNCTION_OPEN_TYPE.ENDLESS)
|
|
|
|
|
elseif id == 30 then
|
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(30) then
|
|
|
|
|
CarbonManager.difficulty = 2
|
|
|
|
|
local trialDataConfig = ConfigManager.GetConfig(ConfigName.TrialConfig)
|
|
|
|
|
|
|
|
|
|
-- if not ActTimeCtrlManager.SingleFuncState(46) then
|
|
|
|
|
-- PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.ENDLESS))
|
|
|
|
|
-- return
|
|
|
|
|
-- end
|
|
|
|
|
-- CarbonManager.difficulty = 4
|
|
|
|
|
-- UIManager.OpenPanel(UIName.EndLessCarbonPanel)
|
|
|
|
|
-- this.RefreshOpenText(CARBON_TYPE.ENDLESS, FUNCTION_OPEN_TYPE.ENDLESS)
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
--日常副本
|
|
|
|
|
Util.AddClick(this.dailyCarbonBtn,function()
|
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(67)==false then--如果未解锁
|
|
|
|
|
PopupTipPanel.ShowTip(ActTimeCtrlManager.SystemOpenTip(FUNCTION_OPEN_TYPE.DAILYCHALLENGE_COIN))
|
|
|
|
|
return
|
|
|
|
|
if MapTrialManager.curTowerLevel > 10000 then
|
|
|
|
|
MapManager.curMapId = MapTrialManager.GetSurprisedLevelMapId()
|
|
|
|
|
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)
|
|
|
|
|
LogBlue(Language[11163])
|
|
|
|
|
else
|
|
|
|
|
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.TRIAL))
|
|
|
|
|
end
|
|
|
|
|
UIManager.OpenPanel(UIName.DailyCarbonPanel)
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
-- 点击你的猪头
|
|
|
|
|
Util.AddClick(this.headBox, function ()
|
|
|
|
|
UIManager.OpenPanel(UIName.SettingPanel)
|
|
|
|
|
end)
|
|
|
|
|
BindRedPointObject(RedPointType.Setting, this.headRedpot)
|
|
|
|
|
|
|
|
|
|
Util.AddClick(this.vipPrivilegeBtn, function()
|
|
|
|
|
UIManager.OpenPanel(UIName.VipPanelV2)
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
|
function CarbonTypePanelV2:AddListener()
|
|
|
|
|
-- Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.FreshIconShow)--原无尽5点刷新相关 暂时不用了
|
|
|
|
|
-- Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnFunctionClose, this.FreshIconShow)
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--移除事件监听(用于子类重写)
|
|
|
|
|
function CarbonTypePanelV2:RemoveListener()
|
|
|
|
|
-- Game.GlobalEvent:RemoveEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.FreshIconShow)
|
|
|
|
|
-- Game.GlobalEvent:RemoveEvent(GameEvent.FunctionCtrl.OnFunctionClose, this.FreshIconShow)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function CarbonTypePanelV2:OnOpen()
|
|
|
|
|
-- 清除一下选得副本类型
|
|
|
|
|
CarbonManager.difficulty = 0
|
|
|
|
|
CheckRedPointStatus(RedPointType.EpicExplore_GetReward)
|
|
|
|
|
this.BtView:OnOpen({ sortOrder = self.sortingOrder, panelType = PanelTypeView.Carbon })
|
|
|
|
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.Main })
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面打开时调用(用于子类重写)
|
|
|
|
|
function CarbonTypePanelV2:OnShow(...)
|
|
|
|
|
Util.SetGray(this.btnNormal, not ActTimeCtrlManager.SingleFuncState(17))
|
|
|
|
|
Util.SetGray(this.btnEpic, not ActTimeCtrlManager.SingleFuncState(30))
|
|
|
|
|
Util.SetGray(this.btnHero, not ActTimeCtrlManager.SingleFuncState(18))
|
|
|
|
|
Util.SetGray(this.btnLegend, not ActTimeCtrlManager.SingleFuncState(46))
|
|
|
|
|
Util.SetGray(this.dailyCarbonBtn,not ActTimeCtrlManager.SingleFuncState(67))
|
|
|
|
|
-- 音效
|
|
|
|
|
SoundManager.PlayMusic(SoundConfig.BGM_Carbon)
|
|
|
|
|
-- 播放动画
|
|
|
|
|
|
|
|
|
|
-- CarbonTypePanelV2:PlayAni()
|
|
|
|
|
CarbonManager.GetMissionLevelData()
|
|
|
|
|
|
|
|
|
|
this.FreshPlayerInfo()
|
|
|
|
|
this.SetPlayerHead()
|
|
|
|
|
this.SetOpenText()
|
|
|
|
|
this.PlayScaleAnim()
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@ -213,24 +326,6 @@ function this.SetPlayerHead()
|
|
|
|
|
this.playerHead:SetFrame(PlayerManager.frame)
|
|
|
|
|
this.playerHead:SetScale(Vector3.one * 0.9)
|
|
|
|
|
this.playerHead:SetPosition(Vector3.New(-5, 0, 0))
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--- 设置时候显示新字
|
|
|
|
|
----@param btnCarbon 副本类型按钮
|
|
|
|
|
function this.SetNewTextShow(btnCarbon, state)
|
|
|
|
|
-- for i, v in pairs(this.newText) do
|
|
|
|
|
-- if i == carbonType then
|
|
|
|
|
-- v:SetActive(state)
|
|
|
|
|
-- end
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
if btnCarbon then
|
|
|
|
|
local textGo = Util.GetGameObject(btnCarbon.transform, "Image")
|
|
|
|
|
if textGo then
|
|
|
|
|
textGo:SetActive(state)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnSortingOrderChange()
|
|
|
|
|
@ -239,35 +334,28 @@ function this:OnSortingOrderChange()
|
|
|
|
|
Util.AddParticleSortLayer(this.vipPrivilegeBtn, self.sortingOrder - orginLayer)
|
|
|
|
|
|
|
|
|
|
orginLayer = self.sortingOrder
|
|
|
|
|
|
|
|
|
|
this.BtView:SetOrderStatus({ sortOrder = self.sortingOrder })
|
|
|
|
|
if carbonType == 1 then
|
|
|
|
|
this.BtView.gameObject:SetActive(true)
|
|
|
|
|
this.BtView:SetOrderStatus({sortOrder = self.sortingOrder})
|
|
|
|
|
elseif carbonType == 2 then
|
|
|
|
|
this.BtView.gameObject:SetActive(false)
|
|
|
|
|
else
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function CarbonTypePanelV2:PlayAni()
|
|
|
|
|
|
|
|
|
|
-- 玩家没有资格开启
|
|
|
|
|
-- this.timerRoot:SetActive(false)
|
|
|
|
|
-- if not ActTimeCtrlManager.IsQualifiled(46) then
|
|
|
|
|
-- return
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
-- 启动定时器
|
|
|
|
|
-- this.StartCountTime()
|
|
|
|
|
|
|
|
|
|
-- 开门音效
|
|
|
|
|
if not this.isPlayDoorAudio then
|
|
|
|
|
this.isPlayDoorAudio = true
|
|
|
|
|
Timer.New(function ()
|
|
|
|
|
if this.isPlayDoorAudio then
|
|
|
|
|
SoundManager.PlaySound(SoundConfig.Sound_Door)
|
|
|
|
|
end
|
|
|
|
|
end, 1.3):Start()
|
|
|
|
|
Timer.New(
|
|
|
|
|
function()
|
|
|
|
|
if this.isPlayDoorAudio then
|
|
|
|
|
SoundManager.PlaySound(SoundConfig.Sound_Door)
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
1.3
|
|
|
|
|
):Start()
|
|
|
|
|
end
|
|
|
|
|
-- 动画播放完才显示时间
|
|
|
|
|
-- Timer.New(function ()
|
|
|
|
|
-- this.timerRoot:SetActive(true)
|
|
|
|
|
-- end, 2.5):Start()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this.PlayScaleAnim()
|
|
|
|
|
@ -279,60 +367,6 @@ function this.PlayScaleAnim()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 选择类型
|
|
|
|
|
function this.ChooseCarbonType(type)
|
|
|
|
|
CarbonManager.difficulty = type
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- function this.StartCountTime()
|
|
|
|
|
-- this.countTime.text = ""
|
|
|
|
|
-- if this.timer then
|
|
|
|
|
-- this.timer:Stop()
|
|
|
|
|
-- this.timer = nil
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
-- local freshTime = 0
|
|
|
|
|
-- local isOpen = false
|
|
|
|
|
-- local str = ""
|
|
|
|
|
-- local serData = ActTimeCtrlManager.GetSerDataByTypeId(46)
|
|
|
|
|
-- if not ActTimeCtrlManager.FuncTimeJudge(46) then
|
|
|
|
|
-- freshTime = serData.startTime
|
|
|
|
|
-- isOpen = false
|
|
|
|
|
-- str = "距离开启"
|
|
|
|
|
-- else
|
|
|
|
|
-- freshTime = serData.endTime
|
|
|
|
|
-- isOpen = true
|
|
|
|
|
-- str = "距离结束"
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
-- hasFresh = false
|
|
|
|
|
|
|
|
|
|
-- if not this.timer then
|
|
|
|
|
-- this.timer = Timer.New(function()
|
|
|
|
|
-- if not this.timer or not this.countTime then
|
|
|
|
|
-- return
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
-- this.countTime.text = str .. FormatSecond(freshTime - PlayerManager.serverTime)
|
|
|
|
|
-- end, 1, -1, true)
|
|
|
|
|
-- this.timer:Start()
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
-- function this.FreshIconShow(id)
|
|
|
|
|
-- if not hasFresh then
|
|
|
|
|
-- hasFresh = true
|
|
|
|
|
|
|
|
|
|
-- this.refreshTimer = nil
|
|
|
|
|
-- this.refreshTimer = Timer.New(function ()
|
|
|
|
|
-- Util.SetGray(this.btnLegend, not ActTimeCtrlManager.SingleFuncState(46))
|
|
|
|
|
-- this.StartCountTime()
|
|
|
|
|
-- end, 1)
|
|
|
|
|
-- this.refreshTimer:Start()
|
|
|
|
|
-- end
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
|
function CarbonTypePanelV2:OnClose()
|
|
|
|
|
if this.timer then
|
|
|
|
|
@ -340,38 +374,19 @@ function CarbonTypePanelV2:OnClose()
|
|
|
|
|
this.timer = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if this.refreshTimer then
|
|
|
|
|
if this.refreshTimer then
|
|
|
|
|
this.refreshTimer:Stop()
|
|
|
|
|
this.refreshTimer = nil
|
|
|
|
|
end
|
|
|
|
|
this.isPlayDoorAudio = false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this.SetOpenText()
|
|
|
|
|
-- this.newText[CARBON_TYPE.NORMAL]:SetActive(FunctionOpenMananger.GetModuleOpen(17))
|
|
|
|
|
-- this.newText[CARBON_TYPE.ENDLESS]:SetActive(FunctionOpenMananger.GetModuleOpen(46))
|
|
|
|
|
-- this.newText[CARBON_TYPE.TRIAL]:SetActive(FunctionOpenMananger.GetModuleOpen(30))
|
|
|
|
|
-- this.newText[CARBON_TYPE.HERO]:SetActive(FunctionOpenMananger.GetModuleOpen(18))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 刷新显示
|
|
|
|
|
function this.RefreshOpenText(carbonType, openId)
|
|
|
|
|
-- this.newText[carbonType]:SetActive(FunctionOpenMananger.GetModuleOpen(openId))
|
|
|
|
|
this.BtView:InitNewOpenShow()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
|
function CarbonTypePanelV2:OnDestroy()
|
|
|
|
|
-- ClearRedPointObject(RedPointType.OrdinaryExplore)
|
|
|
|
|
-- ClearRedPointObject(RedPointType.HeroExplore)
|
|
|
|
|
-- ClearRedPointObject(RedPointType.EpicExplore)
|
|
|
|
|
-- ClearRedPointObject(RedPointType.LegendExplore)
|
|
|
|
|
-- ClearRedPointObject(RedPointType.Setting, this.headRedpot)
|
|
|
|
|
-- ClearRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
|
|
|
|
|
|
|
|
|
|
hasFresh = false
|
|
|
|
|
if this.BtView then
|
|
|
|
|
SubUIManager.Close(this.BtView)
|
|
|
|
|
SubUIManager.Close(this.UpView)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return CarbonTypePanelV2
|
|
|
|
|
return CarbonTypePanelV2
|
|
|
|
|
|