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

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
return false
end
local curEquipData = EquipTreasureManager.GetSingleEquipTreasreData(Did)
local curEquipData = EquipTreasureManager.GetSingleEquipTreasreData(Did) or MonsterCampManager.GetSingleTreasureByIdDyn(Did)
local isMax,isMatEnough,items
local indexType = curEquipData.equipType == 1 and HarmonyAddType.HunSoulPrint or HarmonyAddType.LingSoulPrint
if index == 1 then

View File

@ -151,6 +151,7 @@ function RoleInfoPopup:OnOpen(...)
this.selsectSkillImage:SetActive(false)
local arg = { ... }
curHeroData = arg[1]
LogGreen("curHeroData:"..curHeroData.dynamicId)
this.isOther = arg[2]
choosedList = arg[3] or nil
formationHeroNum = arg[4] or nil
@ -172,6 +173,10 @@ end
--界面销毁时调用(用于子类重写)
function RoleInfoPopup:OnDestroy()
for k,v in pairs(this.treasureDatas) do
SubUIManager.Close(v)
end
this.treasureDatas = {}
this.spLoader:Destroy()
soulPrintPreList={}
this.pinjieList={}
@ -311,103 +316,78 @@ function this.RoleInfo1()
end
--装备
function this.EquipInfo()
if not this.treasureDatas then
this.treasureDatas = {}
end
for k,v in pairs(this.treasureDatas) do
v.gameObject:SetActive(false)
end
local curHeroEquipDatas = {}
LogBlue("curHeroData.equipIdList:"..#curHeroData.equipIdList)
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
local equipData = GoodFriendManager.GetSingleEquipData(curHeroData.equipIdList[i]) or EquipManager.GetSingleEquipData(curHeroData.equipIdList[i])
if equipData ~= nil then
curHeroEquipDatas[equipData.equipConfig.Position] = equipData
end
end
--this.equipGrid:GetComponent("Canvas").sortingOrder = this.sortingOrder + 1
for i = 1, this.equipGrid.transform.childCount do
local go = this.equipGrid.transform:GetChild(i - 1).gameObject
local pos = Util.GetGameObject(go.transform, "pos")
local curEquipData
--Util.GetGameObject(go.transform,"Frame"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetQuantityImageByquality(2))
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]
else
Util.GetGameObject(go.transform, "Frame"):SetActive(false)
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, {curEquipData.id,0}, 0.8, false, false, false, 0)
end
local frameBtn = Util.GetGameObject(go.transform, "Frame")
local frameBtn = Util.GetGameObject(pos, "mask")
Util.AddOnceClick(frameBtn, function()
if curEquipData then
if Game.GlobalEvent:HasEvent(GameEvent.UI.OnClose, triggerCallBack) then
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)
UIManager.OpenPanel(UIName.RoleEquipChangePopup, this, 2, curHeroData, curHeroEquipDatas[i],0,nil,0)
end
end)
end
--宝器
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)
end
local b=#curHeroData.jewels>0
local b = #curHeroData.jewels>0
this.babyTitle.gameObject:SetActive(b)
this.babyGrid.gameObject:SetActive(b)
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)
for n = 1, #curHeroData.jewels do
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
return
data = MonsterCampManager.GetSingleTreasureByIdDyn(did)
end
--是魂宝1 还是灵宝2
local pos= jewelConfig[data.id].Location
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)
if not data then
data = ExpeditionManager.GetSingleTreasureByIdDyn(did)
end
if data.lv > 0 then
lvObj:GetComponent("Text").text = data.lv
lvObj:SetActive(true)
else
lvObj:SetActive(false)
if not data then
GoodFriendManager.GetSingleTreasureByIdDyn(did)
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()
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

View File

@ -16,6 +16,7 @@ local equipSuiteConfig = ConfigManager.GetConfig(ConfigName.EquipSuiteConfig)
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local _MainProList = {}
local _NextProList = {}
local change
--初始化组件(用于子类重写)
function RoleEquipChangePopup:InitComponent()
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].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.gameObject:SetActive(false)
this.equipPanel[i].curEquipBtnDown=Util.GetGameObject(this.equipPanel[i].bg,"btns/btnChange")
@ -123,6 +125,7 @@ function RoleEquipChangePopup:OnOpen(...)
local data={...}
openThisPanel=data[1]
type=data[2]--1 穿戴 2 卸下 3 替换
if type==1 or type==2 then
curHeroData=data[3]
curEquipData=data[4]
@ -138,6 +141,7 @@ function RoleEquipChangePopup:OnOpen(...)
nextEquipData=data[5]
position=data[6]
end
change = data[7]
end
function RoleEquipChangePopup:OnShow()
@ -181,6 +185,15 @@ function RoleEquipChangePopup:OnShow()
this.equipPanel[1].curEquipBtnDown:SetActive(false)
this.ShowCurEquipData(4)
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
ForceRebuildLayout(this.equipPanel[i].bg.transform)
end

View File

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

View File

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

View File

@ -89,7 +89,16 @@ function FourElementSingleWave:OnOpen()
MonsterCampManager.ExecuteFightBattle(self.data.wave,1,function()
PrivilegeManager.RefreshPrivilegeUsedTimes(self.trailData.freeTimeId, 1)
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
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)
else
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
self.rightUplv.gameObject:SetActive(false)
self.middleDownLv.gameObject:SetActive(false)
@ -596,9 +605,9 @@ function ItemView:NoGetRewardShow(_reward, effectLayer, isShowAddImage)
else
self.resetLv.gameObject:SetActive(false)
end
if data.TreeLv then
if data.treeLv > 0 then
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
self.middleDownLv.gameObject:SetActive(false)
end