神兵升级升星相关功能提交

dev_chengFeng
yuanshuai 2023-03-30 16:27:13 +08:00
parent 782c351cec
commit bda6306f3d
9 changed files with 10671 additions and 3322 deletions

View File

@ -493,6 +493,7 @@ UIName = {
GodWeaponInfoPanel=501, --神兵详情
GodWeaponGetInfoPopup=502,--神兵信息弹窗
GodWeaponUpPanel=503, --神兵强化界面
GodWeaponSkillInfoPopup=504, --神兵技能详情界面
}
SubUIConfig = {

View File

@ -8,6 +8,7 @@ function this:InitComponent()
this.spLoader = SpriteLoader.New()
this.icon= Util.GetGameObject(self.gameObject, "iconBg/icon"):GetComponent("Image")
this.nameText=Util.GetGameObject(self.gameObject, "nameInfo/nameText"):GetComponent("Text")
this.starGrid= Util.GetGameObject(self.gameObject, "starGrid/starGrid")
this.propGrid=Util.GetGameObject(self.gameObject, "infoLayout/propertyInfo/grid")
this.upStarBtn=Util.GetGameObject(self.gameObject,"infoLayout/propertyInfo/upStarBtn")
this.upLvBtn=Util.GetGameObject(self.gameObject,"infoLayout/propertyInfo/upLvBtn")
@ -43,6 +44,8 @@ function this:OnOpen(_data)
godwData=_data
this.icon.sprite = this.spLoader:LoadSprite(GetResourcePath(_data.config.Icon))
this.nameText.text=_data.config.Name
local starSize = Vector2.New(65,65)
PokemonManager.SetHeroStars(this.spLoader, this.starGrid,godwData.star,1,starSize)
local allPropDic=GodWeaponManager.GetSinglePokemonAddProData(_data.Did,_data.star)
local propInfoList={}
propInfoList[1]={}
@ -76,9 +79,10 @@ function this:OnOpen(_data)
Util.GetGameObject(skillObj,"titleBg/title"):GetComponent("Text").text=skillInfo[i].title
Util.GetGameObject(skillObj,"des"):GetComponent("Text").text=skillInfo[i].des
skillObj:SetActive(true)
local allSkillData=ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.ShenBingSkill,"SkillPanDuan",skillInfo[i].skillPanDuan,"SpiritAnimalMatch",_data.id)
local helpBtn=Util.GetGameObject(skillObj,"titleBg/helpBtn")
Util.AddOnceClick(helpBtn, function()
UIManager.OpenPanel(UIName.GodWeaponSkillInfoPopup,skillInfo[i].title,allSkillData)
end)
end
end

View File

@ -212,10 +212,10 @@ end
--获取技能信息(名字,描述)
function this.GetSingleGodWeaponSkillDes(_did)
function this.GetSingleGodWeaponSkillDes(_did,_star)
if not allGodWeapons[_did] then return end
local _data = allGodWeapons[_did]
local shenBingSkills=ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.ShenBingSkill,"SpiritAnimalMatch",_data.id,"StarMatch",_data.star)
local shenBingSkills=ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.ShenBingSkill,"SpiritAnimalMatch",_data.id,"StarMatch",_star and _star or _data.star)
local skillInfos={}
for i = 1, #shenBingSkills do
skillInfos[i]={}

View File

@ -0,0 +1,39 @@
require("Base/BasePanel")
GodWeaponSkillInfoPopup = Inherit(BasePanel)
local this=GodWeaponSkillInfoPopup
--初始化组件(用于子类重写)
function this:InitComponent()
this.closeBtn=Util.GetGameObject(self.gameObject, "closeBtn")
this.content=Util.GetGameObject(self.gameObject, "Content")
this.title=Util.GetGameObject(self.gameObject, "Content/Title/Text"):GetComponent("Text")
end
--绑定事件(用于子类重写)
function this:BindEvent()
Util.AddClick(this.closeBtn, function()
self:ClosePanel()
end)
end
--界面打开时调用(用于子类重写)--技能名称、技能信息
function this:OnOpen(skillName,skillDatas)--data 未获得的时候为灵兽静态ID 获得的时候为本地数据
this.title.text=skillName
for i=1,#skillDatas do
local desObj= this.content.transform:GetChild(i).gameObject
Util.GetGameObject(desObj,"star"):GetComponent("Text").text=string.format("神兵%s星激活",skillDatas[i].StarMatch)
Util.GetGameObject(desObj,"infoTxt"):GetComponent("Text").text=skillDatas[i].Desc
desObj:SetActive(true)
end
end
--界面关闭时调用(用于子类重写)
function this:OnClose()
end
--界面销毁时调用(用于子类重写)
function this:OnDestroy()
end
return this

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6b3e699c0df269846897dd5acfaf4b03
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -9,8 +9,8 @@ function this:InitComponent()
this.spLoader = SpriteLoader.New()
this.icon= Util.GetGameObject(self.gameObject, "iconBg/icon"):GetComponent("Image")
this.nameText=Util.GetGameObject(self.gameObject, "nameInfo/nameText"):GetComponent("Text")
this.curPropGrid=Util.GetGameObject(self.gameObject, "infoLayout/propertyInfo/curProp")
this.nextPropGrid=Util.GetGameObject(self.gameObject, "infoLayout/propertyInfo/nextProp")
this.curPropGrid=Util.GetGameObject(self.gameObject, "infoLayout/propertyInfo/allProp/curProp")
this.nextPropGrid=Util.GetGameObject(self.gameObject, "infoLayout/propertyInfo/allProp/nextProp")
this.upStarTab=Util.GetGameObject(self.gameObject,"tabBg/tabBox/upStarTab")
this.upLvTab=Util.GetGameObject(self.gameObject,"tabBg/tabBox/upLvTab")
this.selectBtn=Util.GetGameObject(self.gameObject,"tabBg/tabBox/selectBtn")
@ -22,6 +22,10 @@ function this:InitComponent()
this.upLvBtn=Util.GetGameObject(self.gameObject,"infoLayout/btnLayout/upLvBtn")
this.limitText=Util.GetGameObject(self.gameObject,"infoLayout/btnLayout/limitText"):GetComponent("Text")
this.jiantou=Util.GetGameObject(self.gameObject,"infoLayout/propertyInfo/jiantou")
this.starGrid=Util.GetGameObject(self.gameObject,"starGrid/starGrid")
this.skillScroll=Util.GetGameObject(self.gameObject,"infoLayout/skillLayout/skillScroll/skillGrid")
this.curSkillInfo=Util.GetGameObject(self.gameObject,"infoLayout/skillLayout/skillScroll/skillGrid/curSkillInfo")
this.nextSkillInfo=Util.GetGameObject(self.gameObject,"infoLayout/skillLayout/skillScroll/skillGrid/nextSkillInfo")
this.costItemViews={}
end
@ -75,6 +79,8 @@ end
function this.UpdateWinInfo()
this.curLv.text="等级:"..godWeaponData.lv
local starSize = Vector2.New(80,80)
PokemonManager.SetHeroStars(this.spLoader, this.starGrid, godWeaponData.star,1,starSize)
local curPropDic
local nextPropDic
local costItems={}
@ -125,6 +131,11 @@ function this.UpdateWinInfo()
this.SetCostItemInfo(costItems)
end
local curSkillInfos= GodWeaponManager.GetSingleGodWeaponSkillDes(godWeaponData.Did)
local nextSkillInfos=GodWeaponManager.GetSingleGodWeaponSkillDes(godWeaponData.Did,godWeaponData.star+1)
this.SetSkillInfo(this.curSkillInfo,"升星前技能",curSkillInfos)
this.SetSkillInfo(this.nextSkillInfo,"升星后技能",nextSkillInfos)
LayoutRebuilder.ForceRebuildLayoutImmediate(this.skillScroll.transform)
end
---设置属性信息
@ -150,8 +161,17 @@ function this.SetPropInfo(_propDic,_propGrid)
end
end
--设置升星技能信息显示
function this.SetSkillInfo()
function this.SetSkillInfo(_skillInfoObj,_titleStr,_skillDatas)
Util.GetGameObject(_skillInfoObj,"title"):GetComponent("Text").text=_titleStr
local desStr=""
for i = 1, #_skillDatas do
desStr=desStr..string.format("【%s】%s",_skillDatas[i].title,_skillDatas[i].des)
if i< #_skillDatas then
desStr=desStr.."\n"
end
end
Util.GetGameObject(_skillInfoObj,"des"):GetComponent("Text").text=desStr
LayoutRebuilder.ForceRebuildLayoutImmediate(_skillInfoObj.transform)
end
--设置消耗材料显示
function this.SetCostItemInfo(_costItems)