【新·魂灵宝】提交

dev_chengFeng
ZhangBiao 2021-11-09 14:39:27 +08:00
parent da07b59ad8
commit 76c3c5c0bf
4 changed files with 847 additions and 466 deletions

View File

@ -3249,8 +3249,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 11, y: 34}
m_SizeDelta: {x: 347.16, y: 30}
m_AnchoredPosition: {x: 166.07, y: 34}
m_SizeDelta: {x: 734.83, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &539216850492600908
CanvasRenderer:

View File

@ -425,7 +425,8 @@ UIName = {
TreasureStoreSeason2 = 431,--新百宝商会
PracticeSkillInfoPanel = 430, --修行主角技能信息界面
DemonSlayerNewPanel = 432, --新版三界降魔
RoleGodSoulLayout = 434,
RoleGodSoulLayout = 434, --神魂界面
RewardTalismanSingleShowPopup2 = 435, --新·魂灵宝
}
SubUIConfig = {

View File

@ -3,9 +3,6 @@ local RewardTalismanSingleShowPopup2 = Inherit(BasePanel)
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local passiveSkillConfig = ConfigManager.GetConfig(ConfigName.PassiveSkillConfig)
-- local _BaseProList = {}--基础属性对象
-- local _suitProList = {}--套装属性对象
-- local _superProList = {}--白金属性对象
local typeToUpdate = {
[2] = 2,--已穿戴->卸载单件
[3] = 1,--未穿戴->穿单件
@ -16,33 +13,40 @@ function RewardTalismanSingleShowPopup2:InitComponent()
self.spLoader = SpriteLoader.New()
self.mask = Util.GetGameObject(self.transform, "mask")
self.content = Util.GetGameObject(self.transform, "Content")
--装备详情--topBar
self.textPre = Util.GetGameObject(self.transform, "TextPre")
self.linePre = Util.GetGameObject(self.transform, "line")
--topBar
self.topBar = Util.GetGameObject(self.transform, "Content/topBar")
--装备详情
self.eqiopName = Util.GetGameObject(self.topBar, "name"):GetComponent("Text")
self.icon = Util.GetGameObject(self.topBar, "icon")
self.equipType=Util.GetGameObject(self.topBar, "equipType"):GetComponent("Text")
self.equipQuaText=Util.GetGameObject(self.topBar, "equipQuaText"):GetComponent("Text")
self.equipInfoText=Util.GetGameObject(self.topBar, "equipInfoText"):GetComponent("Text")
self.powerNum=Util.GetGameObject(self.topBar, "powerNum"):GetComponent("Text")
--装备属性--midBar
--basePro
-- self.midBar = Util.GetGameObject(self.transform, "Content/midBar")
-- self.basePro = Util.GetGameObject(self.midBar, "basePro")
-- self.baseProName = Util.GetGameObject(self.basePro, "PropertyName"):GetComponent("Text")
-- self.baseProGrid = Util.GetGameObject(self.basePro, "grid")
-- self.baseProPre = Util.GetGameObject(self.basePro, "grid/curProName")
-- self.baseProPre:SetActive(false)
-- --suitPro
-- self.suitPro = Util.GetGameObject(self.midBar, "suitPro")
-- self.suitProName = Util.GetGameObject(self.suitPro, "PropertyName"):GetComponent("Text")
-- self.suitProGrid = Util.GetGameObject(self.suitPro, "proGrid")
-- self.suitProPre = Util.GetGameObject(self.suitPro, "proGrid/proPre")
-- self.suitProPre:SetActive(false)
-- --superPro
-- self.superPro = Util.GetGameObject(self.midBar, "superPro")
-- self.superProGrid = Util.GetGameObject(self.superPro, "proGrid")
-- self.superProPre = Util.GetGameObject(self.superPro, "proGrid/Desc")
-- self.superProPre:SetActive(false)
self.midBar = Util.GetGameObject(self.transform, "Content/midBar/Grid")
--baseAttri
self.baseAttri = Util.GetGameObject(self.midBar, "baseAttri")
self.baseName = Util.GetGameObject(self.baseAttri, "baseName/attriName"):GetComponent("Text")
self.baseLevel = Util.GetGameObject(self.baseAttri, "baseName/attriNum"):GetComponent("Text")
self.baseGrid = Util.GetGameObject(self.baseAttri, "grid")
self.baseMaster = Util.GetGameObject(self.midBar, "baseMasterAttri")
self.baseMasterName = Util.GetGameObject(self.baseMaster, "baseMaster/attriName"):GetComponent("Text")
self.baseMasterGrid = Util.GetGameObject(self.baseMaster, "gridMaster")
--refineAttri
self.refineAttri = Util.GetGameObject(self.midBar, "refineAttri")
self.refineName = Util.GetGameObject(self.refineAttri, "refineName/attriName"):GetComponent("Text")
self.refineLevel = Util.GetGameObject(self.refineAttri, "refineName/attriNum"):GetComponent("Text")
self.refineGrid = Util.GetGameObject(self.refineAttri, "grid")
self.refineMasterName = Util.GetGameObject(self.refineAttri, "refineMaster/attriName"):GetComponent("Text")
self.refineMasterGrid = Util.GetGameObject(self.refineAttri, "gridMaster")
--treeAttri
self.treeAttri = Util.GetGameObject(self.midBar, "treeAttri")
self.treeName = Util.GetGameObject(self.treeAttri, "treeName/attriName"):GetComponent("Text")
self.treeLevel = Util.GetGameObject(self.treeAttri, "treeName/attriNum"):GetComponent("Text")
self.treeGrid = Util.GetGameObject(self.treeAttri, "grid")
--分解按钮--btmBar
self.btmBar = Util.GetGameObject(self.transform, "Content/btmBar")
@ -53,6 +57,8 @@ function RewardTalismanSingleShowPopup2:InitComponent()
self.btnWear = Util.GetGameObject(self.btnGrid, "btnWear")
self.btnDown = Util.GetGameObject(self.btnGrid, "btnDown")
self.btnSwitch = Util.GetGameObject(self.btnGrid, "btnSwitch")
self.btnUpgrade = Util.GetGameObject(self.btnGrid, "btnUpgrade")
self.btnUpstar = Util.GetGameObject(self.btnGrid, "btnUpstar")
--装备获取途径--btmBar
self.canGetPre = Util.GetGameObject(self.btmBar, "scroll/canGetPre")
self.canGetGrid = Util.GetGameObject(self.btmBar, "scroll")
@ -61,7 +67,15 @@ function RewardTalismanSingleShowPopup2:InitComponent()
self.canGetScrollView.moveTween.MomentumAmount = 1
self.canGetScrollView.moveTween.Strength = 2
self.canGetScrollView.elastic = false
--跳转itemlist
self.jumpViewList = {}
--装备icon
self.itemPre = nil
self.BaseAttriList = {}--基础属性对象
self.RefineAttriList = {}--精炼属性对象
self.treeAttriList = {}--神应属性对象
self.treeAttriList2 = {}--神应属性对象2
end
--绑定事件(用于子类重写)
@ -105,76 +119,290 @@ function RewardTalismanSingleShowPopup2:OnOpen(_parent,_equipData,_openType,_isS
if not _equipData then
return
end
-- self.parent = _parent --父界面
-- self.equipData = _equipData --当前装备数据
-- self.openType = _openType --0不显示按钮、1背包、2已穿戴显示卸下、3未穿戴显示穿戴、4未穿戴显示替换
-- self.howGet:SetActive(_isShowGet and true or false)--是否显示获取途径
-- self.btnGrid:SetActive(self.openType ~= 0)
-- self.curHeroData = _curHeroData --装备了该装备的英雄数据
-- self.position = _position --装备的位置
-- self.nextEquip = _targetEquipData--要替换的目标装备
-- self.isShowGo = _isShowGo and _isShowGo or false--是否显示跳转按钮
-- self.func = _func
self.parent = _parent --父界面
self.equipData = _equipData --当前装备数据
self.openType = _openType --0不显示按钮、1背包、2已穿戴显示卸下、3未穿戴显示穿戴、4未穿戴显示替换
self.howGet:SetActive(_isShowGet and true or false)--是否显示获取途径
self.btnGrid:SetActive(self.openType ~= 0)
self.curHeroData = _curHeroData --装备了该装备的英雄数据
self.nextEquip = _targetEquipData--要替换的目标装备
self.isShowGo = _isShowGo and _isShowGo or false--是否显示跳转按钮
self.func = _func
end
function RewardTalismanSingleShowPopup2:SetBtns()
local itemConfigData=ConfigManager.GetConfigData(ConfigName.ItemConfig, tonumber(self.equipData.id))
self.btnSure:SetActive(itemConfigData.IfResolve==1)
self.btnJump:SetActive(itemConfigData.UseJump and itemConfigData.UseJump > 0 and BagManager.isBagPanel)
self.btnJump:SetActive(BagManager.isBagPanel)
self.btnWear:SetActive(self.openType == 3)
self.btnDown:SetActive(self.openType == 2)
self.btnSwitch:SetActive(self.openType == 4)
self.btnUpgrade:SetActive(self.openType == 2)
self.btnUpstar:SetActive(self.openType == 2)
end
function RewardTalismanSingleShowPopup2:OnShow()
--上部装备基础信息
-- Log("装备id:"..tostring(self.equipData.id).." openType:"..tostring(self.openType))
-- self:SetBtns()
-- local equipConfigData=ConfigManager.GetConfigData(ConfigName.EquipConfig, tonumber(self.equipData.id))
-- local itemConfigData=ConfigManager.GetConfigData(ConfigName.ItemConfig, tonumber(self.equipData.id))
-- self.topBar:GetComponent("Image").sprite = self.spLoader:LoadSprite("t_tongyong_di_"..equipConfigData.Quality)
-- self.equipQuaText.text=GetStringByEquipQua(equipConfigData.Quality,GetQuaStringByEquipQua(equipConfigData.Quality))
-- self.eqiopName.text=GetStringByEquipQua(equipConfigData.Quality,GetLanguageStrById(equipConfigData.Name))
-- self.frame.sprite = self.spLoader:LoadSprite(GetQuantityImageByquality(equipConfigData.Quality))
-- self.icon.sprite = self.spLoader:LoadSprite(GetResourcePath(itemConfigData.ResourceID))
-- self.equipInfoText.text=GetLanguageStrById(itemConfigData.ItemDescribe)
-- self.powerNum.text=EquipManager.CalculateWarForce(self.equipData.id)
-- EquipManager.SetEquipStarShow(self.spLoader, self.star,equipConfigData.Id)
-- self.equipType.text=Language[11089]..GetEquipPosStrByEquipPosNum(equipConfigData.Position)
-- --下部按钮信息
-- self.effectbaijin:SetActive(equipConfigData.Quality==7)
-- Util.SetParticleSortLayer(self.effectbaijin,self.sortingOrder + 1)
self:SetBtns()
--=============================上部装备基础信息============================
local equipConfigData = ConfigManager.GetConfigData(ConfigName.JewelConfig, self.equipData.id)
local itemConfigData = ConfigManager.GetConfigData(ConfigName.ItemConfig, self.equipData.id)
--魂灵宝Icon
if not self.itemPre then
self.itemPre = SubUIManager.Open(SubUIConfig.ItemView,self.icon.transform)
end
self.itemPre:OnOpen(false,{equipConfigData.Id,0},1,false, false,false, 0,self.equipData.idDyn)
--装备描述
self.equipInfoText.text = GetLanguageStrById(itemConfigData.ItemDescribe)
--品质
self.equipQuaText.text = GetStringByEquipQua(equipConfigData.Level,GetQuaStringByEquipQua(equipConfigData.Level))
--装备名称
self.eqiopName.text=GetStringByEquipQua(itemConfigData.Quantity,GetLanguageStrById(itemConfigData.Name))
--装备类型
self.equipType.text = string.format("宝物类型:%s",EquipTreasureTypeStr[equipConfigData.Location])
--上方底图
self.topBar:GetComponent("Image").sprite = self.spLoader:LoadSprite("t_tongyong_di_"..equipConfigData.Level)
--计算战力
local Power = 0
if not self.equipData.idDyn then
Power = EquipTreasureManager.CalculateWarForceBySid(self.equipData.id, self.equipData.lv, self.equipData.refineLv, self.equipData.treeLv)
else
Power = EquipTreasureManager.CalculateWarForce(self.equipData.idDyn)
end
self.powerNum.text = Power
-- --获取途径
-- if self.jumpViewList and #self.jumpViewList > 0 then
-- for i = 1,#self.jumpViewList do
-- SubUIManager.Close(self.jumpViewList[i])
-- end
-- end
-- local curitemData = itemConfig[tonumber(self.equipData.id)]
-- if curitemData and curitemData.Jump then
-- if curitemData.Jump and #curitemData.Jump>0 then
-- self.canGetScrollView:SetData(curitemData.Jump,function (index, item)
-- local tempView = nil
-- if self.isShowGo then
-- tempView = SubUIManager.Open(SubUIConfig.JumpView, item.transform, curitemData.Jump[index],true)
-- else
-- tempView = SubUIManager.Open(SubUIConfig.JumpView, item.transform, curitemData.Jump[index],false)
-- end
-- table.insert(self.jumpViewList,tempView)
-- end,true,true)
-- end
--=============================中部========================================
-- if self.equipData.upHeroDid == "" or self.equipData.upHeroDid == "0" then
-- this.treasurePanel[i].strongAttri.gameObject:SetActive(false)
-- this.treasurePanel[i].refineMasterAttri:SetActive(false)
-- end
--(基础属性)
local baseInfo = EquipTreasureManager.GetCurLvPropertyValue(1,self.equipData.levelPool,self.equipData.lv)
self.baseLevel.text = string.format("[强化等级:%s/%s]",self.equipData.lv,self.equipData.maxLv)
self:SetPropertyShow1(baseInfo,self.BaseAttriList,self.baseGrid)
--(精炼属性)
local refineInfo = EquipTreasureManager.GetCurLvPropertyValue(2,self.equipData.refinePool,self.equipData.refineLv,true)
self.refineLevel.text = string.format("[精炼等级:%s/%s]",self.equipData.refineLv,self.equipData.maxRefineLv)
if LengthOfTable(refineInfo) == 0 or refineInfo == nil then
self.refineAttri:SetActive(false)
else
self.refineAttri:SetActive(true)
self:SetPropertyShow1(refineInfo,self.RefineAttriList,self.refineGrid)
end
--(神应属性)
local treeInfo=SacredTreeManager.GetCurLvPropertyValue(3,self.equipData.treePool,self.equipData.treeLv or 0)
self.treeLevel.text = string.format("[神应等级:%s/%s]",self.equipData.treeLv,self.equipData.maxTreeLv)
if (self.equipData.treeLv < 1 and SacredTreeManager.CulAttri(self.equipData) < 1) or self.openType == 1 or self.openType ~= 0 then
self.treeAttri:SetActive(false)
else
self.treeAttri:SetActive(true)
self:SetPropertyShow2(treeInfo,self.treeAttriList,self.treeGrid,self.treeAttriList2)
end
--=============================下部=========================================
--获取途径
if self.jumpViewList and #self.jumpViewList > 0 then
for i = 1,#self.jumpViewList do
SubUIManager.Close(self.jumpViewList[i])
end
end
local curitemData = itemConfig[tonumber(self.equipData.id)]
if curitemData and curitemData.Jump then
if curitemData.Jump and #curitemData.Jump>0 then
self.canGetScrollView:SetData(curitemData.Jump,function (index, item)
local tempView = nil
if self.isShowGo then
tempView = SubUIManager.Open(SubUIConfig.JumpView, item.transform, curitemData.Jump[index],true)
else
tempView = SubUIManager.Open(SubUIConfig.JumpView, item.transform, curitemData.Jump[index],false)
end
table.insert(self.jumpViewList,tempView)
end,true,true)
end
end
-- --(此处需要三遍才能完全打开)
-- ForceRebuildLayout(self.midBar.transform)
-- ForceRebuildLayout(self.midBar.transform)
-- ForceRebuildLayout(self.midBar.transform)
--(此处需要三遍才能完全打开)
ForceRebuildLayout(self.midBar.transform)
ForceRebuildLayout(self.midBar.transform)
ForceRebuildLayout(self.midBar.transform)
-- if self.func then
-- self.func()
-- end
if self.func then
self.func()
end
end
--基础和精炼属性专用
function RewardTalismanSingleShowPopup2:SetPropertyShow1(_infos,_preList,_grid)
local dataCount=LengthOfTable(_infos)
local preCount=#_preList
for i = 1, dataCount-preCount do
local go = newObject(self.textPre)
go.transform:SetParent(_grid.transform)
go.transform.localScale = Vector3.one
go.transform.localPosition = Vector3.zero
go.gameObject:SetActive(false)
table.insert(_preList,go)
end
local index=1
for key, value in pairs(_infos) do
local obj=_preList[index]
local proper=propertyConfig[key]
if proper.Style==1 then
obj.transform:GetComponent("Text").text = GetLanguageStrById(proper.Info).."+".. value.currValue
else
obj.transform:GetComponent("Text").text=GetLanguageStrById(proper.Info).."+"..value.currValue/100 .."%"
end
obj.gameObject:SetActive(true)
index=index+1
end
for i = 1, #_preList do
if i>=index then
_preList[i]:SetActive(false)
end
end
end
--神应专用
function RewardTalismanSingleShowPopup2:SetPropertyShow2(_infos,_preList,_grid,_preList2)
local curTree = SacredTreeManager.CulAttri(self.equipData)
local attriConfig = ConfigManager.GetConfigDataByKey(ConfigName.GodHoodTreeSetting,"Id",0).PropertyUnlcokLevelForClient
local dataCount=LengthOfTable(_infos)
local preCount=#_preList ---行数
for i = 1, math.ceil(dataCount/2) - preCount do
local go = newObject(self.linePre)
go.transform:SetParent(_grid.transform)
go.transform.localScale = Vector3.one
go.transform.localPosition = Vector3.zero
go.gameObject:SetActive(false)
table.insert(_preList,go)
end
preCount = #_preList2
for i = 1, dataCount - preCount do
local go = newObject(self.textPre)
table.insert(_preList2,go)
go.transform:SetParent(_preList[math.ceil(#_preList2/2)].transform)
go.transform.localScale = Vector3.one
go.transform.localPosition = Vector3.zero
go.gameObject:SetActive(false)
end
local index=1
for key, value in pairs(attriConfig) do
local obj = _preList2[index]
_preList[math.ceil(index/2)].gameObject:SetActive(true)
local proper=propertyConfig[value[1]]
local string = ""
if _infos[value[1]] then
if proper.Style==1 then
string = GetLanguageStrById(proper.Info).."+".._infos[value[1]].currValue--value.currValue
else
string = GetLanguageStrById(proper.Info).."+".._infos[value[1]].currValue/100 .."%"
end
end
if index <= curTree then
string = "<color=#66FF00>"..string.."</color>"
else
string = "<color=#828282>"..string.."\n".."<size=25>"..string.format("(四灵试炼%s层解锁)",attriConfig[index][2]).."</size></color>"
end
obj.transform:GetComponent("Text").text = string
obj.gameObject:SetActive(true)
index=index+1
end
for i = 1, #_preList2 do
if i >= index then
_preList2[i]:SetActive(false)
end
end
for i = 1, #_preList do
if i > math.ceil(index/2) then
_preList[i]:SetActive(false)
end
end
end
--大师判断
function RewardTalismanSingleShowPopup2:GongMingSetData(curTabIndex,proPreList,grid,title,go)
--获取穿戴宝物强化/精炼的最小等级
local minLv--最小等级
local maxlv --最大等级
if #self.equipData.jewels < 2 then
go.gameObject:SetActive(false)
return
end
go.gameObject:SetActive(true)
for i = 1, #self.equipData.jewels do
local curEquipTreasureData = EquipTreasureManager.GetTreasureData(self.equipData.jewels[i])
if curTabIndex == 1 then
if minLv then
if curEquipTreasureData.lv < minLv then
minLv = curEquipTreasureData.lv
end
else
minLv = curEquipTreasureData.lv
end
if maxlv then
if curEquipTreasureData.maxLv < maxlv then
maxlv = curEquipTreasureData.maxLv
end
else
maxlv = curEquipTreasureData.maxLv
end
elseif curTabIndex == 2 then
if minLv then
if curEquipTreasureData.refineLv < minLv then
minLv = curEquipTreasureData.refineLv
end
else
minLv = curEquipTreasureData.refineLv
end
if maxlv then
if curEquipTreasureData.maxRefineLv < maxlv then
maxlv = curEquipTreasureData.maxRefineLv
end
else
maxlv = curEquipTreasureData.maxRefineLv
end
end
end
local curJewelResonanceConfig = nil
local allCurTypeJewelResonanceConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.JewelResonanceConfig,"Type",curTabIndex)
table.sort(allCurTypeJewelResonanceConfig,function(a,b)
return a.SortId<b.SortId
end)
for i = 1, #allCurTypeJewelResonanceConfig do
--获取当前强化/精炼 大师等级数据
if allCurTypeJewelResonanceConfig[i].Level <= minLv then
if curJewelResonanceConfig then
if curJewelResonanceConfig.SortId < allCurTypeJewelResonanceConfig[i].SortId then
curJewelResonanceConfig = allCurTypeJewelResonanceConfig[i]
end
else
curJewelResonanceConfig = allCurTypeJewelResonanceConfig[i]
end
end
end
if curJewelResonanceConfig.SortId < 1 then
go.gameObject:SetActive(false)
return
end
go.gameObject:SetActive(true)
if curTabIndex == 1 then
title.text = string.format("<color=#FE2F33>强化大师%s级</color>",curJewelResonanceConfig.SortId)
else
title.text = string.format("<color=#FE2F33>精炼大师%s级</color>",curJewelResonanceConfig.SortId)
end
for i = 1, math.max(#curJewelResonanceConfig.Property,#proPreList) do
if not curJewelResonanceConfig.Property[i] then
proPreList[i].gameObject:SetActive(false)
else
if not proPreList[i] then
proPreList[i] = newObjToParent(self.textPre,grid.transform)
end
proPreList[i].gameObject:SetActive(true)
local str = GetLanguageStrById(propertyConfig[curJewelResonanceConfig.Property[i][1]].Info).."+"..GetPropertyFormatStr(propertyConfig[curJewelResonanceConfig.Property[i][1]].Style,curJewelResonanceConfig.Property[i][2])
proPreList[i].transform:GetComponent("Text").text = string.format("<color=#66FF00>%s</color>",str)
end
end
return true
end
--界面关闭时调用(用于子类重写)
@ -189,10 +417,12 @@ end
--界面销毁时调用(用于子类重写)
function RewardTalismanSingleShowPopup2:OnDestroy()
self.spLoader:Destroy()
-- _BaseProList = {}
-- _suitProList = {}
-- _superProList = {}
self.BaseAttriList = {}--基础属性对象
self.RefineAttriList = {}--精炼属性对象
self.treeAttriList = {}--神应属性对象
self.treeAttriList2 = {}--神应属性对象2
self.jumpViewList = {}
self.itemPre = nil
end
return RewardTalismanSingleShowPopup2