一键探索调整编队后探索地图修改提交
parent
05e078dadc
commit
8b4533aac9
|
@ -77,7 +77,7 @@ end
|
||||||
|
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
function this:AddListener()
|
function this:AddListener()
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.Explore.UpdateFormation,this.OnShow)
|
Game.GlobalEvent:AddEvent(GameEvent.Explore.UpdateFormation,this.Init)
|
||||||
end
|
end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
|
@ -100,10 +100,11 @@ function this:OnOpen(_parent,...)
|
||||||
this.mapTimeTipLayer.overrideSorting = true
|
this.mapTimeTipLayer.overrideSorting = true
|
||||||
this.mapTimeTipLayer.sortingOrder = sortingOrder + 1
|
this.mapTimeTipLayer.sortingOrder = sortingOrder + 1
|
||||||
this.mask.sortingOrder = sortingOrder + 1
|
this.mask.sortingOrder = sortingOrder + 1
|
||||||
|
this:Init()
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function this:OnShow()
|
function this:Init()
|
||||||
this.icon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(Explore[1].Cost[1]))
|
this.icon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(Explore[1].Cost[1]))
|
||||||
--队伍
|
--队伍
|
||||||
for i = 1,math.max(#this.itemList,#this.data) do
|
for i = 1,math.max(#this.itemList,#this.data) do
|
||||||
|
@ -191,6 +192,10 @@ function this:OnShow()
|
||||||
this:TimeCountDown()
|
this:TimeCountDown()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function this:OnShow()
|
||||||
|
this.RefreshFormations()
|
||||||
|
end
|
||||||
|
|
||||||
function this.RefreshMapNameColor()
|
function this.RefreshMapNameColor()
|
||||||
--红 fe5757 黄 f3e168 绿 58f567
|
--红 fe5757 黄 f3e168 绿 58f567
|
||||||
for k,v in pairs(this.mapDatas) do
|
for k,v in pairs(this.mapDatas) do
|
||||||
|
@ -273,11 +278,14 @@ function this.SetPos(gobj,pos,formationId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:Refresh(_data,_item,index)
|
function this.RefreshFormations()
|
||||||
_item.data = _data
|
--队伍
|
||||||
_item.go.gameObject:SetActive(true)
|
for i = 1,#this.itemList do
|
||||||
_item.formation.gameObject:SetActive(true)
|
this.RefreshFormation(this.itemList[i],this.itemList[i].data)
|
||||||
_item.name.text = string.format("队伍%s",_data.index)
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.RefreshFormation(_item,_data)
|
||||||
for j, demon in ipairs(_item.heroList) do
|
for j, demon in ipairs(_item.heroList) do
|
||||||
_item.heroList[j].frame.sprite = this.spLoader:LoadSprite(GetQuantityImageByquality(1))
|
_item.heroList[j].frame.sprite = this.spLoader:LoadSprite(GetQuantityImageByquality(1))
|
||||||
_item.heroList[j].hero:SetActive(false)
|
_item.heroList[j].hero:SetActive(false)
|
||||||
|
@ -322,7 +330,15 @@ function this:Refresh(_data,_item,index)
|
||||||
_item.heroList[pos].proIcon.sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName))
|
_item.heroList[pos].proIcon.sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName))
|
||||||
_item.heroList[pos].heroData = heroData
|
_item.heroList[pos].heroData = heroData
|
||||||
end
|
end
|
||||||
|
this.SetMapName(_data.formationId)
|
||||||
|
end
|
||||||
|
|
||||||
|
function this:Refresh(_data,_item,index)
|
||||||
|
_item.data = _data
|
||||||
|
_item.go.gameObject:SetActive(true)
|
||||||
|
_item.formation.gameObject:SetActive(true)
|
||||||
|
_item.name.text = string.format("队伍%s",_data.index)
|
||||||
|
local formation = FormationManager.GetFormationByID(_data.formationId)
|
||||||
this.formationList[_data.formationId] = {} --formationId 为索引 ,预设index,mapId,exploreTime,formationId
|
this.formationList[_data.formationId] = {} --formationId 为索引 ,预设index,mapId,exploreTime,formationId
|
||||||
this.formationList[_data.formationId].index = index
|
this.formationList[_data.formationId].index = index
|
||||||
this.formationList[_data.formationId].formationId = _data.formationId
|
this.formationList[_data.formationId].formationId = _data.formationId
|
||||||
|
@ -347,7 +363,7 @@ function this:Refresh(_data,_item,index)
|
||||||
this.formationList[_data.formationId].exploreTime = this.mapDatas[1].exploreTime
|
this.formationList[_data.formationId].exploreTime = this.mapDatas[1].exploreTime
|
||||||
_item.targgetTimeBtn.gameObject:SetActive(false)
|
_item.targgetTimeBtn.gameObject:SetActive(false)
|
||||||
end
|
end
|
||||||
this.SetMapName(_data.formationId)
|
this.RefreshFormation(_item,_data)
|
||||||
this.SetExploreTime(_data.formationId)
|
this.SetExploreTime(_data.formationId)
|
||||||
_item.selectIma.gameObject:SetActive(this.formationList[_data.formationId].select == 1)
|
_item.selectIma.gameObject:SetActive(this.formationList[_data.formationId].select == 1)
|
||||||
Util.AddOnceClick(_item.select,function()
|
Util.AddOnceClick(_item.select,function()
|
||||||
|
@ -418,7 +434,7 @@ function this:OnClose()
|
||||||
end
|
end
|
||||||
this.SetPos(this.mapTip,nil,this.formationId)
|
this.SetPos(this.mapTip,nil,this.formationId)
|
||||||
this.SetPos(this.mapTimeTip,nil,this.formationId)
|
this.SetPos(this.mapTimeTip,nil,this.formationId)
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.Explore.UpdateFormation,this.OnShow)
|
Game.GlobalEvent:RemoveEvent(GameEvent.Explore.UpdateFormation,this.Init)
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面销毁时调用(用于子类重写)
|
--界面销毁时调用(用于子类重写)
|
||||||
|
@ -427,6 +443,7 @@ function this:OnDestroy()
|
||||||
this.itemList = {}
|
this.itemList = {}
|
||||||
this.mapTipPreList = {}
|
this.mapTipPreList = {}
|
||||||
this.mapTimeTipPreList = {}
|
this.mapTimeTipPreList = {}
|
||||||
|
this.formationList = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
return this
|
return this
|
Loading…
Reference in New Issue