【七界试炼】提交
parent
2925de34e8
commit
163950a4a1
|
@ -14,12 +14,24 @@ function this.InitConfigData()
|
|||
if configInfo.Id then
|
||||
local data = {}
|
||||
data.Id = configInfo.Id
|
||||
data.Level = configInfo.Level
|
||||
data.Integral = configInfo.Integral
|
||||
data.Reward = configInfo.Reward
|
||||
data.TreasureReward = configInfo.TreasureReward
|
||||
if configInfo.Level then
|
||||
data.Level = configInfo.Level
|
||||
end
|
||||
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.Progress = -1
|
||||
data.oData = {}
|
||||
v.dataList[data.Id] = data
|
||||
end
|
||||
end
|
||||
|
@ -34,26 +46,39 @@ function this.GetTreasureData(ActType)
|
|||
local curTypeData = this.TreasureList[ActType]
|
||||
curTypeData.ActId = actInfo.activityId
|
||||
curTypeData.endTime = actInfo.endTime
|
||||
curTypeData.treasureState = actInfo.value
|
||||
-- curTypeData.treasureState = actInfo.treasureState
|
||||
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
|
||||
curTypeData.value = actInfo.value
|
||||
curTypeData.treasureState = 0
|
||||
for k,v in pairs(actInfo.mission) do
|
||||
if v.state == 0 then
|
||||
if curTypeData.dataList[v.missionId].Integral <= v.progress then
|
||||
curTypeData.dataList[v.missionId].State = 2--未领取
|
||||
else
|
||||
curTypeData.dataList[v.missionId].State = 4--未达成
|
||||
end
|
||||
elseif v.state == 1 then
|
||||
if actInfo.value == 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--完美领取
|
||||
if v.missionId == -1 then
|
||||
curTypeData.treasureState = v.state
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if ActType == 0 then
|
||||
-- body
|
||||
else--一般秘宝按钮状态
|
||||
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
|
||||
for k,v in pairs(actInfo.mission) do
|
||||
if v.missionId and v.missionId > 0 then
|
||||
if v.state == 0 then
|
||||
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
|
||||
curTypeData.dataList[v.missionId].Progress = v.progress
|
||||
end
|
||||
return curTypeData
|
||||
end
|
||||
|
|
|
@ -60,13 +60,14 @@ end
|
|||
-- 打开,重新打开时回调
|
||||
function GeneralTreasurePanel:OnShow()
|
||||
--暂时注释
|
||||
-- self.treasureData = GeneralTreasureMangaer.GetTreasureData(self.curType)
|
||||
-- self:ShowTime()
|
||||
-- self:topBar()
|
||||
-- self:showTaskList(true,true)
|
||||
self.treasureData = GeneralTreasureMangaer.GetTreasureData(self.curType)
|
||||
self:ShowTime()
|
||||
self:topBar()
|
||||
self:showTaskList(true,true)
|
||||
end
|
||||
|
||||
function GeneralTreasurePanel:refresh(isTop,isAni)
|
||||
self.treasureData = GeneralTreasureMangaer.GetTreasureData(self.curType)
|
||||
self:topBar()
|
||||
self:showTaskList(isTop,isAni)
|
||||
end
|
||||
|
@ -77,15 +78,13 @@ function GeneralTreasurePanel:topBar()
|
|||
self.buyBtn:GetComponent("Button").interactable = self.treasureData.treasureState == 0
|
||||
self.Text1.text = self.treasureData.treasureState == 0 and "激活秘宝" or "已激活"
|
||||
Util.AddOnceClick(self.buyBtn,function()
|
||||
-- UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,3)
|
||||
PopupTipPanel.ShowTip("天宫秘宝")
|
||||
end)
|
||||
end
|
||||
|
||||
--任务列表
|
||||
function GeneralTreasurePanel:showTaskList(isTop,isAni)
|
||||
-- itemnum = BagManager.GetItemCountById(EndLessMapManager.scoreValueId) or 0
|
||||
self.scoreText.text = self.treasureData.dataList[1].Progress
|
||||
self.scoreText.text = self.treasureData.value
|
||||
if not self.itemsList then
|
||||
self.itemsList = {}
|
||||
end
|
||||
|
@ -98,9 +97,9 @@ function GeneralTreasurePanel:showTaskList(isTop,isAni)
|
|||
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
|
||||
--定位打开界面时位置
|
||||
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
|
||||
if self.treasureData.dataList[i].State == state then
|
||||
if self.treasureData.dataList[i].State == State then
|
||||
t = i
|
||||
break
|
||||
end
|
||||
|
@ -127,7 +126,7 @@ function GeneralTreasurePanel:SingleTask(rewardItem, singleData)
|
|||
self.itemsList[rewardItem][i].transform.localScale = Vector3.one
|
||||
self.itemsList[rewardItem][i].transform.localPosition = Vector3.zero
|
||||
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
|
||||
|
||||
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.localPosition = Vector3.zero
|
||||
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
|
||||
|
||||
scoreLevel.text = singleData.Level
|
||||
|
@ -160,38 +159,38 @@ function GeneralTreasurePanel:InitButtonState(rewardItem, singleData)
|
|||
local finished = Util.GetGameObject(rewardItem, "finished")
|
||||
local redPoint = Util.GetGameObject(rewardItem, "btnDeal/redPoint")
|
||||
--当前任务领取情况
|
||||
local state = singleData.state
|
||||
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
|
||||
local State = singleData.State
|
||||
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
|
||||
--判断
|
||||
if state == 4 then
|
||||
if State == 4 then
|
||||
btnDeal.gameObject:SetActive(true)
|
||||
get.gameObject:SetActive(false)
|
||||
getAgain.gameObject:SetActive(false)
|
||||
unfinished.gameObject:SetActive(true)
|
||||
finished.gameObject:SetActive(false)
|
||||
redPoint:SetActive(false)
|
||||
elseif state == 3 then
|
||||
elseif State == 3 then
|
||||
btnDeal.gameObject:SetActive(true)
|
||||
get.gameObject:SetActive(false)
|
||||
getAgain.gameObject:SetActive(true)
|
||||
unfinished.gameObject:SetActive(false)
|
||||
finished.gameObject:SetActive(false)
|
||||
redPoint:SetActive(true)
|
||||
elseif state == 2 then
|
||||
elseif State == 2 then
|
||||
btnDeal.gameObject:SetActive(true)
|
||||
get.gameObject:SetActive(true)
|
||||
getAgain.gameObject:SetActive(false)
|
||||
unfinished.gameObject:SetActive(false)
|
||||
finished.gameObject:SetActive(false)
|
||||
redPoint:SetActive(true)
|
||||
elseif state == 1 then
|
||||
elseif State == 1 then
|
||||
btnDeal.gameObject:SetActive(true)
|
||||
get.gameObject:SetActive(false)
|
||||
getAgain.gameObject:SetActive(true)
|
||||
unfinished.gameObject:SetActive(false)
|
||||
finished.gameObject:SetActive(false)
|
||||
redPoint:SetActive(false)
|
||||
elseif state == -1 then
|
||||
elseif State == -1 then
|
||||
btnDeal.gameObject:SetActive(false)
|
||||
get.gameObject:SetActive(false)
|
||||
getAgain.gameObject:SetActive(false)
|
||||
|
@ -203,9 +202,6 @@ function GeneralTreasurePanel:InitButtonState(rewardItem, singleData)
|
|||
Util.AddOnceClick(btnDeal,function()
|
||||
self:OnBtnDealClicked(rewardItem,singleData)
|
||||
end)
|
||||
|
||||
--红点状态
|
||||
--redPoint:SetActive(TreasureOfHeavenManger.RedPointState(singleData,self.treasureData.treasureState))
|
||||
end
|
||||
|
||||
|
||||
|
@ -217,24 +213,15 @@ function GeneralTreasurePanel:OnBtnDealClicked(rewardItem,singleData)
|
|||
local getAgain = Util.GetGameObject(rewardItem, "btnDeal/getAgain")
|
||||
local unfinished = Util.GetGameObject(rewardItem, "btnDeal/unfinished")
|
||||
local finished = Util.GetGameObject(rewardItem, "btnDeal/finished")
|
||||
if singleData.state == 4 then
|
||||
if singleData.State == 4 then
|
||||
PopupTipPanel.ShowTip(Language[11330])
|
||||
elseif singleData.state == 3 or singleData.state == 2 then
|
||||
NetManager.EndlessTakeTreasureRequest(singleData.Id,function(msg)
|
||||
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
||||
--需要刷新界面
|
||||
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()--刷新界面
|
||||
elseif singleData.State == 3 or singleData.State == 2 then
|
||||
NetManager.GetActivityRewardRequest(singleData.Id,self.treasureData.ActId,function (drop)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
|
||||
self:refresh(false,false)
|
||||
end)
|
||||
end)
|
||||
elseif singleData.state == 1 then
|
||||
elseif singleData.State == 1 then
|
||||
-- UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,3)
|
||||
end
|
||||
end
|
||||
|
@ -247,7 +234,7 @@ function GeneralTreasurePanel:ShowTime()
|
|||
self.time.text = "重置时间:"..TimeToDHMS(self.treasureData.endTime - GetTimeStamp())
|
||||
local time = self.treasureData.endTime - GetTimeStamp()
|
||||
if time <= 0 then
|
||||
return
|
||||
return
|
||||
end
|
||||
self.localTimer = Timer.New(function()
|
||||
time = time - 1
|
||||
|
|
|
@ -123,6 +123,7 @@ function this.ShowBattleResultByQiJie()
|
|||
UIManager.OpenPanel(UIName.BattleBestPopup, bestData.roleId,bestData.skinId, bestData.damage, allDamage, function(_BattleBestPopup)
|
||||
-- 打开关卡奖励界面
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup, QiJieShiLianManager.battleResult.drop, 1,function(isBackBattle)
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(3201, 1)--更新特权
|
||||
if not isBackBattle then
|
||||
if _BattleBestPopup then
|
||||
_BattleBestPopup:ClosePanel()
|
||||
|
|
Loading…
Reference in New Issue