【觉醒】 增加觉醒页签

dev_chengFeng
zhangqiang 2020-11-09 15:04:48 +08:00
parent de677bee2f
commit f94c84f1cd
4 changed files with 20375 additions and 20453 deletions

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,8 @@ this.heroResolveLicence = {}
--this.lvProVal = {}--单体等级限制加成
--this.allHeroProVal = {}--团体加成
--this.specialProVal = {}--减乘
this.awakeStarIndex = 10-- 前端写死觉醒星级标志
function this.Initialize()
for i = 1, WarPowerTypeAllNum do
this.allProVal[i] = {

View File

@ -21,37 +21,36 @@ local parent = {}
local upStarPreList = {}
local heroDatas = {}
local isUpZhen = false
local allAddProVal = {}
--初始化组件(用于子类重写)
function this:InitComponent(gameObject)
this.gameObject = gameObject
this.upStar=Util.GetGameObject(gameObject,"awake")
this.noUpStarText=Util.GetGameObject(gameObject,"noUpStarText")
this.upStarPre=Util.GetGameObject(this.upStar,"upStarPre")
this.upStarGrid=Util.GetGameObject(this.upStar,"grid")
this.upStarBtn=Util.GetGameObject(this.upStar,"btns/upStarBtn")
this.upStarBtnRedPoint=Util.GetGameObject(this.upStar,"btns/upStarBtn/redPoint")
this.goldBtn=Util.GetGameObject(this.upStar,"goldGrid/gold")
this.goldText=Util.GetGameObject(this.upStar,"goldGrid/gold/Text"):GetComponent("Text")
this.goldImage=Util.GetGameObject(this.upStar,"goldGrid/gold")
this.gold2Btn=Util.GetGameObject(this.upStar,"goldGrid/gold2")
this.gold2Text=Util.GetGameObject(this.upStar,"goldGrid/gold2/Text"):GetComponent("Text")
this.gold2Image=Util.GetGameObject(this.upStar,"goldGrid/gold2")
this.roleUpStarLayoutTip=Util.GetGameObject(this.upStar,"tip"):GetComponent("Text")
this.roleUpStarRedPoint=Util.GetGameObject(gameObject,"rolePanel/btnList/btnUpStar/redPoint")
this.goCompoundHero=Util.GetGameObject(this.upStar.transform, "goCompoundHero")
Util.GetGameObject(this.upStar.transform, "goCompoundHero/Text"):GetComponent("Text").text = Language[12290]
--升星属性
this.curStarGrid = Util.GetGameObject(this.upStar.transform, "upStarProInfo/curStarGrid")
this.nextStarGrid = Util.GetGameObject(this.upStar.transform, "upStarProInfo/nextStarGrid")
this.skillInfoGrid = Util.GetGameObject(this.upStar.transform, "upStarProInfo/skillInfo")
this.skillInfoGrid:SetActive(false)
this.atkPro_UpStar=Util.GetGameObject(gameObject,"upStar/upStarProInfo/pro/atk")
this.hpPro_UpStar=Util.GetGameObject(gameObject,"upStar/upStarProInfo/pro/hp")
this.phyDef_UpStar=Util.GetGameObject(gameObject,"upStar/upStarProInfo/pro/phyDef")
this.magDef_UpStar=Util.GetGameObject(gameObject,"upStar/upStarProInfo/pro/magDef")
this.lv_UpStar=Util.GetGameObject(gameObject,"upStar/upStarProInfo/pro/lv/proValue"):GetComponent("Text")
this.nextlv_UpStar=Util.GetGameObject(gameObject,"upStar/upStarProInfo/pro/lv/nextproValue"):GetComponent("Text")
Util.GetGameObject(this.gameObject,"Image/Text"):GetComponent("Text").text = "神将觉醒"
Util.GetGameObject(this.gameObject,"Image (3)/Text"):GetComponent("Text").text = "觉醒要求"
Util.GetGameObject(this.gameObject,"tip"):GetComponent("Text").text = "觉醒后神将天赋会发生变化"
Util.GetGameObject(this.gameObject,"upStarBtn/Text"):GetComponent("Text").text = "觉 醒"
Util.GetGameObject(this.gameObject,"lvUp/Text"):GetComponent("Text").text = "等级上限:"
--天赋
this.talent1Image = Util.GetGameObject(this.gameObject,"talent/talent (1)"):GetComponent("Image")
this.talent1Progress = Util.GetGameObject(this.gameObject,"talent/talent (1)/progress"):GetComponent("Text")
this.talent2Image = Util.GetGameObject(this.gameObject,"talent/talent (2)"):GetComponent("Image")
this.talent2Progress = Util.GetGameObject(this.gameObject,"talent/talent (2)/progress"):GetComponent("Text")
this.curLvEnd = Util.GetGameObject(this.gameObject,"lvUp/curLvEnd"):GetComponent("Text")
this.nextLvEnd = Util.GetGameObject(this.gameObject,"lvUp/nextLvEnd"):GetComponent("Text")
--升星觉醒
this.upStarPre=Util.GetGameObject(this.gameObject,"upStarPre")
this.upStarGrid=Util.GetGameObject(this.gameObject,"grid")
this.upStarBtnRedPoint=Util.GetGameObject(this.gameObject,"upStarBtn/redPoint")
this.goldBtn=Util.GetGameObject(this.gameObject,"goldGrid/gold")
this.goldText=Util.GetGameObject(this.gameObject,"goldGrid/gold/Text"):GetComponent("Text")
this.goldImage=Util.GetGameObject(this.gameObject,"goldGrid/gold")
this.gold2Btn=Util.GetGameObject(this.gameObject,"goldGrid/gold2")
this.gold2Text=Util.GetGameObject(this.gameObject,"goldGrid/gold2/Text"):GetComponent("Text")
this.gold2Image=Util.GetGameObject(this.gameObject,"goldGrid/gold2")
this.upStarBtn=Util.GetGameObject(this.gameObject,"upStarBtn")
return this
end
@ -59,15 +58,7 @@ end
function this:BindEvent()
--升星
Util.AddClick(this.upStarBtn, function()
self:StarUpClick()
end)
--前往化虚坛
Util.AddClick(this.goCompoundHero, function()
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.COMPOUND_HERO) then
JumpManager.GoJump(750001)
else
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.COMPOUND_HERO))
end
this.StarUpClick()
end)
end
@ -87,38 +78,24 @@ function this:OnShow(_sortinglayer,_parent,_curHerodata,_isUpZhen,_heroDatas)
parent = _parent
heroDatas = _heroDatas
isUpZhen = _isUpZhen
this:GetCurHeroUpLvOrUpStarSData()
this:UpdateHeroUpStarData()--进阶
this.GetCurHeroUpLvOrUpStarSData()
this.UpdateHeroUpStarData()--进阶
end
--更新英雄进阶数据
function this:UpdateHeroUpStarData()
function this.UpdateHeroUpStarData()
--进阶材料
this:UpdateHeroUpStarMaterialShow()
--计算面板属性
if isUpZhen then
local formationList = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_NORMAL)
local allHeroTeamAddProVal = HeroManager.GetAllHeroTeamAddProVal(formationList.teamHeroInfos,curHeroData.dynamicId)
allAddProVal = HeroManager.CalculateHeroAllProValList(1, curHeroData.dynamicId, false,nil,nil,true,allHeroTeamAddProVal)
else
allAddProVal = HeroManager.CalculateHeroAllProValList(1,curHeroData.dynamicId,false)
end
this.UpdateHeroUpStarMaterialShow()
--进阶属性提升
if upStarRankUpConfig and upStarRankUpConfig.Id then
this:UpdateHeroUpStarProUpShow()
end
this.curLvEnd.text= HeroManager.GetCurHeroStarLvEnd(1,curHeroData)
this.nextLvEnd.text= HeroManager.GetCurHeroStarLvEnd(2,curHeroData,curHeroData.breakId,upStarRankUpConfig.Id)
--进阶吞英雄条件
Util.ClearChild(this.upStarGrid.transform)
local curUpStarData= HeroManager.GetHeroCurUpStarInfo(curHeroData.dynamicId)
if curUpStarData and #curUpStarData>0 then
this.upStar:SetActive(true)
this.noUpStarText:SetActive(false)
parent.talentTipStrGo:SetActive(true)
upStarConsumeMaterial={}
upStarMaterialIsAll = {}
upStarPreList = {}
this.goCompoundHero:SetActive(curHeroData.star == 4 or curHeroData.star == 5)
for i = 1, #curUpStarData do
local go=newObject(this.upStarPre)
go.transform:SetParent(this.upStarGrid.transform)
@ -153,7 +130,6 @@ function this:UpdateHeroUpStarData()
Util.GetGameObject(go.transform,"iconDefault"):SetActive(true)
Util.GetGameObject(go.transform,"icon"):SetActive(false)
Util.GetGameObject(go.transform,"frame"):GetComponent("Image").sprite=Util.LoadSprite(GetHeroQuantityImageByquality(nil,curUpStarData[i].upStarMaterialsData.StarLimit))
--
end
local upStarHeroListData=HeroManager.GetUpStarHeroListData(curUpStarData[i].upStarMaterialsData.Id,curHeroData)
if upStarHeroListData.state>0 then
@ -167,20 +143,16 @@ function this:UpdateHeroUpStarData()
Util.AddOnceClick(addBtn, function()
curSelectUpStarData=curUpStarData[i]
curSelectUpStarGo=go
local curShowHeroListData=self:SetShowHeroListData(upStarConsumeMaterial,upStarHeroListData.heroList)
local curShowHeroListData=this.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
else
this.upStar:SetActive(false)
this.noUpStarText:SetActive(true)
parent.talentTipStrGo:SetActive(false)
end
self:AutoSelectUpStarHeroList(curUpStarData)
this.AutoSelectUpStarHeroList(curUpStarData)
end
--获取当前英雄的下一突破 和 升星 静态数据
function this:GetCurHeroUpLvOrUpStarSData()
function this.GetCurHeroUpLvOrUpStarSData()
isHeroUpStar = false
upStarRankUpConfig = {}
local heroRankUpConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
@ -197,7 +169,7 @@ function this:GetCurHeroUpLvOrUpStarSData()
end
end
--更新英雄进阶材料显示
function this:UpdateHeroUpStarMaterialShow()
function this.UpdateHeroUpStarMaterialShow()
--进阶金币 妖壶条件
if upStarRankUpConfig then
isUpStarMaterials=true
@ -237,40 +209,8 @@ function this:UpdateHeroUpStarMaterialShow()
end
end
--进阶属性提升
function this:UpdateHeroUpStarProUpShow()
if upStarRankUpConfig and upStarRankUpConfig.Id then
local size = Vector2.New (45,45)
SetHeroStars(this.curStarGrid, curHeroData.star,2,size,-9)
SetHeroStars(this.nextStarGrid, curHeroData.star + 1,2,size,-9)
--this.curLvEnd.text = HeroManager.GetCurHeroStarLvEnd(1,curHeroData)
--this.nextLvEnd.text = HeroManager.GetCurHeroStarLvEnd(2,curHeroData,curHeroData.breakId,upStarRankUpConfig.Id)
local nextUpStarConFig = ConfigManager.GetConfigData(ConfigName.HeroRankupConfig,upStarRankUpConfig.Id)
local nextProUpVal = 0
if nextUpStarConFig then nextProUpVal = nextUpStarConFig.PropertiesDisplay end
--this.proUpVal.text = GetPropertyFormatStr(2, nextProUpVal)
--this.UpdateHeroUpStarProUpSkillShow(this.skillInfoGrid,self:NextStarUpSkillTabs())
local nextallAddProVal=HeroManager.CalculateHeroAllProValList(2,curHeroData.dynamicId,false,curHeroData.breakId,upStarRankUpConfig.Id)
this:ProShow(this.atkPro_UpStar,allAddProVal,HeroProType.Attack,nextallAddProVal)
this:ProShow(this.hpPro_UpStar,allAddProVal,HeroProType.Hp,nextallAddProVal)
this:ProShow(this.phyDef_UpStar,allAddProVal,HeroProType.PhysicalDefence,nextallAddProVal)
this:ProShow(this.magDef_UpStar,allAddProVal,HeroProType.MagicDefence,nextallAddProVal)
this.lv_UpStar.text= HeroManager.GetCurHeroStarLvEnd(1,curHeroData)
this.nextlv_UpStar.text= HeroManager.GetCurHeroStarLvEnd(2,curHeroData,curHeroData.breakId,upStarRankUpConfig.Id)
end
end
function this:ProShow(go,allAddProVal,HeroProType,nextallAddProVal)
local curProSConFig = ConfigManager.GetConfigData(ConfigName.PropertyConfig,HeroProType)
Util.GetGameObject(go,"proName"):GetComponent("Text").text = curProSConFig.Info..""
Util.GetGameObject(go,"proValue"):GetComponent("Text").text = allAddProVal[HeroProType]
Util.GetGameObject(go,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[HeroProType])
if nextallAddProVal then
Util.GetGameObject(go,"nextproValue"):GetComponent("Text").text = nextallAddProVal[HeroProType]
end
end
--升星选择祭品后刷新界面
function this:AutoSelectUpStarHeroList(_curUpStarData)
function this.AutoSelectUpStarHeroList(_curUpStarData)
local curUpStarData= _curUpStarData
if curUpStarData and #curUpStarData>0 then
for i = 1, #curUpStarData do
@ -289,7 +229,7 @@ function this:AutoSelectUpStarHeroList(_curUpStarData)
table.insert(curSelectHeroList,upStarHeroListData.heroList[i])
end
end
self:UpdateUpStarPosHeroData(curSelectHeroList)
this.UpdateUpStarPosHeroData(curSelectHeroList)
end
end
end
@ -302,7 +242,7 @@ end
--刷新当前升星坑位英雄的信息
function this:UpdateUpStarPosHeroData(curSelectHeroList)
function this.UpdateUpStarPosHeroData(curSelectHeroList)
if LengthOfTable(curSelectHeroList)<curSelectUpStarData.upStarData[4] then
upStarMaterialIsAll[curSelectUpStarData.upStarData[2]]=2
Util.GetGameObject(curSelectUpStarGo.transform,"add/add"):SetActive(true)
@ -331,7 +271,7 @@ function this:UpdateUpStarPosHeroData(curSelectHeroList)
end
end
--分析设置升星界面显示的英雄list数据 如果当前升星材料的坑位的英雄数据与 以其他坑位有重合并且选择上的英雄不显示 如果是当前坑位显示的英雄显示对勾
function this:SetShowHeroListData(upStarConsumeMaterial,curHeroList)--1 消耗的总消耗组 2 当前坑位可选择的所有英雄
function this.SetShowHeroListData(upStarConsumeMaterial,curHeroList)--1 消耗的总消耗组 2 当前坑位可选择的所有英雄
--Log("#curHeroList "..#curHeroList)
local curEndShowHeroListData2={}
for i = 1, #curHeroList do
@ -368,7 +308,7 @@ function this:SetShowHeroListData(upStarConsumeMaterial,curHeroList)--1 消耗
return curList
end
--进阶按钮点击事件处理
function this:StarUpClick()
function this.StarUpClick()
if curHeroData.lv>=HeroManager.heroLvEnd[curHeroData.heroConfig.Id] then
PopupTipPanel.ShowTip(Language[11846])
return
@ -390,10 +330,10 @@ function this:StarUpClick()
if #dropItemTabs > 0 then
BagManager.SetDropIsSHowEquipPrint(false)
UIManager.OpenPanel(UIName.RewardItemPopup, msg, 1, function ()
self:DeleteUpStarMaterials()
this.DeleteUpStarMaterials()
end)
else
self:DeleteUpStarMaterials()
this.DeleteUpStarMaterials()
end
end)
end)
@ -404,7 +344,7 @@ function this:StarUpClick()
end
end
--扣除升星 消耗的材料 更新英雄数据
function this:DeleteUpStarMaterials()
function this.DeleteUpStarMaterials()
HeroManager.UpdateSingleHeroDatas(curHeroData.dynamicId,curHeroData.lv,curHeroData.star+1,curHeroData.breakId,upStarRankUpConfig.Id,true)
HeroManager.UpdateSingleHeroSkillData(curHeroData.dynamicId)
for i, v in pairs(heroDatas) do

View File

@ -4,6 +4,7 @@ local this = RoleInfoPanel
local RoleSkinPanel = require("Modules/RoleInfo/RoleSkinPanel")
local RoleInfoLayout = require("Modules/RoleInfo/RoleInfoLayout")
local RoleUpStarLayout = require("Modules/RoleInfo/RoleUpStarLayout")
local RoleAwakeLayout = require("Modules/RoleInfo/RoleAwakeLayout")
local RoleStoryLayout = require("Modules/RoleInfo/RoleStoryLayout")
local _CurPageIndex = 1
@ -14,9 +15,11 @@ local tabs = {
},
[2] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "进阶",rpType = -1,
},
[3] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "传说",rpType = -1,
[3] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "觉醒",rpType = -1,
},
[4] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "皮肤",rpType = -1,
[4] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "传说",rpType = -1,
},
[5] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "皮肤",rpType = -1,
},
}
@ -101,8 +104,9 @@ function RoleInfoPanel:InitComponent()
this.PageList = {
[1] = RoleInfoLayout:InitComponent(Util.GetGameObject(self.transform, "rolePanel/layout/roleInfoLayout")),
[2] = RoleUpStarLayout:InitComponent(Util.GetGameObject(self.transform, "rolePanel/layout/roleUpStarLayout")),
[3] = RoleStoryLayout:InitComponent(Util.GetGameObject(self.transform, "rolePanel/layout/roleStoryLayout")),
[4] = RoleSkinPanel:InitComponent(Util.GetGameObject(self.transform, "rolePanel/layout/roleSkinLayout")),
[3] = RoleAwakeLayout:InitComponent(Util.GetGameObject(self.transform, "rolePanel/layout/roleAwakelayout")),
[4] = RoleStoryLayout:InitComponent(Util.GetGameObject(self.transform, "rolePanel/layout/roleStoryLayout")),
[5] = RoleSkinPanel:InitComponent(Util.GetGameObject(self.transform, "rolePanel/layout/roleSkinLayout")),
}
this.dragView = SubUIManager.Open(SubUIConfig.DragView, self.gameObject.transform)
@ -211,7 +215,7 @@ function RoleInfoPanel:RemoveListener()
end
this.UpdateSkinShow = function()
if _CurPageIndex == 4 then
if _CurPageIndex == 5 then
this:OnPageTabChange(_CurPageIndex)
end
end
@ -372,7 +376,7 @@ function this:UpdateBtnList()
if not tabsList[k] then
tabsList[k] = newObjToParent(this.btnPre,this.btnList)
end
if k == 4 then
if k == 5 then
local configs = ConfigManager.GetAllConfigsDataByKey(ConfigName.HeroSkin,"HeroId",curHeroData.id)
local HeoSkin = {}
for i = 1 ,#configs do
@ -388,7 +392,6 @@ function this:UpdateBtnList()
else
tabsList[k].gameObject:SetActive(true)
end
local title = Util.GetGameObject(tabsList[k], "Text"):GetComponent("Text")
local redpot = Util.GetGameObject(tabsList[k], "redPoint")
title.text = v.title
@ -411,6 +414,19 @@ function this:UpdateBtnList()
end
end)
end
--根据星级决定叶签现隐
if tabsList[2] and tabsList[3] then
if curHeroData.star < 10 then
tabsList[2].gameObject:SetActive(true)
tabsList[3].gameObject:SetActive(false)
elseif curHeroData.star == 10 and curHeroData.heroConfig.Awaken and #curHeroData.heroConfig.Awaken > 0 then
tabsList[2].gameObject:SetActive(false)
tabsList[3].gameObject:SetActive(true)
else
tabsList[2].gameObject:SetActive(false)
tabsList[3].gameObject:SetActive(false)
end
end
end
function this:CheckRedPointType(index,isShowRedPoint)
@ -447,7 +463,7 @@ end
function this:UpdateHeroInfoData()
this:UpdateBtnList()
if _CurPageIndex == 4 then
if _CurPageIndex == 5 then
local configs = ConfigManager.GetAllConfigsDataByKey(ConfigName.HeroSkin,"HeroId",curHeroData.id)
local HeoSkin = {}
for i = 1 ,#configs do