【觉醒】 界面提交
parent
04fce03cd8
commit
1a4349d93b
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6fdbc06502e2f3943ae668768cfe612a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -354,6 +354,7 @@ UIName = {
|
|||
PokemonSkillInfoPopup=353,--灵兽当前技能详情
|
||||
PokemonSingleResultPanel=354,--灵兽
|
||||
GeneralRewardPopup = 355,--通用奖励领取弹窗
|
||||
RoleAwakeTalentPopup = 358,--觉醒天赋界面
|
||||
}
|
||||
|
||||
SubUIConfig = {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,180 @@
|
|||
require("Base/BasePanel")
|
||||
RoleAwakeTalentPopup = Inherit(BasePanel)
|
||||
local this = RoleAwakeTalentPopup
|
||||
local heroConfig
|
||||
local passiveSkillLogicConfig=ConfigManager.GetConfig(ConfigName.PassiveSkillLogicConfig)
|
||||
local passiveSkillConfig=ConfigManager.GetConfig(ConfigName.PassiveSkillConfig)
|
||||
local heroRankupConfig=ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
|
||||
--初始化组件(用于子类重写)
|
||||
function RoleAwakeTalentPopup:InitComponent()
|
||||
|
||||
self.BackMask = Util.GetGameObject(self.transform, "BackMask")
|
||||
this.prefab = Util.GetGameObject(self.gameObject, "pre")
|
||||
this.ScrollParentView1 = Util.GetGameObject(self.gameObject, "bg1/ScrollFitter")
|
||||
this.ScrollView1 = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.ScrollParentView1.transform,
|
||||
this.prefab, Vector2.New(417.8, 870.1), 1, 1)
|
||||
|
||||
this.ScrollParentView2 = Util.GetGameObject(self.gameObject, "bg2/ScrollFitter")
|
||||
this.ScrollView2 = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.ScrollParentView2.transform,
|
||||
this.prefab, Vector2.New(417.8, 870.1), 1, 1)
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function RoleAwakeTalentPopup:BindEvent()
|
||||
Util.AddClick(self.BackMask, function()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function RoleAwakeTalentPopup:AddListener()
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function RoleAwakeTalentPopup:RemoveListener()
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
--传三个参数 是因为图鉴也要用
|
||||
function RoleAwakeTalentPopup:OnOpen(_heroConfig)
|
||||
heroConfig = _heroConfig
|
||||
end
|
||||
|
||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||
function RoleAwakeTalentPopup:OnShow()
|
||||
local OldTalentData = this.GetOldTalentDataShow()
|
||||
local newTalentData = this.GetNewTalentDataShow()
|
||||
this.ScrollView1:SetData(OldTalentData, function(index, go)
|
||||
this.SingOldTalentDataShow(go, OldTalentData[index])
|
||||
end)
|
||||
this.ScrollView2:SetData(newTalentData, function(index, go)
|
||||
this.SingOldTalentDataShow(go, newTalentData[index])
|
||||
end)
|
||||
end
|
||||
function this.GetOldTalentDataShow()
|
||||
local breakSkillDataList = {}
|
||||
local upStarSkillDataList = {}
|
||||
if heroConfig.OpenPassiveSkillRules then
|
||||
for i = 1, #heroConfig.OpenPassiveSkillRules do
|
||||
local Desc = passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Desc
|
||||
if heroConfig.OpenPassiveSkillRules[i][1] == 1 then--突破
|
||||
local titleStr = NumToSimplenessFont[heroRankupConfig[heroConfig.OpenPassiveSkillRules[i][2]].Phase[2]] .. Language[11864]
|
||||
local curBreakId = heroConfig.OpenPassiveSkillRules[i][2]
|
||||
if breakSkillDataList[curBreakId] then
|
||||
breakSkillDataList[curBreakId] = {index = curBreakId,type = 1,str = breakSkillDataList[curBreakId].str .. " <color=#66FF00>"..Desc.."</color>"}
|
||||
else
|
||||
breakSkillDataList[curBreakId] = {index = curBreakId,type = 1,str ="<color=#66FF00>"..titleStr..Desc.."</color>"}
|
||||
end
|
||||
else--升星
|
||||
local curUpStarId = heroConfig.OpenPassiveSkillRules[i][2]
|
||||
local titleStr = NumToSimplenessFont[heroRankupConfig[curUpStarId].Phase[2]] .. Language[11865]
|
||||
local _passiveSkillId = passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Id
|
||||
if upStarSkillDataList[curUpStarId] then
|
||||
upStarSkillDataList[curUpStarId] = {passiveSkillId = _passiveSkillId,type = 2,index = curUpStarId,str = upStarSkillDataList[curUpStarId].str .. " <color=#66FF00>"..Desc.."</color>"}
|
||||
else
|
||||
upStarSkillDataList[curUpStarId] = {passiveSkillId = _passiveSkillId,type = 2,index = curUpStarId,str ="<color=#66FF00>"..titleStr..Desc.."</color>"}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local breakSkillDataList2 = {}
|
||||
for i, v in pairs(breakSkillDataList) do
|
||||
table.insert(breakSkillDataList2,v)
|
||||
end
|
||||
table.sort(breakSkillDataList2, function(a,b) return a.index<b.index end)
|
||||
|
||||
local upStarSkillDataList2 = {}
|
||||
for i, v in pairs(upStarSkillDataList) do
|
||||
table.insert(upStarSkillDataList2,v)
|
||||
end
|
||||
table.sort(upStarSkillDataList2, function(a,b) return a.index<b.index end)
|
||||
|
||||
for i = 1, #upStarSkillDataList2 do
|
||||
table.insert(breakSkillDataList2,upStarSkillDataList2[i])
|
||||
end
|
||||
return upStarSkillDataList2
|
||||
end
|
||||
function this.GetNewTalentDataShow()
|
||||
local breakSkillDataList = {}
|
||||
local upStarSkillDataList = {}
|
||||
if heroConfig.Awaken then
|
||||
for i = 1, #heroConfig.Awaken do
|
||||
local Desc = passiveSkillConfig[heroConfig.Awaken[i][3]].Desc
|
||||
if heroConfig.Awaken[i][1] == 1 then--突破
|
||||
local titleStr = NumToSimplenessFont[heroRankupConfig[heroConfig.Awaken[i][2]].Phase[2]] .. Language[11864]
|
||||
local curBreakId = heroConfig.Awaken[i][2]
|
||||
if breakSkillDataList[curBreakId] then
|
||||
breakSkillDataList[curBreakId] = {index = curBreakId,type = 1,str = breakSkillDataList[curBreakId].str .. " <color=#66FF00>"..Desc.."</color>"}
|
||||
else
|
||||
breakSkillDataList[curBreakId] = {index = curBreakId,type = 1,str ="<color=#66FF00>"..titleStr..Desc.."</color>"}
|
||||
end
|
||||
else--升星
|
||||
local curUpStarId = heroConfig.Awaken[i][2]
|
||||
local titleStr = NumToSimplenessFont[heroRankupConfig[curUpStarId].Phase[2]] .. Language[11865]
|
||||
local _passiveSkillId = passiveSkillConfig[heroConfig.Awaken[i][3]].Id
|
||||
if upStarSkillDataList[curUpStarId] then
|
||||
upStarSkillDataList[curUpStarId] = {passiveSkillId = _passiveSkillId,type = 2,index = curUpStarId,str = upStarSkillDataList[curUpStarId].str .. " <color=#66FF00>"..Desc.."</color>"}
|
||||
else
|
||||
upStarSkillDataList[curUpStarId] = {passiveSkillId = _passiveSkillId,type = 2,index = curUpStarId,str ="<color=#66FF00>"..titleStr..Desc.."</color>"}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local breakSkillDataList2 = {}
|
||||
for i, v in pairs(breakSkillDataList) do
|
||||
table.insert(breakSkillDataList2,v)
|
||||
end
|
||||
table.sort(breakSkillDataList2, function(a,b) return a.index<b.index end)
|
||||
|
||||
local upStarSkillDataList2 = {}
|
||||
for i, v in pairs(upStarSkillDataList) do
|
||||
table.insert(upStarSkillDataList2,v)
|
||||
end
|
||||
table.sort(upStarSkillDataList2, function(a,b) return a.index<b.index end)
|
||||
|
||||
for i = 1, #upStarSkillDataList2 do
|
||||
table.insert(breakSkillDataList2,upStarSkillDataList2[i])
|
||||
end
|
||||
return upStarSkillDataList2
|
||||
end
|
||||
function this.SingOldTalentDataShow(go,data)
|
||||
local breakGo = Util.GetGameObject(go, "breakSkillTextPre")
|
||||
local upStarGo = Util.GetGameObject(go, "upStarSkillTextPre")
|
||||
if data.type == 1 then--突破
|
||||
breakGo:SetActive(true)
|
||||
upStarGo:SetActive(false)
|
||||
breakGo:GetComponent("Text").text = data.str
|
||||
else
|
||||
breakGo:SetActive(false)
|
||||
upStarGo:SetActive(true)
|
||||
local kongStr = ""
|
||||
if passiveSkillLogicConfig[data.passiveSkillId].Judge == 1 then
|
||||
kongStr = " "
|
||||
else
|
||||
kongStr = ""
|
||||
end
|
||||
Util.GetGameObject(upStarGo.transform, "Image"):SetActive(passiveSkillLogicConfig[data.passiveSkillId].Judge == 1)
|
||||
upStarGo:GetComponent("Text").text = kongStr .. data.str
|
||||
end
|
||||
end
|
||||
function this.SingNewTalentDataShow(go,data)
|
||||
|
||||
-- go:GetComponent("Text").text = breakSkillDataList2[i].str
|
||||
-- local kongStr = ""
|
||||
-- if passiveSkillLogicConfig[upStarSkillDataList2[i].passiveSkillId].Judge == 1 then
|
||||
-- kongStr = " "
|
||||
-- else
|
||||
-- kongStr = ""
|
||||
-- end
|
||||
-- Util.GetGameObject(go.transform, "Image"):SetActive(passiveSkillLogicConfig[upStarSkillDataList2[i].passiveSkillId].Judge == 1)
|
||||
-- go:GetComponent("Text").text = kongStr .. upStarSkillDataList2[i].str
|
||||
end
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function RoleAwakeTalentPopup:OnClose()
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function RoleAwakeTalentPopup:OnDestroy()
|
||||
end
|
||||
|
||||
return RoleAwakeTalentPopup
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c9d1c457a0da41f419993e30a1d170b3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -179,7 +179,8 @@ function RoleInfoPanel:BindEvent()
|
|||
this:HeroLockEvent()
|
||||
end)
|
||||
Util.AddClick(this.talentBtn,function()
|
||||
UIManager.OpenPanel(UIName.RoleTalentPopup,curHeroData.heroConfig,curHeroData.breakId,curHeroData.upStarId)
|
||||
-- UIManager.OpenPanel(UIName.RoleTalentPopup,curHeroData.heroConfig,curHeroData.breakId,curHeroData.upStarId)
|
||||
UIManager.OpenPanel(UIName.RoleAwakeTalentPopup,curHeroData.heroConfig)
|
||||
end)
|
||||
|
||||
for i = 1, #this.PageList do
|
||||
|
|
|
|||
Loading…
Reference in New Issue