【英雄升星祭品】提交——6
parent
a7dc372bb7
commit
991fb61f57
|
@ -65,17 +65,17 @@ end
|
|||
function RoleAwakeLayout:BindEvent()
|
||||
--升星
|
||||
Util.AddOnceClick(this.upStarBtn, function()
|
||||
this.StarUpClick()
|
||||
self:StarUpClick()
|
||||
end)
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function RoleAwakeLayout:AddListener()
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.UpdateHeroUpStarMaterialShow)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.UpdateHeroUpStarMaterialShow,self)
|
||||
end
|
||||
--移除事件监听(用于子类重写)
|
||||
function RoleAwakeLayout:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold,this.UpdateHeroUpStarMaterialShow)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold,this.UpdateHeroUpStarMaterialShow,self)
|
||||
end
|
||||
|
||||
function RoleAwakeLayout:OnShow(_sortinglayer,_parent,_curHerodata,_isUpZhen,_heroDatas)
|
||||
|
@ -85,8 +85,8 @@ function RoleAwakeLayout:OnShow(_sortinglayer,_parent,_curHerodata,_isUpZhen,_he
|
|||
parent = _parent
|
||||
heroDatas = _heroDatas
|
||||
isUpZhen = _isUpZhen
|
||||
this.GetCurHeroUpLvOrUpStarSData()
|
||||
this.UpdateHeroUpStarData()--进阶
|
||||
self:GetCurHeroUpLvOrUpStarSData()
|
||||
self:UpdateHeroUpStarData()--进阶
|
||||
end
|
||||
|
||||
function RoleAwakeLayout:OnShow()
|
||||
|
@ -99,14 +99,14 @@ function RoleAwakeLayout:SetData(_sortinglayer,_parent,_curHerodata,_isUpZhen,_h
|
|||
parent = _parent
|
||||
heroDatas = _heroDatas
|
||||
isUpZhen = _isUpZhen
|
||||
this.GetCurHeroUpLvOrUpStarSData()
|
||||
this.UpdateHeroUpStarData()--进阶
|
||||
self:GetCurHeroUpLvOrUpStarSData()
|
||||
self:UpdateHeroUpStarData()--进阶
|
||||
end
|
||||
|
||||
--更新英雄进阶数据
|
||||
function this.UpdateHeroUpStarData()
|
||||
function RoleAwakeLayout:UpdateHeroUpStarData()
|
||||
--进阶材料
|
||||
this.UpdateHeroUpStarMaterialShow()
|
||||
self:UpdateHeroUpStarMaterialShow()
|
||||
--进阶属性提升
|
||||
this.curLvEnd.text= HeroManager.GetCurHeroStarLvEnd(1,curHeroData)
|
||||
this.nextLvEnd.text= HeroManager.GetCurHeroStarLvEnd(2,curHeroData,curHeroData.breakId,upStarRankUpConfig.Id)
|
||||
|
@ -171,16 +171,16 @@ function this.UpdateHeroUpStarData()
|
|||
Util.AddOnceClick(addBtn, function()
|
||||
curSelectUpStarData=curUpStarData[i]
|
||||
curSelectUpStarGo=go
|
||||
local curShowHeroListData=this.SetShowHeroListData(upStarConsumeMaterial,upStarHeroListData.heroList)
|
||||
local curShowHeroListData=self:SetShowHeroListData(upStarConsumeMaterial,upStarHeroListData.heroList)
|
||||
--参数1 显示的herolist 2 3 升当前星的规则 4 打开RoleUpStarListPanel的界面
|
||||
UIManager.OpenPanel(UIName.RoleUpStarListPanel,curShowHeroListData,curUpStarData[i].upStarMaterialsData,curUpStarData[i].upStarData,this,upStarConsumeMaterial[i],curHeroData)
|
||||
end)
|
||||
end
|
||||
end
|
||||
this.AutoSelectUpStarHeroList(curUpStarData)
|
||||
self:AutoSelectUpStarHeroList(curUpStarData)
|
||||
end
|
||||
--获取当前英雄的下一突破 和 升星 静态数据
|
||||
function this.GetCurHeroUpLvOrUpStarSData()
|
||||
function RoleAwakeLayout:GetCurHeroUpLvOrUpStarSData()
|
||||
isHeroUpStar = false
|
||||
upStarRankUpConfig = {}
|
||||
local heroRankUpConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
|
||||
|
@ -197,7 +197,7 @@ function this.GetCurHeroUpLvOrUpStarSData()
|
|||
end
|
||||
end
|
||||
--更新英雄进阶材料显示
|
||||
function this.UpdateHeroUpStarMaterialShow()
|
||||
function RoleAwakeLayout:UpdateHeroUpStarMaterialShow()
|
||||
--进阶金币 妖壶条件
|
||||
if upStarRankUpConfig then
|
||||
isUpStarMaterials=true
|
||||
|
@ -238,7 +238,7 @@ function this.UpdateHeroUpStarMaterialShow()
|
|||
end
|
||||
|
||||
--升星选择祭品后刷新界面
|
||||
function this.AutoSelectUpStarHeroList(_curUpStarData)
|
||||
function RoleAwakeLayout:AutoSelectUpStarHeroList(_curUpStarData)
|
||||
local curUpStarData= _curUpStarData
|
||||
if curUpStarData and #curUpStarData>0 then
|
||||
for i = 1, #curUpStarData do
|
||||
|
@ -257,7 +257,7 @@ function this.AutoSelectUpStarHeroList(_curUpStarData)
|
|||
table.insert(curSelectHeroList,upStarHeroListData.heroList[i])
|
||||
end
|
||||
end
|
||||
this.UpdateUpStarPosHeroData(curSelectHeroList)
|
||||
self:UpdateUpStarPosHeroData(curSelectHeroList)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -270,7 +270,7 @@ end
|
|||
|
||||
|
||||
--刷新当前升星坑位英雄的信息
|
||||
function this.UpdateUpStarPosHeroData(curSelectHeroList)
|
||||
function RoleAwakeLayout:UpdateUpStarPosHeroData(curSelectHeroList)
|
||||
if LengthOfTable(curSelectHeroList)<curSelectUpStarData.upStarData[4] then
|
||||
upStarMaterialIsAll[curSelectUpStarData.upStarData[2]]=2
|
||||
Util.GetGameObject(curSelectUpStarGo.transform,"add/add"):SetActive(true)
|
||||
|
@ -291,7 +291,7 @@ function this.UpdateUpStarPosHeroData(curSelectHeroList)
|
|||
upStarConsumeMaterial[curSelectUpStarData.upStarData[2]]=curUpStarConsumeMaterial
|
||||
end
|
||||
--分析设置升星界面显示的英雄list数据 如果当前升星材料的坑位的英雄数据与 以其他坑位有重合并且选择上的英雄不显示 如果是当前坑位显示的英雄显示对勾
|
||||
function this.SetShowHeroListData(upStarConsumeMaterial,curHeroList)--1 消耗的总消耗组 2 当前坑位可选择的所有英雄
|
||||
function RoleAwakeLayout:SetShowHeroListData(upStarConsumeMaterial,curHeroList)--1 消耗的总消耗组 2 当前坑位可选择的所有英雄
|
||||
--Log("#curHeroList "..#curHeroList)
|
||||
local curEndShowHeroListData2={}
|
||||
for i = 1, #curHeroList do
|
||||
|
@ -332,7 +332,7 @@ function this.SetShowHeroListData(upStarConsumeMaterial,curHeroList)--1 消耗
|
|||
return curList
|
||||
end
|
||||
--进阶按钮点击事件处理
|
||||
function this.StarUpClick()
|
||||
function RoleAwakeLayout:StarUpClick()
|
||||
if curHeroData.oriLv>=HeroManager.heroLvEnd[curHeroData.heroConfig.Id] then
|
||||
PopupTipPanel.ShowTip(Language[11788])
|
||||
return
|
||||
|
@ -349,7 +349,7 @@ function this.StarUpClick()
|
|||
end
|
||||
if isUpStarMaterials and isUpStarMaterialsHero then
|
||||
NetManager.HeroUpStarEvent(curHeroData.dynamicId,upStarConsumeMaterial ,function (msg)
|
||||
this.DeleteUpStarMaterials()
|
||||
self:DeleteUpStarMaterials()
|
||||
UIManager.OpenPanel(UIName.RoleAwakeSuccessPanel,curHeroData,upStarRankUpConfig.Id,upStarRankUpConfig.OpenLevel,function ()
|
||||
local dropItemTabs = BagManager.GetTableByBackDropData(msg)
|
||||
if #dropItemTabs > 0 then
|
||||
|
@ -368,7 +368,7 @@ function this.StarUpClick()
|
|||
end
|
||||
end
|
||||
--扣除升星 消耗的材料 更新英雄数据
|
||||
function this.DeleteUpStarMaterials()
|
||||
function RoleAwakeLayout:DeleteUpStarMaterials()
|
||||
HeroManager.UpdateSingleHeroDatas(curHeroData.dynamicId,curHeroData.oriLv,curHeroData.star+1,curHeroData.breakId,upStarRankUpConfig.Id,true)
|
||||
HeroManager.UpdateSingleHeroSkillData(curHeroData.dynamicId)
|
||||
for i, v in pairs(heroDatas) do
|
||||
|
|
|
@ -80,11 +80,11 @@ end
|
|||
|
||||
--添加事件监听(用于子类重写)
|
||||
function RoleUpStarLayout:AddListener()
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.UpdateHeroUpStarMaterialShow)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.UpdateHeroUpStarMaterialShow,self)
|
||||
end
|
||||
--移除事件监听(用于子类重写)
|
||||
function RoleUpStarLayout:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold,this.UpdateHeroUpStarMaterialShow)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold,this.UpdateHeroUpStarMaterialShow,self)
|
||||
end
|
||||
|
||||
function RoleUpStarLayout:OnShow()
|
||||
|
|
|
@ -41,7 +41,6 @@ function RoleUpStarListPanel:BindEvent()
|
|||
end)
|
||||
Util.AddClick(this.BtnSure, function()
|
||||
self:ClosePanel()
|
||||
Log("curSelectHeroList "..LengthOfTable(curSelectHeroList))
|
||||
openThisPanel:UpdateUpStarPosHeroData(curSelectHeroList)
|
||||
end)
|
||||
Util.AddClick(this.btnAutoSelect, function()
|
||||
|
|
Loading…
Reference in New Issue