神兵相关功能提交

dev_chengFeng
yuanshuai 2023-03-30 13:16:11 +08:00
parent 24ad78e8da
commit 6c215136f2
11 changed files with 10292 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1162074846bcc244582d39840777d52c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 17bc7dd96d10d8d4eaa5e71ad78421dc
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -490,6 +490,8 @@ UIName = {
GodsWayTreasurePanel=498,
GodWeaponMainPanel=499,--神兵主界面
GodWeaponListPanel=500, --神兵列表
GodWeaponInfoPanel=501, --神兵详情
GodWeaponUpPanel=503, --神兵强化界面
}
SubUIConfig = {

View File

@ -0,0 +1,107 @@
require("Base/BasePanel")
GodWeaponInfoPanel = Inherit(BasePanel)
local this = GodWeaponInfoPanel
local godwData
--初始化组件(用于子类重写)
function this:InitComponent()
this.btnBack = Util.GetGameObject(self.gameObject, "btnBack")
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.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")
this.skillGrid=Util.GetGameObject(self.gameObject,"infoLayout/skill/scroll/grid")
end
--绑定事件(用于子类重写)
function this:BindEvent()
Util.AddClick(this.btnBack, function()
self:ClosePanel()
end)
Util.AddClick(this.upStarBtn, function()
UIManager.OpenPanel(UIName.GodWeaponUpPanel,1,godwData)
end)
Util.AddClick(this.upLvBtn, function()
UIManager.OpenPanel(UIName.GodWeaponUpPanel,2,godwData)
end)
end
--添加事件监听(用于子类重写)
function this:AddListener()
end
--移除事件监听(用于子类重写)
function this:RemoveListener()
end
--界面打开时调用(用于子类重写)
function this:OnOpen(_data)
godwData=_data
this.icon.sprite = this.spLoader:LoadSprite(GetResourcePath(_data.config.Icon))
this.nameText.text=_data.config.Name
local allPropDic=GodWeaponManager.GetSinglePokemonAddProData(_data.Did,_data.star)
local propInfoList={}
propInfoList[1]={}
propInfoList[1].name="等级"
propInfoList[1].val=_data.lv
local index=2
for key, value in pairs(allPropDic) do
propInfoList[index]={}
local propConfig=ConfigManager.GetConfigData(ConfigName.PropertyConfig,key)
propInfoList[index].name=propConfig.Info
propInfoList[index].val=value
index=index+1
end
for i = 1, this.propGrid.transform.childCount do
local propText=this.propGrid.transform:GetChild(i-1).gameObject
if i>#propInfoList then
propText:SetActive(false)
else
propText:SetActive(true)
propText:GetComponent("Text").text=propInfoList[i].name
Util.GetGameObject(propText,"val"):GetComponent("Text").text=propInfoList[i].val
end
end
local skillInfo=GodWeaponManager.GetSingleGodWeaponSkillDes(_data.Did)
for i = 1,this.skillGrid.transform.childCount do
local skillObj=this.skillGrid.transform:GetChild(i-1).gameObject
if i>#skillInfo then
skillObj:SetActive(false)
else
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 helpBtn=Util.GetGameObject(skillObj,"titleBg/helpBtn")
Util.AddOnceClick(helpBtn, function()
end)
end
end
LayoutRebuilder.ForceRebuildLayoutImmediate(this.skillGrid.transform)
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function this:OnShow()
end
function this:OnSortingOrderChange()
this.sortingOrder = self.sortingOrder
end
--界面关闭时调用(用于子类重写)
function this:OnClose()
end
--界面销毁时调用(用于子类重写)
function this:OnDestroy()
this.spLoader:Destroy()
end
return this

View File

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

View File

@ -278,7 +278,7 @@ function this.ShowSinglePokemonList(go,singleData,liveIndex)
local heroClick=Util.GetGameObject(PokemonList[liveIndex],"DragView"..liveIndex)
Util.AddOnceClick(heroClick, function()
if isClick then
UIManager.OpenPanel(UIName.PokemonInfoPanel,curData,PokemonManager.GetPokemonUpZhenDatas())
UIManager.OpenPanel(UIName.GodWeaponInfoPanel,curData)
end
end)
end

View File

@ -164,14 +164,14 @@ function this.GetPokemonFormationAddPro()
end
--获取单个神兵属性 (灵兽属性/编队人数 神兵属性会平分给上阵的所有神将)
function this.GetSinglePokemonAddProData(_did,_star)--_star 传值的话就用此星级计算属性
function this.GetSinglePokemonAddProData(_did,_star,_lv)--_star 传值的话就用此星级计算属性
-- LogPink("_did 1 ".._did)
if not allGodWeapons[_did] then return end
-- LogPink("_did 2 ".._did)
local addAllProVal = {}
local curPokeonData = allGodWeapons[_did]
local curPokemonConFig = ConfigManager.GetConfigData(ConfigName.ShenBing,curPokeonData.id)
local curPokemonLvConFig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.ShenBingLevel,"Quality",curPokemonConFig.Quality,"Level",curPokeonData.lv)
local curPokemonLvConFig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.ShenBingLevel,"Quality",curPokemonConFig.Quality,"Level",_lv and _lv or curPokeonData.lv)
local curPokemonStarConFig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.ShenbingStar,"Quality",curPokemonConFig.Quality,"Star",_star and _star or curPokeonData.star)
--基础
addAllProVal[HeroProType.Hp] = curPokemonConFig.Hp
@ -198,6 +198,21 @@ function this.GetSinglePokemonAddProData(_did,_star)--_star 传值的话就用
return addEndAllProVal
end
--获取技能信息(名字,描述)
function this.GetSingleGodWeaponSkillDes(_did)
if not allGodWeapons[_did] then return end
local _data = allGodWeapons[_did]
local shenBingSkills=ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.ShenBingSkill,"SpiritAnimalMatch",_data.id,"StarMatch",_data.star)
local skillInfos={}
for i = 1, #shenBingSkills do
skillInfos[i]={}
skillInfos[i].title=shenBingSkills[i].Name
skillInfos[i].des=shenBingSkills[i].Desc
skillInfos[i].skillPanDuan=shenBingSkills[i].SkillPanDuan
end
return skillInfos
end
return this

View File

@ -0,0 +1,191 @@
require("Base/BasePanel")
GodWeaponUpPanel = Inherit(BasePanel)
local this = GodWeaponUpPanel
local tabType=1 --1升星 2升级
local godWeaponData
--初始化组件(用于子类重写)
function this:InitComponent()
this.btnBack = Util.GetGameObject(self.gameObject, "btnBack")
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.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")
this.selectText=Util.GetGameObject(self.gameObject,"tabBg/tabBox/selectBtn/Text"):GetComponent("Text")
this.curLv=Util.GetGameObject(self.gameObject,"infoLayout/costMatBg/curLv/Text"):GetComponent("Text")
this.costGrid=Util.GetGameObject(self.gameObject,"infoLayout/costMatBg/costGrid")
this.skillLayout=Util.GetGameObject(self.gameObject,"infoLayout/skillLayout")
this.upStarBtn=Util.GetGameObject(self.gameObject,"infoLayout/btnLayout/upStarBtn")
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.costItemViews={}
end
--绑定事件(用于子类重写)
function this:BindEvent()
Util.AddClick(this.btnBack, function()
self:ClosePanel()
end)
Util.AddClick(this.upStarTab, function()
tabType=1
this.SetSelectBtn()
this.UpdateWinInfo()
end)
Util.AddClick(this.upLvTab, function()
tabType=2
this.SetSelectBtn()
this.UpdateWinInfo()
end)
Util.AddClick(this.upStarBtn, function()
end)
Util.AddClick(this.upLvBtn, function()
end)
end
function this.SetSelectBtn()
local _btnTab
if tabType==1 then
_btnTab=this.upStarTab
this.selectText.text="升星"
else
_btnTab=this.upLvTab
this.selectText.text="升级"
end
this.selectBtn.transform:SetParent(_btnTab.transform)
this.selectBtn.transform.localPosition = Vector3.zero
this.selectBtn.transform.localScale = Vector3.one
end
--界面打开时调用(用于子类重写)
function this:OnOpen(_type,_data)
tabType=_type
godWeaponData=_data
this.SetSelectBtn()
this.icon.sprite = this.spLoader:LoadSprite(GetResourcePath(godWeaponData.config.Icon))
this.nameText.text=godWeaponData.config.Name
this.UpdateWinInfo()
end
function this.UpdateWinInfo()
this.curLv.text="等级:"..godWeaponData.lv
local curPropDic
local nextPropDic
local costItems={}
local isLimit=false
LogBlue(godWeaponData.star.."||||"..godWeaponData.lv.."####"..godWeaponData.config.Quality)
if tabType==1 then
isLimit=godWeaponData.star>=5
this.skillLayout.gameObject:SetActive(true)
this.upStarBtn.gameObject:SetActive(true)
this.upLvBtn.gameObject:SetActive(false)
this.curLv.transform.parent.gameObject:SetActive(false)
curPropDic=GodWeaponManager.GetSinglePokemonAddProData(godWeaponData.Did,godWeaponData.star,godWeaponData.lv)
if not isLimit then
nextPropDic=GodWeaponManager.GetSinglePokemonAddProData(godWeaponData.Did,godWeaponData.star+1,godWeaponData.lv)
local starConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ShenbingStar,"Star",godWeaponData.star,"Quality",godWeaponData.config.Quality)
costItems[1]={}
costItems[1][1]=godWeaponData.id
costItems[1][2]=starConfig.ConsumeItemNum
end
this.limitText.text="星级已满"
else
isLimit=godWeaponData.lv>=200
this.skillLayout.gameObject:SetActive(false)
this.upStarBtn.gameObject:SetActive(false)
this.upLvBtn.gameObject:SetActive(true)
this.curLv.transform.parent.gameObject:SetActive(true)
curPropDic=GodWeaponManager.GetSinglePokemonAddProData(godWeaponData.Did,godWeaponData.star,godWeaponData.lv)
if not isLimit then
nextPropDic=GodWeaponManager.GetSinglePokemonAddProData(godWeaponData.Did,godWeaponData.star,godWeaponData.lv+1)
costItems=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ShenBingLevel,"Level",godWeaponData.lv,"Quality",godWeaponData.config.Quality).Consume
end
this.limitText.text="等级已满"
end
this.SetPropInfo(curPropDic,this.curPropGrid)
---判断等级星级是否达到上限
if isLimit then
this.jiantou.gameObject:SetActive(false)
this.upStarBtn.gameObject:SetActive(false)
this.upLvBtn.gameObject:SetActive(false)
this.limitText.gameObject:SetActive(true)
this.nextPropGrid.gameObject:SetActive(false)
this.costGrid.gameObject:SetActive(false)
else
this.costGrid.gameObject:SetActive(true)
this.SetPropInfo(nextPropDic,this.nextPropGrid)
this.SetCostItemInfo(costItems)
end
end
---设置属性信息
function this.SetPropInfo(_propDic,_propGrid)
local propInfoList={}
local index=1
for key, value in pairs(_propDic) do
propInfoList[index]={}
local propConfig=ConfigManager.GetConfigData(ConfigName.PropertyConfig,key)
propInfoList[index].name=propConfig.Info
propInfoList[index].val=value
index=index+1
end
for i = 1, _propGrid.transform.childCount do
local propText=_propGrid.transform:GetChild(i-1).gameObject
if i>#propInfoList then
propText:SetActive(false)
else
propText:SetActive(true)
propText:GetComponent("Text").text=propInfoList[i].name
Util.GetGameObject(propText,"val"):GetComponent("Text").text=propInfoList[i].val
end
end
end
--设置升星技能信息显示
function this.SetSkillInfo()
end
--设置消耗材料显示
function this.SetCostItemInfo(_costItems)
if not this.costItemViews then
this.costItemViews = {}
end
for k,v in ipairs(this.costItemViews) do
v.gameObject:SetActive(false)
end
for i = 1, #_costItems do
if i<#this.costItemViews then
this.costItemViews[i].OnOpen(false,{_costItems[i][1],_costItems[i][2]},0.9,true,false,false,this.sortingOrder)
else
local view= SubUIManager.Open(SubUIConfig.ItemView, this.costGrid.transform)
view:OnOpen(false,{_costItems[i][1],_costItems[i][2]},0.9,true,false,false,this.sortingOrder)
this.costItemViews[i]=view
end
end
end
function this:OnSortingOrderChange()
this.sortingOrder = self.sortingOrder
end
--界面关闭时调用(用于子类重写)
function this:OnClose()
end
--界面销毁时调用(用于子类重写)
function this:OnDestroy()
this.spLoader:Destroy()
end
return this

View File

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