【七界试炼】提交
parent
94ed6ad618
commit
b609616b6b
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 74d6a28cf988ef041b36c91b088447d8
|
||||
guid: 5ac4a0de8d37274488a3e4fe347d75a0
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
File diff suppressed because it is too large
Load Diff
|
@ -553,11 +553,8 @@ UpViewRechargeType = {
|
|||
LuoFuJingShi = 1207,--罗浮晶石
|
||||
SuiFanXingCheng = 1007, -- 碎繁星辰
|
||||
yuxulundaoTicket=106, --玉虚论道邀请函
|
||||
<<<<<<< HEAD
|
||||
QiJieCoin = 1240,--七界币
|
||||
=======
|
||||
LunDaoBi=107, --论道币
|
||||
>>>>>>> 0功能/玉虚论道
|
||||
}
|
||||
|
||||
SHOP_PAGE = {
|
||||
|
@ -1270,6 +1267,7 @@ ActivityTypeDef = {
|
|||
JourneyWithWind = 72, --缥缈之旅
|
||||
FifteenDayGiftNotice = 80,--15日登陆预告
|
||||
DynamicActShop = 81,--主题活动商店
|
||||
QiJieTreasure = 83,--七界秘宝
|
||||
}
|
||||
--活动结束需要处理面板关闭类型
|
||||
ActivityTypePanel = {
|
||||
|
|
|
@ -200,10 +200,12 @@ local ManagerNames = {
|
|||
"linglongbaojing/LingLongBaoJingManager",
|
||||
--七界试炼管理器
|
||||
"QiJieShiLian/QiJieShiLianManager",
|
||||
--玉虚论道管理器
|
||||
"WorldArena/WorldArenaManager",
|
||||
--秘宝管理器
|
||||
"GeneralPanel/GeneralTreasureMangaer",
|
||||
--!!!!红点管理(尽量放在最后)!!!!--
|
||||
"Player/RedpotManager",
|
||||
"WorldArena/WorldArenaManager",
|
||||
|
||||
}
|
||||
|
||||
return ManagerNames
|
|
@ -410,6 +410,7 @@ UIName = {
|
|||
WorldArenaUpRewardPanel = 415,--玉虚轮道段位改变界面
|
||||
WorldArenaRecordPopup =416, --玉虚论道防守记录界面
|
||||
WorldArenaBattleInfoPanel=417, --玉虚论道对战信息界面
|
||||
GeneralTreasurePanel=420, --通用秘宝界面
|
||||
}
|
||||
|
||||
SubUIConfig = {
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
GeneralTreasureMangaer = {}
|
||||
local this = GeneralTreasureMangaer
|
||||
|
||||
function this.Initialize()
|
||||
this.TreasureList = {
|
||||
[ActivityTypeDef.QiJieTreasure] = {ActId = 0,endTime = 0,dataList = {},configName = ConfigName.QijieTreasure},
|
||||
}
|
||||
this.InitConfigData()
|
||||
end
|
||||
|
||||
function this.InitConfigData()
|
||||
for k,v in pairs(this.TreasureList) do
|
||||
for _, configInfo in ConfigPairs(ConfigManager.GetConfig(v.configName)) do
|
||||
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
|
||||
data.State = -1
|
||||
data.Progress = -1
|
||||
v.dataList[data.Id] = data
|
||||
end
|
||||
end
|
||||
table.sort(v.dataList,function (a,b)
|
||||
return a.Id < b.Id
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function this.GetTreasureData(ActType)
|
||||
local actInfo = ActivityGiftManager.GetActivityTypeInfo(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 完美领取(充钱领取过的)
|
||||
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--完美领取
|
||||
end
|
||||
curTypeData.dataList[v.missionId].Progress = v.progress
|
||||
end
|
||||
return curTypeData
|
||||
end
|
||||
|
||||
return GeneralTreasureMangaer
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8f8023268b6eef64b87b6c9d94f623f7
|
||||
guid: 708128913634ed74cb4a494c7afd85e9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
|
@ -0,0 +1,285 @@
|
|||
require("Base/BasePanel")
|
||||
local GeneralTreasurePanel = Inherit(BasePanel)
|
||||
local itemnum = 0
|
||||
local LocalData = {
|
||||
[ActivityTypeDef.QiJieTreasure] = {hp = HELP_TYPE.QiJieTreasure},--七界秘宝
|
||||
}
|
||||
--初始化组件(用于子类重写)
|
||||
function GeneralTreasurePanel:InitComponent()
|
||||
--topBar/btnBack
|
||||
self.btnBack = Util.GetGameObject(self.transform, "bg/btnBack")
|
||||
self.buyBtn = Util.GetGameObject(self.transform, "bg/topBar/buyBtn")
|
||||
self.Text1 = Util.GetGameObject(self.buyBtn, "buy"):GetComponent("Text")
|
||||
self.tips = Util.GetGameObject(self.transform, "bg/topBar/tips"):GetComponent("Text")
|
||||
self.time = Util.GetGameObject(self.transform, "bg/topBar/time"):GetComponent("Text")
|
||||
self.quesBtn = Util.GetGameObject(self.transform, "bg/quesBtn")
|
||||
self.helpPosition=self.quesBtn:GetComponent("RectTransform").localPosition
|
||||
--Content
|
||||
self.scoreText = Util.GetGameObject(self.transform, "bg/pageContent/bg/score/number"):GetComponent("Text")
|
||||
self.treasureList = Util.GetGameObject(self.transform, "bg/pageContent/treasureList")
|
||||
self.itemPre = Util.GetGameObject(self.transform, "bg/pageContent/itemPro")
|
||||
self.itemPos = Util.GetGameObject(self.transform, "bg/pageContent/itemPos")
|
||||
|
||||
--设置滚动条
|
||||
self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,self.treasureList.transform,self.itemPre,nil,Vector2.New(950, 1000),1,1,Vector2.New(100, 25))
|
||||
self.ScrollView.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, 0)
|
||||
self.ScrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
||||
self.ScrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
||||
self.ScrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
||||
self.ScrollView.moveTween.MomentumAmount = 1
|
||||
self.ScrollView.moveTween.Strength = 2
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function GeneralTreasurePanel:BindEvent()
|
||||
Util.AddClick(self.btnBack,function()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
Util.AddClick(self.quesBtn,function()
|
||||
UIManager.OpenPanel(UIName.HelpPopup,LocalData[self.curType].hp,self.helpPosition.x,self.helpPosition.y)
|
||||
end)
|
||||
end
|
||||
|
||||
function GeneralTreasurePanel:OnSortingOrderChange()
|
||||
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function GeneralTreasurePanel:AddListener()
|
||||
-- Game.GlobalEvent:AddEvent(GameEvent.EndLess.RechargeQinglongSerectSuccess, self.refresh,self)
|
||||
-- Game.GlobalEvent:AddEvent(GameEvent.EndLess.QinglongSerectRefresh, self.OnShow,self)
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function GeneralTreasurePanel:RemoveListener()
|
||||
-- Game.GlobalEvent:RemoveEvent(GameEvent.EndLess.RechargeQinglongSerectSuccess, self.refresh,self)
|
||||
-- Game.GlobalEvent:AddEvent(GameEvent.EndLess.QinglongSerectRefresh, self.OnShow,self)
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function GeneralTreasurePanel:OnOpen(...)
|
||||
self.curType = ...
|
||||
self.curType = 83
|
||||
end
|
||||
|
||||
-- 打开,重新打开时回调
|
||||
function GeneralTreasurePanel:OnShow()
|
||||
-- self.treasureData = EndLessMapManager.treasureData
|
||||
self.treasureData = GeneralTreasureMangaer.GetTreasureData(self.curType)
|
||||
-- self.tips.text = self.treasureData.tip
|
||||
self:ShowTime()
|
||||
self:topBar()
|
||||
self:showTaskList(true,true)
|
||||
end
|
||||
|
||||
function GeneralTreasurePanel:refresh(isTop,isAni)
|
||||
self:topBar()
|
||||
self:showTaskList(isTop,isAni)
|
||||
end
|
||||
|
||||
--topBar按钮状态
|
||||
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
|
||||
if not self.itemsList then
|
||||
self.itemsList = {}
|
||||
end
|
||||
if not self.itemsList2 then
|
||||
self.itemsList2 = {}
|
||||
end
|
||||
self.ScrollView:SetData(self.treasureData.dataList,function(index, rewardItem)
|
||||
self:SingleTask(rewardItem, self.treasureData.dataList[index])
|
||||
end,not isTop,not isAni)
|
||||
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
|
||||
--定位打开界面时位置
|
||||
local t = 0
|
||||
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
|
||||
t = i
|
||||
break
|
||||
end
|
||||
end
|
||||
self.ScrollView:SetIndex(t)
|
||||
end
|
||||
|
||||
--单个任务
|
||||
function GeneralTreasurePanel:SingleTask(rewardItem, singleData)
|
||||
local scoreLevel = Util.GetGameObject(rewardItem, "scoreLevel"):GetComponent("Text")
|
||||
local scroll1 = Util.GetGameObject(rewardItem, "scroll1")
|
||||
local scroll2 = Util.GetGameObject(rewardItem, "scroll2")
|
||||
if not self.itemsList[rewardItem] then
|
||||
self.itemsList[rewardItem] = {}
|
||||
end
|
||||
for k,v in pairs(self.itemsList[rewardItem]) do
|
||||
v.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1 ,#singleData.Reward do
|
||||
if not self.itemsList[rewardItem][i] then
|
||||
self.itemsList[rewardItem][i] = SubUIManager.Open(SubUIConfig.ItemView,scroll1.transform)
|
||||
end
|
||||
self.itemsList[rewardItem][i].transform:SetParent(scroll1.transform)
|
||||
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)
|
||||
end
|
||||
|
||||
if not self.itemsList2[rewardItem] then
|
||||
self.itemsList2[rewardItem] = {}
|
||||
end
|
||||
for k,v in pairs(self.itemsList2[rewardItem]) do
|
||||
v.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1 ,#singleData.TreasureReward do
|
||||
if not self.itemsList2[rewardItem][i] then
|
||||
self.itemsList2[rewardItem][i] = SubUIManager.Open(SubUIConfig.ItemView,scroll2.transform)
|
||||
end
|
||||
self.itemsList2[rewardItem][i].transform:SetParent(scroll2.transform)
|
||||
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)
|
||||
end
|
||||
|
||||
scoreLevel.text = singleData.Level
|
||||
--初始化按钮状态
|
||||
self:InitButtonState(rewardItem, singleData)
|
||||
end
|
||||
--初始化按钮状态
|
||||
function GeneralTreasurePanel:InitButtonState(rewardItem, singleData)
|
||||
local btnDeal = Util.GetGameObject(rewardItem, "btnDeal")
|
||||
local get = Util.GetGameObject(rewardItem, "btnDeal/get")
|
||||
local getAgain = Util.GetGameObject(rewardItem, "btnDeal/getAgain")
|
||||
local unfinished = Util.GetGameObject(rewardItem, "btnDeal/unfinished")
|
||||
local finished = Util.GetGameObject(rewardItem, "finished")
|
||||
local redPoint = Util.GetGameObject(rewardItem, "btnDeal/redPoint")
|
||||
--当前任务领取情况
|
||||
local state = singleData.state
|
||||
--4 未达成 3 可再次领取 2 可领取 1 已领取 -1 完美领取(充钱领取过的)
|
||||
--判断
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
btnDeal.gameObject:SetActive(false)
|
||||
get.gameObject:SetActive(false)
|
||||
getAgain.gameObject:SetActive(false)
|
||||
unfinished.gameObject:SetActive(false)
|
||||
finished.gameObject:SetActive(true)
|
||||
redPoint:SetActive(false)
|
||||
end
|
||||
--添加点击事件
|
||||
Util.AddOnceClick(btnDeal,function()
|
||||
self:OnBtnDealClicked(rewardItem,singleData)
|
||||
end)
|
||||
|
||||
--红点状态
|
||||
--redPoint:SetActive(TreasureOfHeavenManger.RedPointState(singleData,self.treasureData.treasureState))
|
||||
end
|
||||
|
||||
|
||||
--按钮事件
|
||||
function GeneralTreasurePanel:OnBtnDealClicked(rewardItem,singleData)
|
||||
|
||||
local btnDeal = Util.GetGameObject(rewardItem, "btnDeal")
|
||||
local get = Util.GetGameObject(rewardItem, "btnDeal/get")
|
||||
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
|
||||
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()--刷新界面
|
||||
end)
|
||||
end)
|
||||
elseif singleData.state == 1 then
|
||||
-- UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,3)
|
||||
end
|
||||
end
|
||||
|
||||
function GeneralTreasurePanel:ShowTime()
|
||||
if self.localTimer then
|
||||
self.localTimer:Stop()
|
||||
self.localTimer = nil
|
||||
end
|
||||
self.time.text = "重置时间:"..TimeToDHMS(self.treasureData.endTime - GetTimeStamp())
|
||||
local time = self.treasureData.endTime - GetTimeStamp()
|
||||
if time <= 0 then
|
||||
return
|
||||
end
|
||||
self.localTimer = Timer.New(function()
|
||||
time = time - 1
|
||||
if time <= 0 then
|
||||
self.time.text = "重置时间:"..TimeToDHMS(0)
|
||||
self.localTimer:Stop()
|
||||
self.localTimer = nil
|
||||
return
|
||||
end
|
||||
self.time.text = "重置时间:"..TimeToDHMS(time)
|
||||
end,1,-1,true)
|
||||
self.localTimer:Start()
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function GeneralTreasurePanel:OnClose()
|
||||
if self.localTimer then
|
||||
self.localTimer:Stop()
|
||||
self.localTimer = nil
|
||||
end
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function GeneralTreasurePanel:OnDestroy()
|
||||
self.itemsList = {}
|
||||
self.itemsList2 = {}
|
||||
end
|
||||
|
||||
return GeneralTreasurePanel
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f4ec153c5032fcd48bb7921afe7f5ef9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -213,23 +213,23 @@ function this.GetTreasureEffect(treasureList)
|
|||
local attriList1 = {}
|
||||
local attriList2 = {}
|
||||
for i = 1, #treasureList do
|
||||
LogYellow("treasureList[i]"..tostring(treasureList[i]))
|
||||
-- LogYellow("treasureList[i]"..tostring(treasureList[i]))
|
||||
local tData = QijieHolyConfig[treasureList[i]]
|
||||
--界灵数量加成
|
||||
moneyNum = moneyNum + tData.Addition[2]
|
||||
LogYellow("moneyNum"..tostring(moneyNum))
|
||||
-- LogYellow("moneyNum"..tostring(moneyNum))
|
||||
--属性加成
|
||||
if not attriList1[tData.AttriType] then
|
||||
LogGreen("1")
|
||||
-- LogGreen("1")
|
||||
attriList1[tData.AttriType] = {}
|
||||
end
|
||||
LogGreen("2")
|
||||
-- LogGreen("2")
|
||||
attriList1[tData.AttriType].title = tData.Desc
|
||||
if not attriList1[tData.AttriType].ValueList then
|
||||
LogGreen("3,tData.AttriType:"..tostring(tData.AttriType))
|
||||
attriList1[tData.AttriType].ValueList = {}
|
||||
end
|
||||
LogGreen("4,tData.Buff:"..tostring(tData.Buff))
|
||||
-- LogGreen("4,tData.Buff:"..tostring(tData.Buff))
|
||||
table.insert(attriList1[tData.AttriType].ValueList,tData)
|
||||
end
|
||||
for k,v in pairs(attriList1) do
|
||||
|
@ -239,11 +239,11 @@ function this.GetTreasureEffect(treasureList)
|
|||
attriList2[k] = {}
|
||||
end
|
||||
attriList2[k].title = attriList1[k].title
|
||||
LogGreen("5,Desc:"..tostring(attriList2[k].title))
|
||||
-- LogGreen("5,Desc:"..tostring(attriList2[k].title))
|
||||
if not attriList2[k][buffData.Value[1]] then
|
||||
attriList2[k][buffData.Value[1]] = {}
|
||||
end
|
||||
LogYellow("Desc:"..tostring(PassiveSkillConfig[n.Buff].Desc))
|
||||
-- LogYellow("Desc:"..tostring(PassiveSkillConfig[n.Buff].Desc))
|
||||
attriList2[k][buffData.Value[1]].Desc = PassiveSkillConfig[n.Buff].Desc
|
||||
if attriList2[k][buffData.Value[1]].Value then
|
||||
attriList2[k][buffData.Value[1]].Value = attriList2[k][buffData.Value[1]].Value + tonumber(PassiveSkillConfig[n.Buff].DescValue[1])/100
|
||||
|
@ -260,13 +260,13 @@ end
|
|||
function this.GetSring(stringList,type)
|
||||
local str = ""
|
||||
for k,v in pairs(stringList) do
|
||||
LogPink("Desc1:"..tostring(v.title))
|
||||
-- LogPink("Desc1:"..tostring(v.title))
|
||||
str = str..v.title
|
||||
for m,n in pairs(v) do
|
||||
if tonumber(m) then
|
||||
LogBlue("m2:"..tostring(tonumber(m)))
|
||||
LogBlue("Desc2:"..tostring(n.Desc))
|
||||
LogBlue("Value2:"..tostring(n.Value))
|
||||
-- LogBlue("m2:"..tostring(tonumber(m)))
|
||||
-- LogBlue("Desc2:"..tostring(n.Desc))
|
||||
-- LogBlue("Value2:"..tostring(n.Value))
|
||||
str = str..string.format(n.Desc,"<color=#d70f09>"..n.Value.."%</color>")
|
||||
if type and type == 1 then
|
||||
str = str.."\n"
|
||||
|
|
|
@ -1,213 +0,0 @@
|
|||
-- local HeavenUnlockExtraRewardPanel = quick_class("HeavenUnlockExtraRewardPanel", BasePanel)
|
||||
require("Base/BasePanel")
|
||||
local HeavenUnlockExtraRewardPanel = Inherit(BasePanel)
|
||||
local this = HeavenUnlockExtraRewardPanel
|
||||
|
||||
local rewardStateData = {}
|
||||
local treasureState--礼包状态
|
||||
local rewardData--表内活动数据
|
||||
local rewardData1--表内活动数据
|
||||
local curType = 0
|
||||
local type = {
|
||||
[1]={name=Language[11561],id = 106,goodsType = GoodsTypeDef.TreasureOfHeaven},
|
||||
[2] = {name=Language[11316],id = 5001,goodsType = GoodsTypeDef.FindBaby},
|
||||
[2] = {name = "无尽秘宝",id = 5001,goodsType = GoodsTypeDef.FindBaby},
|
||||
}
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
function HeavenUnlockExtraRewardPanel:InitComponent()
|
||||
this.spLoader = SpriteLoader.New()
|
||||
this.btnBack = Util.GetGameObject(this.transform, "frame/bg/closeBtn")
|
||||
this.btnBack2 = Util.GetGameObject(this.transform, "frame")
|
||||
this.dealBtn = Util.GetGameObject(this.transform, "frame/bg/dealBtn")
|
||||
this.Content = Util.GetGameObject(this.transform, "rewardPart/Viewport/Content")
|
||||
this.box1 = Util.GetGameObject(this.Content, "box1")
|
||||
this.box2 = Util.GetGameObject(this.Content, "box2")
|
||||
this.taskList = {}
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function HeavenUnlockExtraRewardPanel:BindEvent()
|
||||
Util.AddClick(this.btnBack, function()
|
||||
this:ClosePanel()
|
||||
end)
|
||||
Util.AddClick(this.btnBack2, function()
|
||||
this:ClosePanel()
|
||||
end)
|
||||
Util.AddOnceClick(this.dealBtn,function()
|
||||
PayManager.Pay(type[curType].id, function(id)
|
||||
this.RechargeSuccessFunc()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function HeavenUnlockExtraRewardPanel:OnSortingOrderChange()
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function HeavenUnlockExtraRewardPanel:OnOpen(_type)
|
||||
curType = _type
|
||||
end
|
||||
|
||||
-- 打开,重新打开时回调
|
||||
function HeavenUnlockExtraRewardPanel:OnShow()
|
||||
LogGreen("curType:"..curType)
|
||||
if curType == 1 then
|
||||
rewardStateData = TreasureOfHeavenManger.GetState()
|
||||
rewardData = TreasureOfHeavenManger.GetAllRewardData()
|
||||
HeavenUnlockExtraRewardPanel:showRewardTianGong()
|
||||
elseif curType == 2 then
|
||||
rewardData = QinglongSerectTreasureManager.GetAllRewardData()
|
||||
HeavenUnlockExtraRewardPanel:showRewardQinglong()
|
||||
elseif curType == 3 then
|
||||
|
||||
rewardData,rewardData1 = EndLessMapManager.GetAllRewardData()
|
||||
HeavenUnlockExtraRewardPanel:showRewardWuJin()
|
||||
end
|
||||
end
|
||||
|
||||
--充值成功
|
||||
function HeavenUnlockExtraRewardPanel:RechargeSuccessFunc()
|
||||
PopupTipPanel.ShowTip(Language[11564])
|
||||
FirstRechargeManager.RefreshAccumRechargeValue(type[curType].id)
|
||||
OperatingManager.RefreshGiftGoodsBuyTimes(type[curType].goodsType,type[curType].id)
|
||||
if curType == 1 then
|
||||
TreasureOfHeavenManger.SetTreasureState()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.TreasureOfHeaven.RechargeSuccess)
|
||||
elseif curType == 2 then
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess,false,false)
|
||||
elseif curType == 3 then
|
||||
EndLessMapManager.SetTreasureGiftState(1)
|
||||
EndLessMapManager.SetTreasureState()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.EndLess.RechargeQinglongSerectSuccess,false,false)
|
||||
end
|
||||
this:ClosePanel()
|
||||
|
||||
end
|
||||
|
||||
--直接/间接奖励
|
||||
function HeavenUnlockExtraRewardPanel:showRewardTianGong()
|
||||
|
||||
local direct = {}
|
||||
local indirect ={}
|
||||
|
||||
for i = 1, #rewardData do
|
||||
if rewardStateData[i].state == 1 then--已达成但不能领取的
|
||||
-- body
|
||||
local reward = rewardData[i]
|
||||
local k1 = reward.TreasureReward[1][1]
|
||||
local v1 = reward.TreasureReward[1][2]
|
||||
local k2 = reward.TreasureReward[2][1]
|
||||
local v2 = reward.TreasureReward[2][2]
|
||||
|
||||
if not direct[k1] then
|
||||
direct[k1] = 0
|
||||
end
|
||||
direct[k1] = direct[k1] + v1
|
||||
|
||||
if not direct[k2] then
|
||||
direct[k2] = 0
|
||||
end
|
||||
direct[k2] = direct[k2] + v2
|
||||
|
||||
elseif rewardStateData[i].state == 0 then--未达成且不能领取的
|
||||
local reward = rewardData[i]
|
||||
local k1 = reward.TreasureReward[1][1]
|
||||
local v1 = reward.TreasureReward[1][2]
|
||||
local k2 = reward.TreasureReward[2][1]
|
||||
local v2 = reward.TreasureReward[2][2]
|
||||
|
||||
if not indirect[k1] then
|
||||
indirect[k1] = 0
|
||||
end
|
||||
indirect[k1] = indirect[k1] + v1
|
||||
|
||||
if not indirect[k2] then
|
||||
indirect[k2] = 0
|
||||
end
|
||||
indirect[k2] = indirect[k2] + v2
|
||||
end
|
||||
|
||||
end
|
||||
HeavenUnlockExtraRewardPanel:SetItem(direct,indirect)
|
||||
end
|
||||
|
||||
function HeavenUnlockExtraRewardPanel:SetItem(direct,indirect)
|
||||
if not this.taskList then
|
||||
this.taskList = {}
|
||||
end
|
||||
for i = 1,#this.taskList do
|
||||
this.taskList.gameObject:SetActive(false)
|
||||
end
|
||||
local index = 0
|
||||
for key, value in pairs(direct) do
|
||||
index = index + 1
|
||||
if not this.taskList[index] then
|
||||
this.taskList[index] = SubUIManager.Open(SubUIConfig.ItemView, this.box1.transform)
|
||||
end
|
||||
this.taskList[index]:OnOpen(false,{key, value},0.9)
|
||||
this.taskList[index].gameObject:SetActive(true)
|
||||
end
|
||||
for key, value in pairs(indirect) do
|
||||
index = index + 1
|
||||
if not this.taskList[index] then
|
||||
this.taskList[index] = SubUIManager.Open(SubUIConfig.ItemView, this.box1.transform)
|
||||
end
|
||||
this.taskList[index]:OnOpen(false,{key, value},0.9)
|
||||
this.taskList[index].gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
||||
--直接/间接奖励
|
||||
function HeavenUnlockExtraRewardPanel:showRewardQinglong()
|
||||
local direct = {}
|
||||
local indirect ={}
|
||||
|
||||
for i = 1, #rewardData do
|
||||
-- body
|
||||
local reward = rewardData[i]
|
||||
for j=1,#reward.Reward do
|
||||
local id = reward.Reward[j].item[1]
|
||||
local num = reward.Reward[j].item[2]
|
||||
if reward.Reward[j].type == 2 then
|
||||
if rewardData[i].state == 1 or rewardData[i].state == 0 then
|
||||
if not direct[id] then
|
||||
direct[id] = 0
|
||||
end
|
||||
direct[id] = direct[id] + num
|
||||
elseif rewardData[i].state == -2 then
|
||||
if not indirect[id] then
|
||||
indirect[id] = 0
|
||||
end
|
||||
indirect[id] = indirect[id] + num
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
HeavenUnlockExtraRewardPanel:SetItem(direct,indirect)
|
||||
end
|
||||
|
||||
--直接/间接奖励
|
||||
function HeavenUnlockExtraRewardPanel:showRewardWuJin()
|
||||
local direct = rewardData
|
||||
local indirect = rewardData1
|
||||
|
||||
HeavenUnlockExtraRewardPanel:SetItem(direct,indirect)
|
||||
end
|
||||
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function HeavenUnlockExtraRewardPanel:OnClose()
|
||||
for i = 1,#this.taskList do
|
||||
SubUIManager.Close(this.taskList[i])
|
||||
end
|
||||
this.taskList = {}
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function HeavenUnlockExtraRewardPanel:OnDestroy()
|
||||
this.spLoader:Destroy()
|
||||
end
|
||||
|
||||
return HeavenUnlockExtraRewardPanel
|
|
@ -386,7 +386,7 @@ function UpView:RechargeType(_type)
|
|||
_type==UpViewRechargeType.LuoFuJingShi or
|
||||
_type==UpViewRechargeType.XiuXian or
|
||||
_type==UpViewRechargeType.SuiFanXingCheng or
|
||||
_type==UpViewRechargeType.QiJieCoin then
|
||||
_type==UpViewRechargeType.QiJieCoin or
|
||||
_type==UpViewRechargeType.LunDaoBi then
|
||||
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup, _type)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue