神将情报界面装备宝物修改提交

dev_chengFeng
jiaoyangna 2021-08-30 16:44:26 +08:00
parent 7756dd8292
commit 1ea100ed83
8 changed files with 670 additions and 2532 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3738,7 +3738,7 @@ function this.CheckIsUpTreasure(Did,index)
if not Did then if not Did then
return false return false
end end
local curEquipData = EquipTreasureManager.GetSingleEquipTreasreData(Did) local curEquipData = EquipTreasureManager.GetSingleEquipTreasreData(Did) or MonsterCampManager.GetSingleTreasureByIdDyn(Did)
local isMax,isMatEnough,items local isMax,isMatEnough,items
local indexType = curEquipData.equipType == 1 and HarmonyAddType.HunSoulPrint or HarmonyAddType.LingSoulPrint local indexType = curEquipData.equipType == 1 and HarmonyAddType.HunSoulPrint or HarmonyAddType.LingSoulPrint
if index == 1 then if index == 1 then

View File

@ -151,6 +151,7 @@ function RoleInfoPopup:OnOpen(...)
this.selsectSkillImage:SetActive(false) this.selsectSkillImage:SetActive(false)
local arg = { ... } local arg = { ... }
curHeroData = arg[1] curHeroData = arg[1]
LogGreen("curHeroData:"..curHeroData.dynamicId)
this.isOther = arg[2] this.isOther = arg[2]
choosedList = arg[3] or nil choosedList = arg[3] or nil
formationHeroNum = arg[4] or nil formationHeroNum = arg[4] or nil
@ -172,6 +173,10 @@ end
--界面销毁时调用(用于子类重写) --界面销毁时调用(用于子类重写)
function RoleInfoPopup:OnDestroy() function RoleInfoPopup:OnDestroy()
for k,v in pairs(this.treasureDatas) do
SubUIManager.Close(v)
end
this.treasureDatas = {}
this.spLoader:Destroy() this.spLoader:Destroy()
soulPrintPreList={} soulPrintPreList={}
this.pinjieList={} this.pinjieList={}
@ -311,59 +316,45 @@ function this.RoleInfo1()
end end
--装备 --装备
function this.EquipInfo() function this.EquipInfo()
local curHeroEquipDatas = {} if not this.treasureDatas then
LogBlue("curHeroData.equipIdList:"..#curHeroData.equipIdList) this.treasureDatas = {}
for i = 1, #curHeroData.equipIdList do
local equipData = {}
if (this.isOther) then
equipData = GoodFriendManager.GetSingleEquipData(curHeroData.equipIdList[i])
else
equipData = EquipManager.GetSingleEquipData(curHeroData.equipIdList[i])
end end
for k,v in pairs(this.treasureDatas) do
v.gameObject:SetActive(false)
end
local curHeroEquipDatas = {}
for i = 1, #curHeroData.equipIdList do
local equipData = GoodFriendManager.GetSingleEquipData(curHeroData.equipIdList[i]) or EquipManager.GetSingleEquipData(curHeroData.equipIdList[i])
if equipData ~= nil then if equipData ~= nil then
curHeroEquipDatas[equipData.equipConfig.Position] = equipData curHeroEquipDatas[equipData.equipConfig.Position] = equipData
end end
end end
--this.equipGrid:GetComponent("Canvas").sortingOrder = this.sortingOrder + 1
for i = 1, this.equipGrid.transform.childCount do for i = 1, this.equipGrid.transform.childCount do
local go = this.equipGrid.transform:GetChild(i - 1).gameObject local go = this.equipGrid.transform:GetChild(i - 1).gameObject
local pos = Util.GetGameObject(go.transform, "pos")
local curEquipData local curEquipData
--Util.GetGameObject(go.transform,"Frame"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetQuantityImageByquality(2))
if curHeroEquipDatas[i] then if curHeroEquipDatas[i] then
Util.GetGameObject(go.transform, "Frame"):SetActive(true)
Util.GetGameObject(go.transform, "Frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(curHeroEquipDatas[i].frame)
Util.GetGameObject(go.transform, "Frame/Icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(curHeroEquipDatas[i].icon)
if curHeroEquipDatas[i].itemConfig.ItemBaseType == ItemBaseType.Equip then
SetHeroStars(this.spLoader, Util.GetGameObject(go.transform, "Frame/star"),curHeroEquipDatas[i].star)
end
curEquipData = curHeroEquipDatas[i] curEquipData = curHeroEquipDatas[i]
else if not this.treasureDatas[pos] then
Util.GetGameObject(go.transform, "Frame"):SetActive(false) this.treasureDatas[pos] = SubUIManager.Open(SubUIConfig.ItemView,pos.transform)
end end
local frameBtn = Util.GetGameObject(go.transform, "Frame") this.treasureDatas[pos].gameObject:SetActive(true)
this.treasureDatas[pos].transform:SetAsFirstSibling()
this.treasureDatas[pos]:OnOpen(false, {curEquipData.id,0}, 0.8, false, false, false, 0)
end
local frameBtn = Util.GetGameObject(pos, "mask")
Util.AddOnceClick(frameBtn, function() Util.AddOnceClick(frameBtn, function()
if curEquipData then if curEquipData then
if Game.GlobalEvent:HasEvent(GameEvent.UI.OnClose, triggerCallBack) then UIManager.OpenPanel(UIName.RoleEquipChangePopup, this, 2, curHeroData, curHeroEquipDatas[i],0,nil,0)
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
end
this:SetEquipSelectImage(frameBtn.transform, true)--设置选中图片
--打开装备信息弹窗,传递生成位置,设置层级
--local panel = UIManager.OpenPanel(UIName.EquipInfoPopup,curEquipData,this.content.anchoredPosition.y)
local panel = UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup, curEquipData,function() end,false,false)
triggerCallBack = function(panelType, p)
if panelType == UIName.RewardEquipSingleShowPopup and panel == p then
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
this:SetEquipSelectImage(frameBtn.transform, false)
end
end
Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, triggerCallBack)
end end
end) end)
end end
--宝器 --宝器
for m = 1, 2 do for m = 1, 2 do
Util.GetGameObject(this.babyGrid,"Pre"..m.."/Frame").gameObject:SetActive(false)
Util.GetGameObject(this.babyGrid,"Pre"..m.."/Text"):GetComponent("RectTransform").sizeDelta = GetCurLanguage() == 0 and Vector2.New(48, 95) or Vector2.New(95, 95) Util.GetGameObject(this.babyGrid,"Pre"..m.."/Text"):GetComponent("RectTransform").sizeDelta = GetCurLanguage() == 0 and Vector2.New(48, 95) or Vector2.New(95, 95)
end end
local b = #curHeroData.jewels>0 local b = #curHeroData.jewels>0
@ -372,42 +363,31 @@ function this.EquipInfo()
local v3 = b and Vector2.New(-145,75) or Vector2.New(0,75) local v3 = b and Vector2.New(-145,75) or Vector2.New(0,75)
this.equipTitle.transform:DOAnchorPos(v3,0) this.equipTitle.transform:DOAnchorPos(v3,0)
for n = 1, #curHeroData.jewels do for n = 1, #curHeroData.jewels do
local did=curHeroData.jewels[n] local did=curHeroData.jewels[n]
local data=EquipTreasureManager.GetSingleTreasureByIdDyn(did) or ExpeditionManager.GetSingleTreasureByIdDyn(did) or GoodFriendManager.GetSingleTreasureByIdDyn(did) local data = EquipTreasureManager.GetSingleTreasureByIdDyn(did)
if not data then if not data then
return data = MonsterCampManager.GetSingleTreasureByIdDyn(did)
end end
--是魂宝1 还是灵宝2 if not data then
local pos= jewelConfig[data.id].Location data = ExpeditionManager.GetSingleTreasureByIdDyn(did)
local o=Util.GetGameObject(this.babyGrid,"Pre"..pos)
LogRed("!!!")
local btn=Util.GetGameObject(o,"Frame")
btn.gameObject:SetActive(true)
local frame=Util.GetGameObject(o,"Frame"):GetComponent("Image")
local icon=Util.GetGameObject(o,"Frame/Icon"):GetComponent("Image")
local proIcon=Util.GetGameObject(o,"Frame/proIcon"):GetComponent("Image")
local refineObj = Util.GetGameObject(o,"Frame/refine")
local lvObj = Util.GetGameObject(o,"Frame/lv")
frame.sprite=this.spLoader:LoadSprite(data.frame)
icon.sprite=this.spLoader:LoadSprite(data.icon)
proIcon.sprite = this.spLoader:LoadSprite(data.proIcon)
if data.refineLv > 0 then
refineObj:GetComponent("Text").text = "+" .. data.refineLv
refineObj:SetActive(true)
else
refineObj:SetActive(false)
end end
if not data then
if data.lv > 0 then GoodFriendManager.GetSingleTreasureByIdDyn(did)
lvObj:GetComponent("Text").text = data.lv
lvObj:SetActive(true)
else
lvObj:SetActive(false)
end end
local pos = Util.GetGameObject(this.babyGrid,"Pre"..n.."/pos")
local btn = Util.GetGameObject(pos,"mask")
if not this.treasureDatas[pos] then
this.treasureDatas[pos] = SubUIManager.Open(SubUIConfig.ItemView,pos.transform)
end
this.treasureDatas[pos].gameObject:SetActive(true)
this.treasureDatas[pos].transform:SetAsFirstSibling()
this.treasureDatas[pos]:OnOpen(false, {data.id,0}, 0.8, false, false, false, 0,did)
Util.AddOnceClick(btn,function() Util.AddOnceClick(btn,function()
UIManager.OpenPanel(UIName.RewardTalismanSingleShowPopup,0, data.idDyn,data.id, data.lv, data.refineLv) if did and data then
UIManager.OpenPanel(UIName.RoleEquipTreasureChangePopup,this,2,curHeroData,data,nil,pos,0)
end
end) end)
end end
end end

View File

@ -16,6 +16,7 @@ local equipSuiteConfig = ConfigManager.GetConfig(ConfigName.EquipSuiteConfig)
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig) local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local _MainProList = {} local _MainProList = {}
local _NextProList = {} local _NextProList = {}
local change
--初始化组件(用于子类重写) --初始化组件(用于子类重写)
function RoleEquipChangePopup:InitComponent() function RoleEquipChangePopup:InitComponent()
this.spLoader = SpriteLoader.New() this.spLoader = SpriteLoader.New()
@ -58,6 +59,7 @@ function RoleEquipChangePopup:InitComponent()
this.equipPanel[i].curCastInfo=Util.GetGameObject( this.equipPanel[i].castInfoObject,"castInfo"):GetComponent("Text") this.equipPanel[i].curCastInfo=Util.GetGameObject( this.equipPanel[i].castInfoObject,"castInfo"):GetComponent("Text")
this.equipPanel[i].castInfoObject:SetActive(false) this.equipPanel[i].castInfoObject:SetActive(false)
this.equipPanel[i].btns = Util.GetGameObject(this.equipPanel[i].bg,"btns")
this.equipPanel[i].curEquipBtnRefresh=Util.GetGameObject(this.equipPanel[i].bg,"btns/btnRefresh") this.equipPanel[i].curEquipBtnRefresh=Util.GetGameObject(this.equipPanel[i].bg,"btns/btnRefresh")
this.equipPanel[i].curEquipBtnRefresh.gameObject:SetActive(false) this.equipPanel[i].curEquipBtnRefresh.gameObject:SetActive(false)
this.equipPanel[i].curEquipBtnDown=Util.GetGameObject(this.equipPanel[i].bg,"btns/btnChange") this.equipPanel[i].curEquipBtnDown=Util.GetGameObject(this.equipPanel[i].bg,"btns/btnChange")
@ -123,6 +125,7 @@ function RoleEquipChangePopup:OnOpen(...)
local data={...} local data={...}
openThisPanel=data[1] openThisPanel=data[1]
type=data[2]--1 穿戴 2 卸下 3 替换 type=data[2]--1 穿戴 2 卸下 3 替换
if type==1 or type==2 then if type==1 or type==2 then
curHeroData=data[3] curHeroData=data[3]
curEquipData=data[4] curEquipData=data[4]
@ -138,6 +141,7 @@ function RoleEquipChangePopup:OnOpen(...)
nextEquipData=data[5] nextEquipData=data[5]
position=data[6] position=data[6]
end end
change = data[7]
end end
function RoleEquipChangePopup:OnShow() function RoleEquipChangePopup:OnShow()
@ -181,6 +185,15 @@ function RoleEquipChangePopup:OnShow()
this.equipPanel[1].curEquipBtnDown:SetActive(false) this.equipPanel[1].curEquipBtnDown:SetActive(false)
this.ShowCurEquipData(4) this.ShowCurEquipData(4)
end end
if change and change == 0 then
for k,v in ipairs(this.equipPanel) do
v .btns.gameObject:SetActive(false)
end
else
for k,v in ipairs(this.equipPanel) do
v .btns.gameObject:SetActive(true)
end
end
for i = 1,#this.equipPanel do for i = 1,#this.equipPanel do
ForceRebuildLayout(this.equipPanel[i].bg.transform) ForceRebuildLayout(this.equipPanel[i].bg.transform)
end end

View File

@ -223,19 +223,19 @@ function RoleEquipPanel:BindEvent()
end end
) )
Util.AddClick( -- Util.AddClick(
this.equipBtn5, -- this.equipBtn5,
function() -- function()
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,9999,nil) -- UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,9999,nil)
end -- end
) -- )
Util.AddClick( -- Util.AddClick(
this.equipBtn6, -- this.equipBtn6,
function() -- function()
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,9998,nil) -- UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,9998,nil)
end -- end
) -- )
end end
--添加事件监听(用于子类重写) --添加事件监听(用于子类重写)

View File

@ -13,7 +13,7 @@ local equipIdList
local equipDataList local equipDataList
local position local position
local isGongMing = false local isGongMing = false
local isShowBtn
--初始化组件(用于子类重写) --初始化组件(用于子类重写)
function RoleEquipTreasureChangePopup:InitComponent() function RoleEquipTreasureChangePopup:InitComponent()
@ -188,13 +188,14 @@ end
--界面打开时调用(用于子类重写) --界面打开时调用(用于子类重写)
function RoleEquipTreasureChangePopup:OnOpen(_openThisPanel,_type,_curHeroData,_curEquipData,_nextEquipData,_position) function RoleEquipTreasureChangePopup:OnOpen(_openThisPanel,_type,_curHeroData,_curEquipData,_nextEquipData,_position,isShowBtn)
openThisPanel = _openThisPanel openThisPanel = _openThisPanel
type = _type--1 穿戴 2 卸下 3 替换 4显示信息 type = _type--1 穿戴 2 卸下 3 替换 4显示信息
curHeroData = _curHeroData curHeroData = _curHeroData
equipData[1] = _curEquipData--lv equipData[1] = _curEquipData--lv
equipData[2] = _nextEquipData--refinelv equipData[2] = _nextEquipData--refinelv
position = _position--treelv position = _position--treelv
isShowBtn = isShowBtn
end end
function RoleEquipTreasureChangePopup:OnShow() function RoleEquipTreasureChangePopup:OnShow()
Log("openType:"..tostring(type)) Log("openType:"..tostring(type))
@ -240,6 +241,12 @@ function RoleEquipTreasureChangePopup:OnShow()
isGongMing = HarmonyManager.IsInfo(equipData[1].upHeroDid) isGongMing = HarmonyManager.IsInfo(equipData[1].upHeroDid)
Util.SetGray(this.treasurePanel[1].EquipBtnStrong, isGongMing) Util.SetGray(this.treasurePanel[1].EquipBtnStrong, isGongMing)
end end
if isShowBtn and isShowBtn == 0 then
for k,v in ipairs(this.treasurePanel) do
v.EquipBtns.gameObject:SetActive(false)
end
end
end end
function this.resetData() function this.resetData()

View File

@ -90,6 +90,15 @@ function FourElementSingleWave:OnOpen()
PrivilegeManager.RefreshPrivilegeUsedTimes(self.trailData.freeTimeId, 1) PrivilegeManager.RefreshPrivilegeUsedTimes(self.trailData.freeTimeId, 1)
Game.GlobalEvent:DispatchEvent(GameEvent.FourEle.UpdatePri) Game.GlobalEvent:DispatchEvent(GameEvent.FourEle.UpdatePri)
self:UpdatePrivilage() self:UpdatePrivilage()
if self.trailData.fourElementType == 1 then
CheckRedPointStatus(RedPointType.PersonTrail)
elseif self.trailData.fourElementType == 2 then
CheckRedPointStatus(RedPointType.BuddishTrail)
elseif self.trailData.fourElementType == 3 then
CheckRedPointStatus(RedPointType.DemonTrail)
elseif self.trailData.fourElementType == 4 then
CheckRedPointStatus(RedPointType.TaoistTrail)
end
end,self.trailData.fourElementType) end,self.trailData.fourElementType)
end end
if self.data.wave == self.trailData.monsterWave then if self.data.wave == self.trailData.monsterWave then

View File

@ -579,6 +579,15 @@ function ItemView:NoGetRewardShow(_reward, effectLayer, isShowAddImage)
self.resetLv.gameObject:SetActive(false) self.resetLv.gameObject:SetActive(false)
else else
local data = EquipTreasureManager.GetSingleTreasureByIdDyn(self.Did) local data = EquipTreasureManager.GetSingleTreasureByIdDyn(self.Did)
if not data then
data = MonsterCampManager.GetSingleTreasureByIdDyn(self.Did)
end
if not data then
data = ExpeditionManager.GetSingleTreasureByIdDyn(self.Did)
end
if not data then
GoodFriendManager.GetSingleTreasureByIdDyn(self.Did)
end
if not data then if not data then
self.rightUplv.gameObject:SetActive(false) self.rightUplv.gameObject:SetActive(false)
self.middleDownLv.gameObject:SetActive(false) self.middleDownLv.gameObject:SetActive(false)
@ -596,9 +605,9 @@ function ItemView:NoGetRewardShow(_reward, effectLayer, isShowAddImage)
else else
self.resetLv.gameObject:SetActive(false) self.resetLv.gameObject:SetActive(false)
end end
if data.TreeLv then if data.treeLv > 0 then
self.middleDownLv.gameObject:SetActive(true) self.middleDownLv.gameObject:SetActive(true)
self.middleDownLvText.text =string.format("<color=#F7AA43>+%s</color>", data.TreeLv) self.middleDownLvText.text =string.format("<color=#F7AA43>+%s</color>", data.treeLv)
else else
self.middleDownLv.gameObject:SetActive(false) self.middleDownLv.gameObject:SetActive(false)
end end