角色特训的数据结构和uidata
parent
5f191e29cb
commit
5b4dbf3c92
|
@ -516,6 +516,7 @@ UIName = {
|
|||
TrainBuildPanel = 524,
|
||||
TrainBuildLvUpPanel = 525,
|
||||
TrainSelectHeroPanel = 526,
|
||||
SpecailTrainingInfoPopup=527.--角色特训弹窗
|
||||
}
|
||||
|
||||
SubUIConfig = {
|
||||
|
|
|
@ -225,7 +225,18 @@ function this.UpdateHeroDatas(_msgHeroData, isFindHandBook)
|
|||
heroData.warPower = 0--HeroPowerManager.GetHeroPower(heroData.dynamicId)
|
||||
--远征初始化血量
|
||||
--ExpeditionManager.InitHeroHpValue(heroData)
|
||||
|
||||
--特训数据
|
||||
heroData.HeroTraining=_msgHeroData.HeroTraining
|
||||
if not heroData.HeroTraining then
|
||||
heroData.HeroTraining={
|
||||
heroId=_id,
|
||||
trainingLv=1,
|
||||
attackExp=0,
|
||||
defenseExp=0,
|
||||
hpExp=0,
|
||||
unlockIds=nil,
|
||||
isTraining=0, }
|
||||
end
|
||||
GodSoulManager.BindHeroDatas(_msgHeroData)
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,139 @@
|
|||
require("Base/BasePanel")
|
||||
SpecailTrainingInfoPopup = Inherit(BasePanel)
|
||||
----- 修行境界预览弹窗 -----
|
||||
-- SpecailTrainingInfoPopup = {}
|
||||
--传入父脚本模块
|
||||
local parent
|
||||
local _HeroTraining
|
||||
local Training = ConfigManager.GetConfig(ConfigName.Train)
|
||||
|
||||
function SpecailTrainingInfoPopup:InitComponent()
|
||||
self.titleText = Util.GetGameObject(self.gameObject,"Panel/Title"):GetComponent("Text")
|
||||
self.itemPre = Util.GetGameObject(self.gameObject,"Panel/Pre")
|
||||
self.GameObject = Util.GetGameObject(self.gameObject,"Panel/Scroll")
|
||||
|
||||
local rootHight = self.GameObject.transform.rect.height
|
||||
local width = self.GameObject.transform.rect.width
|
||||
self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollFitterView, self.GameObject.transform,
|
||||
self.itemPre, Vector2.New(width, rootHight), 1, 0)
|
||||
self.ScrollView.moveTween.MomentumAmount = 1
|
||||
self.ScrollView.moveTween.Strength = 2
|
||||
|
||||
self.preList = {}
|
||||
self.textList = {}
|
||||
end
|
||||
|
||||
function SpecailTrainingInfoPopup:BindEvent()
|
||||
|
||||
end
|
||||
|
||||
function SpecailTrainingInfoPopup:AddListener()
|
||||
end
|
||||
|
||||
function SpecailTrainingInfoPopup:RemoveListener()
|
||||
end
|
||||
|
||||
function SpecailTrainingInfoPopup:OnShow(_args)
|
||||
|
||||
_HeroTraining = _args
|
||||
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
|
||||
self.titleText.text = "特训"
|
||||
--self.previewData = PracticeManager.GetPreViewData()
|
||||
local showList={}
|
||||
local tData=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.Train,"Id",_HeroTraining.HeroId)
|
||||
if tData then
|
||||
for k,v in ipairs(tData) do
|
||||
if not showList[v.Id] then
|
||||
showList[v.Id]=v
|
||||
end
|
||||
end
|
||||
end
|
||||
self.ScrollView:SetData(self.previewData, function(index, go)
|
||||
self:SetSingleData(index,go,showList)
|
||||
end)
|
||||
ForceRebuildLayout(self.GameObject.transform)
|
||||
-- self.ScrollView:SetIndex(PracticeManager.PracticeBigLevel)
|
||||
end
|
||||
|
||||
function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data)
|
||||
-- local title = Util.GetGameObject(_go,"title/Text"):GetComponent("Text")
|
||||
-- local specialText = Util.GetGameObject(_go,"SpecialText"):GetComponent("Text")
|
||||
-- local textPre = Util.GetGameObject(_go,"Content/Text")
|
||||
-- local content = Util.GetGameObject(_go,"Content")
|
||||
-- local star = Util.GetGameObject(_go,"title/Star"):GetComponent("Text")
|
||||
-- local starImg = Util.GetGameObject(_go,"title/Image")
|
||||
-- if not self.textList[_go] then
|
||||
-- self.textList[_go] = {}
|
||||
-- end
|
||||
-- local singleTextList = self.textList[_go]
|
||||
-- for k,v in ipairs(singleTextList) do
|
||||
-- v.gameObject:SetActive(false)
|
||||
-- end
|
||||
-- --进行排序
|
||||
-- local templist = {}
|
||||
-- for key, value in pairs(_data.AddList) do
|
||||
-- local sData = {}
|
||||
-- sData.id = key
|
||||
-- sData.value = value
|
||||
-- table.insert(templist,sData)
|
||||
-- end
|
||||
-- table.sort(templist,function (a,b)
|
||||
-- return a.id < b.id
|
||||
-- end)
|
||||
-- --显示文字
|
||||
-- for i = 1, #templist do
|
||||
-- if not singleTextList[i] then
|
||||
-- singleTextList[i] = newObject(textPre)
|
||||
-- singleTextList[i].transform:SetParent(content.transform)
|
||||
-- singleTextList[i].transform.localScale = Vector3.one
|
||||
-- singleTextList[i].transform.localPosition = Vector3.zero
|
||||
-- end
|
||||
-- local Text = singleTextList[i]:GetComponent("Text")
|
||||
-- local num = Util.GetGameObject(singleTextList[i],"num"):GetComponent("Text")
|
||||
-- local string,string2 = PracticeManager.GetPreviewSingleText(templist[i].id,templist[i].value)
|
||||
-- singleTextList[i]:SetActive(true)
|
||||
-- Text.text = string
|
||||
-- num.text = string2
|
||||
-- if _data.IsActive == 2 then
|
||||
-- Text.text = string.format("<color=#00ff00>%s</color>",string)
|
||||
-- num.text = string.format("<color=#00ff00>%s</color>",string2)
|
||||
-- elseif _data.IsActive == 1 and not XiuXianConfig[PracticeManager.PracticeLevel].LevelUpCost then
|
||||
-- Text.text = string.format("<color=#00ff00>%s</color>",string)
|
||||
-- num.text = string.format("<color=#00ff00>%s</color>",string2)
|
||||
-- end
|
||||
-- end
|
||||
-- if _data.RealmDesc then
|
||||
-- specialText.gameObject:SetActive(true)
|
||||
-- specialText.text = _data.RealmDesc
|
||||
-- if _data.IsActive == 1 or _data.IsActive == 2 then
|
||||
-- specialText.text = string.format("<color=#00ff00>%s</color>",_data.RealmDesc)
|
||||
-- end
|
||||
-- else
|
||||
-- specialText.gameObject:SetActive(false)
|
||||
-- end
|
||||
-- title.text = string.format("%s期",_data.RealmName)
|
||||
-- if _data.NeedStarNum ~= 0 then
|
||||
-- star.gameObject:SetActive(true)
|
||||
-- starImg.gameObject:SetActive(true)
|
||||
-- if _data.NeedStarNum > PracticeManager.StarNum then
|
||||
-- star.text = string.format("<color=red>需要%s</color>",_data.NeedStarNum)
|
||||
-- else
|
||||
-- star.text = string.format("<color=#00ff00>需要%s</color>",_data.NeedStarNum)
|
||||
-- end
|
||||
-- else
|
||||
-- star.gameObject:SetActive(false)
|
||||
-- starImg.gameObject:SetActive(false)
|
||||
-- end
|
||||
-- ForceRebuildLayout(_go.transform)
|
||||
-- _go:SetActive(true)
|
||||
end
|
||||
|
||||
function SpecailTrainingInfoPopup:OnClose()
|
||||
|
||||
end
|
||||
|
||||
function SpecailTrainingInfoPopup:OnDestroy()
|
||||
self.textList = {}
|
||||
end
|
||||
|
||||
return SpecailTrainingInfoPopup
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4efdd3b8635dfa94e9d74da6a7ead9ce
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue