【七界试炼】提交

dev_chengFeng
ZhangBiao 2021-09-17 16:29:21 +08:00
parent 2925de34e8
commit 163950a4a1
3 changed files with 72 additions and 59 deletions

View File

@ -14,12 +14,24 @@ function this.InitConfigData()
if configInfo.Id then if configInfo.Id then
local data = {} local data = {}
data.Id = configInfo.Id data.Id = configInfo.Id
data.Level = configInfo.Level if configInfo.Level then
data.Integral = configInfo.Integral data.Level = configInfo.Level
data.Reward = configInfo.Reward end
data.TreasureReward = configInfo.TreasureReward if configInfo.Integral then
data.Integral = configInfo.Integral
end
if configInfo.Reward then
data.Reward = configInfo.Reward
end
if configInfo.TreasureReward then
data.TreasureReward = configInfo.TreasureReward
end
if configInfo.Level then
data.Level = configInfo.Level
end
data.State = -1 data.State = -1
data.Progress = -1 data.Progress = -1
data.oData = {}
v.dataList[data.Id] = data v.dataList[data.Id] = data
end end
end end
@ -34,26 +46,39 @@ function this.GetTreasureData(ActType)
local curTypeData = this.TreasureList[ActType] local curTypeData = this.TreasureList[ActType]
curTypeData.ActId = actInfo.activityId curTypeData.ActId = actInfo.activityId
curTypeData.endTime = actInfo.endTime curTypeData.endTime = actInfo.endTime
curTypeData.treasureState = actInfo.value curTypeData.value = actInfo.value
-- curTypeData.treasureState = actInfo.treasureState curTypeData.treasureState = 0
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
for k,v in pairs(actInfo.mission) do for k,v in pairs(actInfo.mission) do
if v.state == 0 then if v.missionId == -1 then
if curTypeData.dataList[v.missionId].Integral <= v.progress then curTypeData.treasureState = v.state
curTypeData.dataList[v.missionId].State = 2--未领取 break
else end
curTypeData.dataList[v.missionId].State = 4--未达成 end
end
elseif v.state == 1 then if ActType == 0 then
if actInfo.value == 0 then -- body
curTypeData.dataList[v.missionId].State = 1--不完美领取但不能领 else--一般秘宝按钮状态
else --4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
curTypeData.dataList[v.missionId].State = 3--不完美领取可继续领 for k,v in pairs(actInfo.mission) do
end if v.missionId and v.missionId > 0 then
elseif v.state == -1 then if v.state == 0 then
curTypeData.dataList[v.missionId].State = -1--完美领取 if curTypeData.dataList[v.missionId].Integral[1][2] <= curTypeData.value then
curTypeData.dataList[v.missionId].State = 2--未领取
else
curTypeData.dataList[v.missionId].State = 4--未达成
end
elseif v.state == 1 then
if curTypeData.treasureState == 0 then
curTypeData.dataList[v.missionId].State = 1--不完美领取但不能领
else
curTypeData.dataList[v.missionId].State = 3--不完美领取可继续领
end
elseif v.state == -1 then
curTypeData.dataList[v.missionId].State = -1--完美领取
end
curTypeData.dataList[v.missionId].Progress = v.progress
end
end end
curTypeData.dataList[v.missionId].Progress = v.progress
end end
return curTypeData return curTypeData
end end

View File

@ -60,13 +60,14 @@ end
-- 打开,重新打开时回调 -- 打开,重新打开时回调
function GeneralTreasurePanel:OnShow() function GeneralTreasurePanel:OnShow()
--暂时注释 --暂时注释
-- self.treasureData = GeneralTreasureMangaer.GetTreasureData(self.curType) self.treasureData = GeneralTreasureMangaer.GetTreasureData(self.curType)
-- self:ShowTime() self:ShowTime()
-- self:topBar() self:topBar()
-- self:showTaskList(true,true) self:showTaskList(true,true)
end end
function GeneralTreasurePanel:refresh(isTop,isAni) function GeneralTreasurePanel:refresh(isTop,isAni)
self.treasureData = GeneralTreasureMangaer.GetTreasureData(self.curType)
self:topBar() self:topBar()
self:showTaskList(isTop,isAni) self:showTaskList(isTop,isAni)
end end
@ -77,15 +78,13 @@ function GeneralTreasurePanel:topBar()
self.buyBtn:GetComponent("Button").interactable = self.treasureData.treasureState == 0 self.buyBtn:GetComponent("Button").interactable = self.treasureData.treasureState == 0
self.Text1.text = self.treasureData.treasureState == 0 and "激活秘宝" or "已激活" self.Text1.text = self.treasureData.treasureState == 0 and "激活秘宝" or "已激活"
Util.AddOnceClick(self.buyBtn,function() Util.AddOnceClick(self.buyBtn,function()
-- UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,3)
PopupTipPanel.ShowTip("天宫秘宝") PopupTipPanel.ShowTip("天宫秘宝")
end) end)
end end
--任务列表 --任务列表
function GeneralTreasurePanel:showTaskList(isTop,isAni) function GeneralTreasurePanel:showTaskList(isTop,isAni)
-- itemnum = BagManager.GetItemCountById(EndLessMapManager.scoreValueId) or 0 self.scoreText.text = self.treasureData.value
self.scoreText.text = self.treasureData.dataList[1].Progress
if not self.itemsList then if not self.itemsList then
self.itemsList = {} self.itemsList = {}
end end
@ -98,9 +97,9 @@ function GeneralTreasurePanel:showTaskList(isTop,isAni)
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的) --4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
--定位打开界面时位置 --定位打开界面时位置
local t = 0 local t = 0
local state = self.treasureData.treasureState == 0 and 1 or -1 local State = self.treasureData.treasureState == 0 and 1 or -1
for i = 1, #self.treasureData.dataList do for i = 1, #self.treasureData.dataList do
if self.treasureData.dataList[i].State == state then if self.treasureData.dataList[i].State == State then
t = i t = i
break break
end end
@ -127,7 +126,7 @@ function GeneralTreasurePanel:SingleTask(rewardItem, singleData)
self.itemsList[rewardItem][i].transform.localScale = Vector3.one self.itemsList[rewardItem][i].transform.localScale = Vector3.one
self.itemsList[rewardItem][i].transform.localPosition = Vector3.zero self.itemsList[rewardItem][i].transform.localPosition = Vector3.zero
self.itemsList[rewardItem][i].gameObject:SetActive(true) self.itemsList[rewardItem][i].gameObject:SetActive(true)
self.itemsList[rewardItem][i]:OnOpen(false, {singleData.Reward[i].id, singleData.Reward[i].num}, 0.8, false) self.itemsList[rewardItem][i]:OnOpen(false, {singleData.Reward[i][1], singleData.Reward[i][2]}, 0.8, false)
end end
if not self.itemsList2[rewardItem] then if not self.itemsList2[rewardItem] then
@ -144,7 +143,7 @@ function GeneralTreasurePanel:SingleTask(rewardItem, singleData)
self.itemsList2[rewardItem][i].transform.localScale = Vector3.one self.itemsList2[rewardItem][i].transform.localScale = Vector3.one
self.itemsList2[rewardItem][i].transform.localPosition = Vector3.zero self.itemsList2[rewardItem][i].transform.localPosition = Vector3.zero
self.itemsList2[rewardItem][i].gameObject:SetActive(true) self.itemsList2[rewardItem][i].gameObject:SetActive(true)
self.itemsList2[rewardItem][i]:OnOpen(false, {singleData.TreasureReward[i].id, singleData.TreasureReward[i].num}, 0.8, false) self.itemsList2[rewardItem][i]:OnOpen(false, {singleData.TreasureReward[i][1], singleData.TreasureReward[i][2]}, 0.8, false)
end end
scoreLevel.text = singleData.Level scoreLevel.text = singleData.Level
@ -160,38 +159,38 @@ function GeneralTreasurePanel:InitButtonState(rewardItem, singleData)
local finished = Util.GetGameObject(rewardItem, "finished") local finished = Util.GetGameObject(rewardItem, "finished")
local redPoint = Util.GetGameObject(rewardItem, "btnDeal/redPoint") local redPoint = Util.GetGameObject(rewardItem, "btnDeal/redPoint")
--当前任务领取情况 --当前任务领取情况
local state = singleData.state local State = singleData.State
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的) --4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
--判断 --判断
if state == 4 then if State == 4 then
btnDeal.gameObject:SetActive(true) btnDeal.gameObject:SetActive(true)
get.gameObject:SetActive(false) get.gameObject:SetActive(false)
getAgain.gameObject:SetActive(false) getAgain.gameObject:SetActive(false)
unfinished.gameObject:SetActive(true) unfinished.gameObject:SetActive(true)
finished.gameObject:SetActive(false) finished.gameObject:SetActive(false)
redPoint:SetActive(false) redPoint:SetActive(false)
elseif state == 3 then elseif State == 3 then
btnDeal.gameObject:SetActive(true) btnDeal.gameObject:SetActive(true)
get.gameObject:SetActive(false) get.gameObject:SetActive(false)
getAgain.gameObject:SetActive(true) getAgain.gameObject:SetActive(true)
unfinished.gameObject:SetActive(false) unfinished.gameObject:SetActive(false)
finished.gameObject:SetActive(false) finished.gameObject:SetActive(false)
redPoint:SetActive(true) redPoint:SetActive(true)
elseif state == 2 then elseif State == 2 then
btnDeal.gameObject:SetActive(true) btnDeal.gameObject:SetActive(true)
get.gameObject:SetActive(true) get.gameObject:SetActive(true)
getAgain.gameObject:SetActive(false) getAgain.gameObject:SetActive(false)
unfinished.gameObject:SetActive(false) unfinished.gameObject:SetActive(false)
finished.gameObject:SetActive(false) finished.gameObject:SetActive(false)
redPoint:SetActive(true) redPoint:SetActive(true)
elseif state == 1 then elseif State == 1 then
btnDeal.gameObject:SetActive(true) btnDeal.gameObject:SetActive(true)
get.gameObject:SetActive(false) get.gameObject:SetActive(false)
getAgain.gameObject:SetActive(true) getAgain.gameObject:SetActive(true)
unfinished.gameObject:SetActive(false) unfinished.gameObject:SetActive(false)
finished.gameObject:SetActive(false) finished.gameObject:SetActive(false)
redPoint:SetActive(false) redPoint:SetActive(false)
elseif state == -1 then elseif State == -1 then
btnDeal.gameObject:SetActive(false) btnDeal.gameObject:SetActive(false)
get.gameObject:SetActive(false) get.gameObject:SetActive(false)
getAgain.gameObject:SetActive(false) getAgain.gameObject:SetActive(false)
@ -203,9 +202,6 @@ function GeneralTreasurePanel:InitButtonState(rewardItem, singleData)
Util.AddOnceClick(btnDeal,function() Util.AddOnceClick(btnDeal,function()
self:OnBtnDealClicked(rewardItem,singleData) self:OnBtnDealClicked(rewardItem,singleData)
end) end)
--红点状态
--redPoint:SetActive(TreasureOfHeavenManger.RedPointState(singleData,self.treasureData.treasureState))
end end
@ -217,24 +213,15 @@ function GeneralTreasurePanel:OnBtnDealClicked(rewardItem,singleData)
local getAgain = Util.GetGameObject(rewardItem, "btnDeal/getAgain") local getAgain = Util.GetGameObject(rewardItem, "btnDeal/getAgain")
local unfinished = Util.GetGameObject(rewardItem, "btnDeal/unfinished") local unfinished = Util.GetGameObject(rewardItem, "btnDeal/unfinished")
local finished = Util.GetGameObject(rewardItem, "btnDeal/finished") local finished = Util.GetGameObject(rewardItem, "btnDeal/finished")
if singleData.state == 4 then if singleData.State == 4 then
PopupTipPanel.ShowTip(Language[11330]) PopupTipPanel.ShowTip(Language[11330])
elseif singleData.state == 3 or singleData.state == 2 then elseif singleData.State == 3 or singleData.State == 2 then
NetManager.EndlessTakeTreasureRequest(singleData.Id,function(msg) NetManager.GetActivityRewardRequest(singleData.Id,self.treasureData.ActId,function (drop)
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function() self:refresh(false,false)
--需要刷新界面
if self.treasureData.treasureState == 0 then--判断是否已经购买了礼包
EndLessMapManager.SetTreasureState(singleData.Id,1)
else
EndLessMapManager.SetTreasureState(singleData.Id,-1)
end
-- CheckRedPointStatus(RedPointType.wujinTreasure)
-- CheckRedPointStatus(RedPointType.EndlessPanel)
self:refresh()--刷新界面
end) end)
end) end)
elseif singleData.state == 1 then elseif singleData.State == 1 then
-- UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,3) -- UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,3)
end end
end end
@ -247,7 +234,7 @@ function GeneralTreasurePanel:ShowTime()
self.time.text = "重置时间:"..TimeToDHMS(self.treasureData.endTime - GetTimeStamp()) self.time.text = "重置时间:"..TimeToDHMS(self.treasureData.endTime - GetTimeStamp())
local time = self.treasureData.endTime - GetTimeStamp() local time = self.treasureData.endTime - GetTimeStamp()
if time <= 0 then if time <= 0 then
return return
end end
self.localTimer = Timer.New(function() self.localTimer = Timer.New(function()
time = time - 1 time = time - 1

View File

@ -123,6 +123,7 @@ function this.ShowBattleResultByQiJie()
UIManager.OpenPanel(UIName.BattleBestPopup, bestData.roleId,bestData.skinId, bestData.damage, allDamage, function(_BattleBestPopup) UIManager.OpenPanel(UIName.BattleBestPopup, bestData.roleId,bestData.skinId, bestData.damage, allDamage, function(_BattleBestPopup)
-- 打开关卡奖励界面 -- 打开关卡奖励界面
UIManager.OpenPanel(UIName.RewardItemPopup, QiJieShiLianManager.battleResult.drop, 1,function(isBackBattle) UIManager.OpenPanel(UIName.RewardItemPopup, QiJieShiLianManager.battleResult.drop, 1,function(isBackBattle)
PrivilegeManager.RefreshPrivilegeUsedTimes(3201, 1)--更新特权
if not isBackBattle then if not isBackBattle then
if _BattleBestPopup then if _BattleBestPopup then
_BattleBestPopup:ClosePanel() _BattleBestPopup:ClosePanel()