2021-07-06 11:55:21 +08:00
|
|
|
require("Base/BasePanel")
|
|
|
|
local CarbonsPanel = Inherit(BasePanel)
|
|
|
|
|
|
|
|
local carbonData = {
|
|
|
|
[1] = {
|
|
|
|
id = FUNCTION_OPEN_TYPE.DAILYCHALLENGE_COIN, --日常
|
2021-07-06 14:47:10 +08:00
|
|
|
Imgname = "11",
|
|
|
|
ImgPos = Vector2(-200,650),
|
2021-07-06 11:55:21 +08:00
|
|
|
btnPos = Vector2(0,0),
|
2021-07-06 16:30:58 +08:00
|
|
|
redPointType = RedPointType.HeroExplore,
|
2021-07-06 11:55:21 +08:00
|
|
|
},
|
|
|
|
[2] = {
|
|
|
|
id = FUNCTION_OPEN_TYPE.MONSTER_COMING, --心魔
|
2021-07-06 14:47:10 +08:00
|
|
|
Imgname = "12",
|
|
|
|
ImgPos = Vector2(200,650),
|
2021-07-06 11:55:21 +08:00
|
|
|
btnPos = Vector2(0,0),
|
2021-07-06 16:30:58 +08:00
|
|
|
redPointType = RedPointType.EpicExplore,
|
|
|
|
--次数特权
|
|
|
|
Privileges ={
|
|
|
|
[1] = {
|
|
|
|
id = PRIVILEGE_TYPE.MONSTERCAMP_BATTLENUM,
|
|
|
|
string = "免费挑战次数:%s"
|
|
|
|
},
|
|
|
|
[2] = {
|
|
|
|
id = PRIVILEGE_TYPE.MONSTERCAMP_BUY_BATTLENUM,
|
|
|
|
string = "剩余购买次数:%s"
|
|
|
|
},
|
|
|
|
},
|
2021-07-06 11:55:21 +08:00
|
|
|
},
|
|
|
|
[3] = {
|
|
|
|
id = FUNCTION_OPEN_TYPE.EXPEDITION, --大闹天宫
|
2021-07-06 14:47:10 +08:00
|
|
|
Imgname = "13",
|
|
|
|
ImgPos = Vector2(-200,300),
|
|
|
|
btnPos = Vector2(0,0),
|
2021-07-06 16:30:58 +08:00
|
|
|
redPointType = RedPointType.OrdinaryExplore,
|
2021-07-06 11:55:21 +08:00
|
|
|
},
|
|
|
|
[4] = {
|
|
|
|
id = FUNCTION_OPEN_TYPE.CARDELAY, --车迟斗法
|
2021-07-06 14:47:10 +08:00
|
|
|
Imgname = "14",
|
|
|
|
ImgPos = Vector2(200,300),
|
|
|
|
btnPos = Vector2(0,0),
|
2021-07-06 16:30:58 +08:00
|
|
|
redPointType = RedPointType.LegendExplore,
|
2021-07-06 11:55:21 +08:00
|
|
|
},
|
|
|
|
[5] = {
|
|
|
|
id = FUNCTION_OPEN_TYPE.ENDLESS, --无尽
|
2021-07-06 14:47:10 +08:00
|
|
|
Imgname = "15",
|
|
|
|
ImgPos = Vector2(-200,-100),
|
2021-07-06 16:30:58 +08:00
|
|
|
btnPos = Vector2(0,0),
|
|
|
|
redPointType = RedPointType.EndLess,
|
2021-07-06 11:55:21 +08:00
|
|
|
},
|
|
|
|
[6] = {
|
|
|
|
id = FUNCTION_OPEN_TYPE.TRIAL, --森罗
|
2021-07-06 14:47:10 +08:00
|
|
|
Imgname = "16",
|
|
|
|
ImgPos = Vector2(200,-100),
|
|
|
|
btnPos = Vector2(274.5, -408.1),
|
2021-07-06 16:30:58 +08:00
|
|
|
redPointType = RedPointType.Trial,
|
2021-07-06 11:55:21 +08:00
|
|
|
},
|
|
|
|
[7] = {
|
|
|
|
id = FUNCTION_OPEN_TYPE.PEOPLE_MIRROR, --轩辕
|
2021-07-06 14:47:10 +08:00
|
|
|
Imgname = "17",
|
|
|
|
ImgPos = Vector2(-200,-400),
|
2021-07-06 16:30:58 +08:00
|
|
|
btnPos = Vector2(0,0),
|
|
|
|
redPointType = RedPointType.People_Mirror,
|
2021-07-06 11:55:21 +08:00
|
|
|
},
|
2021-07-06 14:47:10 +08:00
|
|
|
[8] = {
|
|
|
|
id = FUNCTION_OPEN_TYPE.FIGHTLEVEL, --山河社稷图
|
|
|
|
Imgname = "18",
|
|
|
|
ImgPos = Vector2(200,-400),
|
2021-07-06 16:30:58 +08:00
|
|
|
btnPos = Vector2(0,0),
|
|
|
|
redPointType = RedPointType.FightLevel,
|
2021-07-06 14:47:10 +08:00
|
|
|
},
|
2021-07-06 11:55:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
--初始化组件(用于子类重写)
|
|
|
|
function CarbonsPanel:InitComponent()
|
|
|
|
self.spLoader = SpriteLoader.New()
|
|
|
|
self.sortingOrder = 0
|
|
|
|
if not self.playerInfoView then
|
2021-07-06 14:47:10 +08:00
|
|
|
self.playerInfoView = SubUIManager.Open(SubUIConfig.PlayerInfoView, self.transform)
|
2021-07-06 11:55:21 +08:00
|
|
|
end
|
2021-07-06 14:47:10 +08:00
|
|
|
self.BtView = SubUIManager.Open(SubUIConfig.BtView, self.transform)
|
|
|
|
self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.transform)
|
|
|
|
|
|
|
|
self.mapGrid = Util.GetGameObject(self.gameObject,"Map")
|
|
|
|
self.mapPre = Util.GetGameObject(self.gameObject,"mapPre")
|
|
|
|
self.mapList = {}
|
2021-07-06 11:55:21 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
function CarbonsPanel:BindEvent()
|
|
|
|
end
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
function CarbonsPanel:AddListener()
|
|
|
|
end
|
|
|
|
|
|
|
|
--移除事件监听(用于子类重写)
|
|
|
|
function CarbonsPanel:RemoveListener()
|
|
|
|
end
|
2021-07-06 16:30:58 +08:00
|
|
|
|
2021-07-06 11:55:21 +08:00
|
|
|
function CarbonsPanel:OnOpen()
|
2021-07-06 14:47:10 +08:00
|
|
|
self.BtView.gameObject:SetActive(true)
|
|
|
|
self.BtView:OnOpen(self, {sortOrder = self.sortingOrder, panelType = PanelTypeView.Carbon})
|
2021-07-06 11:55:21 +08:00
|
|
|
self.UpView:OnOpen({showType = UpViewOpenType.ShowRight, panelType = PanelType.Main})
|
|
|
|
end
|
|
|
|
|
|
|
|
--界面打开时调用(用于子类重写)
|
|
|
|
function CarbonsPanel:OnShow(...)
|
|
|
|
-- 音效
|
|
|
|
SoundManager.PlayMusic(SoundConfig.BGM_Carbon)
|
|
|
|
-- 刷新一次编队战斗力
|
|
|
|
FormationManager.RefreshMainFormationPower()
|
2021-07-06 14:47:10 +08:00
|
|
|
self:ShowMap()
|
2021-07-06 11:55:21 +08:00
|
|
|
end
|
|
|
|
|
2021-07-06 14:47:10 +08:00
|
|
|
function CarbonsPanel:ShowMap()
|
|
|
|
for i = 1, #carbonData do
|
|
|
|
local go = self.mapList[carbonData[i].id]
|
|
|
|
if not go then
|
|
|
|
go = newObject(self.mapPre)
|
|
|
|
go.transform:SetParent(self.mapGrid.transform)
|
|
|
|
go.transform.localScale = Vector3.one
|
|
|
|
go.transform.localPosition = Vector3.zero
|
|
|
|
self.mapList[carbonData[i].id] = go
|
|
|
|
end
|
|
|
|
go:SetActive(true)
|
|
|
|
go.transform.localPosition = carbonData[i].ImgPos
|
|
|
|
go:GetComponent("Image").sprite = self.spLoader:LoadSprite(carbonData[i].Imgname)
|
2021-07-06 16:30:58 +08:00
|
|
|
go:GetComponent("Image"):SetNativeSize()
|
|
|
|
|
|
|
|
|
|
|
|
Util.AddOnceClick(go,function ()
|
|
|
|
self:BtnClick(carbonData[i].id)
|
|
|
|
end)
|
2021-07-06 14:47:10 +08:00
|
|
|
end
|
|
|
|
end
|
2021-07-06 11:55:21 +08:00
|
|
|
|
|
|
|
function CarbonsPanel:BtnClick(id)
|
|
|
|
if id == FUNCTION_OPEN_TYPE.DAILYCHALLENGE_COIN then
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(id) == false then --如果未解锁
|
|
|
|
PopupTipPanel.ShowTip(ActTimeCtrlManager.SystemOpenTip(FUNCTION_OPEN_TYPE.DAILYCHALLENGE_COIN))
|
|
|
|
return
|
|
|
|
end
|
|
|
|
UIManager.OpenPanel(UIName.DailyCarbonPanel)
|
|
|
|
elseif id == FUNCTION_OPEN_TYPE.MONSTER_COMING then
|
|
|
|
JumpManager.GoJump(1011)
|
|
|
|
elseif id == FUNCTION_OPEN_TYPE.EXPEDITION then
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(id) then
|
|
|
|
if #ExpeditionManager.nodeInfo <= 0 then
|
|
|
|
if ExpeditionManager.expeditionLeve == -1 then
|
|
|
|
NetManager.GetExpeditionRequest(
|
|
|
|
2,
|
|
|
|
function()
|
|
|
|
JumpManager.GoJump(64001)
|
|
|
|
end
|
|
|
|
)
|
|
|
|
else
|
|
|
|
NetManager.GetExpeditionRequest(
|
|
|
|
ExpeditionManager.expeditionLeve,
|
|
|
|
function()
|
|
|
|
JumpManager.GoJump(64001)
|
|
|
|
end
|
|
|
|
)
|
|
|
|
end
|
|
|
|
else
|
|
|
|
JumpManager.GoJump(64001)
|
|
|
|
end
|
|
|
|
NetManager.TreasureOfHeavenScoreRequest()
|
|
|
|
PlayerPrefs.SetInt(PlayerManager.uid.."ExpeditionRed",ActTimeCtrlManager.GetSerDataByTypeId(FUNCTION_OPEN_TYPE.EXPEDITION).endTime)
|
|
|
|
CheckRedPointStatus(RedPointType.OrdinaryExplore)
|
|
|
|
else
|
|
|
|
if ActTimeCtrlManager.IsQualifiled(id) then
|
|
|
|
PopupTipPanel.ShowTip(Language[12183])
|
|
|
|
else
|
|
|
|
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.EXPEDITION))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
elseif id == FUNCTION_OPEN_TYPE.CARDELAY then
|
|
|
|
if ActTimeCtrlManager.IsQualifiled(id) then
|
|
|
|
if PlayerManager.familyId == 0 then
|
|
|
|
PopupTipPanel.ShowTip(Language[10278])
|
|
|
|
return
|
|
|
|
end
|
|
|
|
UIManager.OpenPanel(UIName.GuildCarDelayMainPanel)
|
|
|
|
else
|
|
|
|
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(id))
|
|
|
|
end
|
|
|
|
elseif id == FUNCTION_OPEN_TYPE.TRIAL then--森罗在此!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
--LogGreen("点击进入森罗时候的层数"..MapTrialManager.curTowerLevel)
|
|
|
|
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(id) then
|
|
|
|
CarbonManager.difficulty = CARBON_TYPE.TRIAL
|
|
|
|
CarbonManager.carbonType = CARBON_TYPE.TRIAL
|
|
|
|
local trialDataConfig = ConfigManager.GetConfig(ConfigName.TrialConfig)
|
|
|
|
MapManager.curCarbonType =CarBonTypeId.TRIAL
|
|
|
|
NetManager.MapInfoRequest(MapManager.curCarbonType, function(msg)
|
|
|
|
MapManager.isReloadEnter = false
|
|
|
|
MapTrialManager.firstEnter = true
|
|
|
|
MapManager.SetViewSize(20)--设置视野范围(明雷形式)
|
|
|
|
MapManager.curAreaId =FormationTypeDef.FORMATION_DREAMLAND
|
|
|
|
MapTrialManager.isHaveBoss = false
|
|
|
|
MapManager.isTimeOut = false
|
|
|
|
SwitchPanel.OpenPanel(UIName.MapPanel)
|
|
|
|
end)
|
|
|
|
LogBlue("嘤嘤嘤")
|
|
|
|
else
|
|
|
|
if not ActTimeCtrlManager.IsQualifiled(id) then
|
|
|
|
local config = ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,FUNCTION_OPEN_TYPE.TRIAL)
|
|
|
|
PopupTipPanel.ShowTip(string.format(Language[10279],config.OpenRules[2]))
|
|
|
|
else
|
|
|
|
PopupTipPanel.ShowTip(Language[10280])
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
elseif id == FUNCTION_OPEN_TYPE.PEOPLE_MIRROR then
|
|
|
|
if ActTimeCtrlManager.IsQualifiled(id) then
|
|
|
|
CarbonManager.difficulty = 1
|
|
|
|
UIManager.OpenPanel(UIName.XuanYuanMirrorPanel)
|
|
|
|
else
|
|
|
|
local config = ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,FUNCTION_OPEN_TYPE.PEOPLE_MIRROR)
|
|
|
|
PopupTipPanel.ShowTip(string.format(Language[10279],config.OpenRules[2]))
|
|
|
|
end
|
|
|
|
elseif id == FUNCTION_OPEN_TYPE.ENDLESS then
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(id) then
|
|
|
|
local serData = ActTimeCtrlManager.GetSerDataByTypeId(FUNCTION_OPEN_TYPE.ENDLESS)
|
|
|
|
PlayerPrefs.SetInt("WuJin1"..PlayerManager.uid,serData.endTime)
|
|
|
|
CheckRedPointStatus(RedPointType.EndlessPanel)
|
|
|
|
MapManager.curCarbonType = CarBonTypeId.ENDLESS
|
|
|
|
MapManager.SetViewSize(3)--设置视野范围(明雷形式)
|
|
|
|
MapManager.isTimeOut = false
|
|
|
|
UIManager.OpenPanel(UIName.EndLessCarbonPanel)
|
|
|
|
else
|
|
|
|
PopupTipPanel.ShowTip(Language[10281])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
function CarbonsPanel:OnSortingOrderChange()
|
|
|
|
self.BtView.gameObject:SetActive(true)
|
|
|
|
-- 头像层级
|
|
|
|
if self.playerInfoView then
|
|
|
|
self.playerInfoView:SetLayer(self.sortingOrder)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
function CarbonsPanel:OnClose()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
function CarbonsPanel:OnDestroy()
|
|
|
|
self.spLoader:Destroy()
|
|
|
|
if self.BtView then
|
|
|
|
SubUIManager.Close(self.BtView)
|
|
|
|
end
|
|
|
|
if self.playerInfoView then
|
|
|
|
SubUIManager.Close(self.playerInfoView)
|
|
|
|
self.playerInfoView = nil
|
|
|
|
end
|
|
|
|
SubUIManager.Close(self.UpView)
|
|
|
|
self.UpView = nil
|
|
|
|
self.BtView = nil
|
2021-07-06 14:47:10 +08:00
|
|
|
self.mapList = {}
|
2021-07-06 11:55:21 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
return CarbonsPanel
|