【七界试炼】七界秘宝提交

dev_chengFeng
ZhangBiao 2021-09-17 17:42:18 +08:00
parent 163950a4a1
commit 488ad1caad
5 changed files with 39 additions and 5 deletions

View File

@ -1311,7 +1311,7 @@ GoodsTypeDef = {
TreasureOfHeaven=12,--天宫秘宝 TreasureOfHeaven=12,--天宫秘宝
WuJinMiBao=14,--天宫秘宝 WuJinMiBao=14,--天宫秘宝
-- UpgradePackage=13,--升级限时礼包 -- UpgradePackage=13,--升级限时礼包
--TreasureOfHeaven=12,--天宫秘宝 QiJieMiBao=40,--天宫秘宝
} }
--工坊功能类型 --工坊功能类型

View File

@ -493,4 +493,7 @@ GameEvent = {
UpdateWordLv="JumpServerHeightLadder.UpdateWordLv",-- 刷新世界等级 UpdateWordLv="JumpServerHeightLadder.UpdateWordLv",-- 刷新世界等级
CrossStateChange = "JumpServerHeightLadder.CrossStateChange", -- 跨服状态改变 CrossStateChange = "JumpServerHeightLadder.CrossStateChange", -- 跨服状态改变
}, },
SerectTreasure = {
RechargeSuccess = "SerectTreasure.RechargeSuccess"--秘宝充值成功
}
} }

View File

@ -42,6 +42,7 @@ function this.InitConfigData()
end end
function this.GetTreasureData(ActType) function this.GetTreasureData(ActType)
this.curType = ActType
local actInfo = ActivityGiftManager.GetActivityTypeInfo(ActType) local actInfo = ActivityGiftManager.GetActivityTypeInfo(ActType)
local curTypeData = this.TreasureList[ActType] local curTypeData = this.TreasureList[ActType]
curTypeData.ActId = actInfo.activityId curTypeData.ActId = actInfo.activityId
@ -83,4 +84,21 @@ function this.GetTreasureData(ActType)
return curTypeData return curTypeData
end end
function this.GetAllRewardData()
local directData = {}
local indirectData = {}
local value = this.TreasureList[this.curType].value
for k,v in ConfigPairs(ConfigManager.GetConfig(this.TreasureList[this.curType].configName)) do
local curDataList = v.Integral[1][2] <= value and directData or indirectData
for i = 1, #v.TreasureReward do
if not curDataList[v.TreasureReward[i][1]] then
curDataList[v.TreasureReward[i][1]] = 0
end
curDataList[v.TreasureReward[i][1]] = curDataList[v.TreasureReward[i][1]] + v.TreasureReward[i][2]
end
end
return directData,indirectData
end
return GeneralTreasureMangaer return GeneralTreasureMangaer

View File

@ -46,10 +46,12 @@ end
--添加事件监听(用于子类重写) --添加事件监听(用于子类重写)
function GeneralTreasurePanel:AddListener() function GeneralTreasurePanel:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.SerectTreasure.RechargeSuccess, self.refresh,self)
end end
--移除事件监听(用于子类重写) --移除事件监听(用于子类重写)
function GeneralTreasurePanel:RemoveListener() function GeneralTreasurePanel:RemoveListener()
Game.GlobalEvent:AddEvent(GameEvent.SerectTreasure.RechargeSuccess, self.refresh,self)
end end
--界面打开时调用(用于子类重写) --界面打开时调用(用于子类重写)
@ -78,7 +80,7 @@ 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()
PopupTipPanel.ShowTip("天宫秘宝") UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,4)
end) end)
end end
@ -146,7 +148,7 @@ function GeneralTreasurePanel:SingleTask(rewardItem, singleData)
self.itemsList2[rewardItem][i]:OnOpen(false, {singleData.TreasureReward[i][1], singleData.TreasureReward[i][2]}, 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.Integral[1][2]
--初始化按钮状态 --初始化按钮状态
self:InitButtonState(rewardItem, singleData) self:InitButtonState(rewardItem, singleData)
end end
@ -222,7 +224,7 @@ function GeneralTreasurePanel:OnBtnDealClicked(rewardItem,singleData)
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,4)
end end
end end

View File

@ -16,6 +16,7 @@ local type = {
[1] = {name=Language[11561],id = 106,goodsType = GoodsTypeDef.TreasureOfHeaven}, [1] = {name=Language[11561],id = 106,goodsType = GoodsTypeDef.TreasureOfHeaven},
[2] = {name=Language[11316],id = 5001,goodsType = GoodsTypeDef.FindBaby}, [2] = {name=Language[11316],id = 5001,goodsType = GoodsTypeDef.FindBaby},
[3] = {name="无尽秘宝",id = 107,goodsType = GoodsTypeDef.WuJinMiBao}, [3] = {name="无尽秘宝",id = 107,goodsType = GoodsTypeDef.WuJinMiBao},
[4] = {name="七界秘宝",id = 108,goodsType = GoodsTypeDef.QiJieMiBao},
} }
--初始化组件(用于子类重写) --初始化组件(用于子类重写)
@ -80,6 +81,14 @@ function this:OnShow(_parent,...)
this.dealBtnText.gameObject:SetActive(true) this.dealBtnText.gameObject:SetActive(true)
local config = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig,type[curType].id) local config = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig,type[curType].id)
this.dealBtnText.text = MoneyUtil.GetMoneyUnitNameWithMoney(config.Price) this.dealBtnText.text = MoneyUtil.GetMoneyUnitNameWithMoney(config.Price)
elseif curType == 4 then --七界秘宝
rewardData,rewardData1 = GeneralTreasureMangaer.GetAllRewardData()
this:SetItem(rewardData,rewardData1)
this.tip.text = "<color=#60A22C>解锁秘宝,激活进阶</color><color=#95523B>专属奖励+1500积分<color=#CC4325>可获取1280妖晶</color></color>"
this.dealBtnIma.gameObject:SetActive(false)
this.dealBtnText.gameObject:SetActive(true)
local config = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig,type[curType].id)
this.dealBtnText.text = MoneyUtil.GetMoneyUnitNameWithMoney(config.Price)
end end
end end
@ -97,7 +106,9 @@ function this:RechargeSuccessFunc()
EndLessMapManager.SetTreasureGiftState(1) EndLessMapManager.SetTreasureGiftState(1)
EndLessMapManager.SetTreasureState() EndLessMapManager.SetTreasureState()
Game.GlobalEvent:DispatchEvent(GameEvent.EndLess.RechargeQinglongSerectSuccess,false,false) Game.GlobalEvent:DispatchEvent(GameEvent.EndLess.RechargeQinglongSerectSuccess,false,false)
end elseif curType == 4 then
Game.GlobalEvent:DispatchEvent(GameEvent.SerectTreasure.RechargeSuccess,false,false)
end
parent:ClosePanel() parent:ClosePanel()
end end