diff --git a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_QiJieTreasure.lua b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_QiJieTreasure.lua
index fd5a731ade..d4aa83d578 100644
--- a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_QiJieTreasure.lua
+++ b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_QiJieTreasure.lua
@@ -38,7 +38,11 @@ end
--绑定事件(用于子类重写)
function QiJieTreasure:BindEvent()
Util.AddClick(self.goBtn,function ()
- UIManager.OpenPanel(UIName.GeneralInfoPopup,GENERALINFO_TYPE.QiJieAllTreasure,{1,2,3,4,5,6})
+ if #QiJieShiLianManager.treasureActiveList <= 0 then
+ PopupTipPanel.ShowTip("暂无遗物加成。")
+ return
+ end
+ UIManager.OpenPanel(UIName.GeneralInfoPopup,GENERALINFO_TYPE.QiJieAllTreasure,QiJieShiLianManager.treasureActiveList)
end)
end
diff --git a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View2/GeneralInfoPopup_QiJieGoalAttri.lua b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View2/GeneralInfoPopup_QiJieGoalAttri.lua
index bfc69a00c8..2deb844f3f 100644
--- a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View2/GeneralInfoPopup_QiJieGoalAttri.lua
+++ b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View2/GeneralInfoPopup_QiJieGoalAttri.lua
@@ -53,7 +53,9 @@ end
--界面关闭时调用(用于子类重写)
function this:OnClose()
- parent.contents:GetComponent("RectTransform").localPosition = Vector2(0,0)
+ if parent then
+ parent.contents:GetComponent("RectTransform").localPosition = Vector2(0,0)
+ end
end
--界面销毁时调用(用于子类重写)
diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_QiJieSingleTreasure.lua b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_QiJieSingleTreasure.lua
index 6facc87b5f..30bf7f1c66 100644
--- a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_QiJieSingleTreasure.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_QiJieSingleTreasure.lua
@@ -15,12 +15,16 @@ function QiJieSingleTreasure:InitComponent(gameObject)
self.costIcon = Util.GetGameObject(gameObject,"cost/Icon"):GetComponent("Image")
self.costNum = Util.GetGameObject(gameObject,"cost/Num"):GetComponent("Text")
self.activeBtn = Util.GetGameObject(gameObject,"activeBtn")
- self.activeText = Util.GetGameObject(self.activeBtn,"Text")
+ self.activeText = Util.GetGameObject(self.activeBtn,"Text"):GetComponent("Text")
end
function QiJieSingleTreasure:BindEvent()
Util.AddClick(self.activeBtn,function()
- PopupTipPanel.ShowTip("我知道了")
+ if BagManager.GetTotalItemNum(self.data.Cost[1])>=self.data.Cost[2] then
+ NetManager.SevenWorldRelicRequest(self.data.Id,function ()
+ self:Refresh()
+ end)
+ end
end)
end
@@ -34,14 +38,28 @@ function QiJieSingleTreasure:OnShow(_parent,...)
self.parent =_parent
self.data = ...
self.sortingOrder =_parent.sortingOrder
+ self:Refresh()
+end
+
+function QiJieSingleTreasure:Refresh()
self.title.text = self.data.Name
- self.Img.sprite = self.spLoader:LoadSprite(artResourcesConfig[self.data.Icon].Name)
- self.costIcon.sprite = self.spLoader:LoadSprite(GetSpriteNameByItemId(self.data.Cost[1]))
- local text1 = string.format( "%s/%s",BagManager.GetTotalItemNum(self.data.Cost[1]),self.data.Cost[2])
- if BagManager.GetTotalItemNum(self.data.Cost[1]) < self.data.Cost[2] then
- text1 = string.format( "%s",text1)
+ if self.data.state == 2 then
+ self.Img.sprite = self.spLoader:LoadSprite(artResourcesConfig[self.data.Icon].Name)
+ self.costIcon.sprite = self.spLoader:LoadSprite(GetSpriteNameByItemId(self.data.Cost[1]))
+ local text1 = string.format( "%s/%s",BagManager.GetTotalItemNum(self.data.Cost[1]),self.data.Cost[2])
+ if BagManager.GetTotalItemNum(self.data.Cost[1]) < self.data.Cost[2] then
+ text1 = string.format( "%s",text1)
+ end
+ self.costNum.text = text1
+ self.activeText.text = "解 锁"
+ else
+ self.cost:SetActive(false)
+ if self.data.state == 1 then
+ self.activeText.text = "取消激活"
+ elseif self.data.state == 2 then
+ self.activeText.text = "激 活"
+ end
end
- self.costNum.text = text1
local text2,text3 = QiJieShiLianManager.GetTreasureEffect({self.data.Id})
self.attriText.text = text2.."\n"..tostring(QiJieShiLianManager.GetSring(text3))
ForceRebuildLayout(self.cost.transform)
diff --git a/Assets/ManagedResources/~Lua/Modules/QiJieShiLian/QiJieShiLianManager.lua b/Assets/ManagedResources/~Lua/Modules/QiJieShiLian/QiJieShiLianManager.lua
index fb89b07a51..d61ab882be 100644
--- a/Assets/ManagedResources/~Lua/Modules/QiJieShiLian/QiJieShiLianManager.lua
+++ b/Assets/ManagedResources/~Lua/Modules/QiJieShiLian/QiJieShiLianManager.lua
@@ -18,6 +18,7 @@ function this.Initialize()
this.curProgress = 0
this.treasureList = {}
+ this.treasureActiveList = {}
this.InitTreasureData()
this.battleResult = {}
end
@@ -149,6 +150,7 @@ end
--把服务器发来的遗物数据加到本地数据中
function this.MixTreasureServerAndLocalData(msg)
+ this.treasureActiveList = msg.info
for i = 1, #msg.info do
if this.treasureList[msg.info[i].id] then
this.treasureList[msg.info[i].id].state = msg.info[i].status