【ID1009791】

幸运探宝够12张券时开启红点提示
dev_chengFeng
jiaoyangna 2021-07-13 10:35:03 +08:00
parent ff8d774c2f
commit e444a1283c
3 changed files with 30 additions and 15 deletions

View File

@ -101,6 +101,7 @@ function this.BackDataRefreshEnerny(msgItemInfo)
end end
end end
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold) Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
CheckRedPointStatus(RedPointType.Recruit_Normal) CheckRedPointStatus(RedPointType.Recruit_Normal)
end end
end end
@ -765,6 +766,7 @@ function this.GetTableByBackDropData(drop)
end end
end end
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold) Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
return itemDataList return itemDataList
end end
@ -1094,6 +1096,7 @@ function this.BagIndicationRefresh(msg)
end end
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged) Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged)
end end
RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold) Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
--检测背包红点 --检测背包红点
CheckRedPointStatus(RedPointType.Bag_HeroDebris) CheckRedPointStatus(RedPointType.Bag_HeroDebris)

View File

@ -73,6 +73,8 @@ function this.Initialize()
table.insert(this.boxReward_Two,v) table.insert(this.boxReward_Two,v)
end end
end end
LuckyTurnTableManager.InitTableData()
end end
---------------------------------------------------- ----------------------------------------------------
@ -333,14 +335,18 @@ end
---获取探宝1/多次按钮信息 1探宝类型 ---获取探宝1/多次按钮信息 1探宝类型
function this.GetTreasureBtnInfo(spLoader, treasureType) function this.GetTreasureBtnInfo(spLoader, treasureType)
local isShow = false
if treasureType==TreasureType.Lucky then if treasureType==TreasureType.Lucky then
local oneData={1,this.dialRewardSettingConfig[1].CostItem[2][4]}--1探宝次数 2消耗道具数量 local oneData={1,this.dialRewardSettingConfig[1].CostItem[2][4],isShow}--1探宝次数 2消耗道具数量
local moreData={this.dialRewardSettingConfig[1].ExtractingTime,this.dialRewardSettingConfig[1].MultipleCostItem[2][4]} if BagManager.GetItemCountById(60) >= this.dialRewardSettingConfig[1].MultipleCostItem[2][4] then
isShow = true
end
local moreData={this.dialRewardSettingConfig[1].ExtractingTime,this.dialRewardSettingConfig[1].MultipleCostItem[2][4],isShow}
local icon = SetIcon(spLoader, 60) local icon = SetIcon(spLoader, 60)
return oneData,moreData,icon return oneData,moreData,icon
elseif treasureType==TreasureType.Advanced then elseif treasureType==TreasureType.Advanced then
local oneData={1,this.dialRewardSettingConfig[2].CostItem[2][4]} local oneData={1,this.dialRewardSettingConfig[2].CostItem[2][4],isShow}
local moreData={this.dialRewardSettingConfig[2].ExtractingTime,this.dialRewardSettingConfig[2].MultipleCostItem[2][4]} local moreData={this.dialRewardSettingConfig[2].ExtractingTime,this.dialRewardSettingConfig[2].MultipleCostItem[2][4],isShow}
local icon = SetIcon(spLoader, 61) local icon = SetIcon(spLoader, 61)
return oneData,moreData,icon return oneData,moreData,icon
end end
@ -393,7 +399,13 @@ end
-------红点相关-------------- -------红点相关--------------
function this.ReturnRedPointState() function this.ReturnRedPointState()
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LuckyTurnTable_One) then if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LuckyTurnTable_One) then
return this.ReturnRewardBoxRedPoint() if BagManager.GetItemCountById(60) >= this.dialRewardSettingConfig[1].MultipleCostItem[2][4] then
return true
end
if this.ReturnRewardBoxRedPoint() then
return true
end
return false
else else
--Log("红点返回False") --Log("红点返回False")
return false return false

View File

@ -24,7 +24,6 @@ local isPlayVideo = false
---初始化组件(用于子类重写) ---初始化组件(用于子类重写)
function LuckyTurnTablePanel:InitComponent(gameObject) function LuckyTurnTablePanel:InitComponent(gameObject)
this.spLoader = SpriteLoader.New() this.spLoader = SpriteLoader.New()
LuckyTurnTableManager.InitTableData()
LuckyTurnTableManager.GetLuckyTurnRequest() LuckyTurnTableManager.GetLuckyTurnRequest()
this.luckyTurnPanel=Util.GetGameObject(self.gameObject,"Panel") this.luckyTurnPanel=Util.GetGameObject(self.gameObject,"Panel")
@ -82,6 +81,7 @@ function LuckyTurnTablePanel:InitComponent(gameObject)
this.treasureMultipleText=Util.GetGameObject(this.treasureMultipleBtn,"Text"):GetComponent("Text") this.treasureMultipleText=Util.GetGameObject(this.treasureMultipleBtn,"Text"):GetComponent("Text")
this.treasureMultipleIcon=Util.GetGameObject(this.treasureMultipleBtn,"Icon"):GetComponent("Image") this.treasureMultipleIcon=Util.GetGameObject(this.treasureMultipleBtn,"Icon"):GetComponent("Image")
this.treasureMultipleNum=Util.GetGameObject(this.treasureMultipleBtn,"Num"):GetComponent("Text") this.treasureMultipleNum=Util.GetGameObject(this.treasureMultipleBtn,"Num"):GetComponent("Text")
this.treasureMultipleRed=Util.GetGameObject(this.treasureMultipleBtn,"red")
this.refreshBtn=Util.GetGameObject(this.bottom,"RefreshBtn") this.refreshBtn=Util.GetGameObject(this.bottom,"RefreshBtn")
this.freeDetail=Util.GetGameObject(this.refreshBtn,"FreeDetail") this.freeDetail=Util.GetGameObject(this.refreshBtn,"FreeDetail")
this.detail=Util.GetGameObject(this.refreshBtn,"Detail") this.detail=Util.GetGameObject(this.refreshBtn,"Detail")
@ -274,14 +274,14 @@ function this.SwitchTreasureType(treasureType)
--设置需要材料显示 --设置需要材料显示
this.SetPropShow(60,treasureType) this.SetPropShow(60,treasureType)
--探宝按钮显示 --探宝按钮显示
local oneData,moreData,icon=LuckyTurnTableManager.GetTreasureBtnInfo(this.spLoader, treasureType) this.SetTreasureBtnShow(treasureType)
this.SetTreasureBtnShow(oneData,moreData,icon)
--探宝泉预览 --探宝泉预览
Util.AddOnceClick(this.propBtn,function() Util.AddOnceClick(this.propBtn,function()
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,60) UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,60)
end) end)
--探宝1次按钮 --探宝1次按钮
Util.AddOnceClick(this.treasureOnceBtn, function() Util.AddOnceClick(this.treasureOnceBtn, function()
local oneData,moreData,icon=LuckyTurnTableManager.GetTreasureBtnInfo(this.spLoader, treasureType)
if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-oneData[2]>=0 if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-oneData[2]>=0
and LuckyTurnTableManager.luckyTimes + 1 <= maxTimesCount then and LuckyTurnTableManager.luckyTimes + 1 <= maxTimesCount then
LuckyTurnTableManager.GetLuckyTurnRankRequest(TreasureType.Lucky,false,function() LuckyTurnTableManager.GetLuckyTurnRankRequest(TreasureType.Lucky,false,function()
@ -292,6 +292,7 @@ function this.SwitchTreasureType(treasureType)
LuckyTurnTableManager.SetTimes(LuckyTurnTableManager.luckyTimes + 1) LuckyTurnTableManager.SetTimes(LuckyTurnTableManager.luckyTimes + 1)
this.maxTimes.text =string.format(Language[11156],LuckyTurnTableManager.luckyTimes,maxTimesCount) this.maxTimes.text =string.format(Language[11156],LuckyTurnTableManager.luckyTimes,maxTimesCount)
isPlayVideo = true isPlayVideo = true
this.SetTreasureBtnShow(treasureType)
end) end)
else else
--PopupTipPanel.ShowTip("幸运探宝券不足!") --PopupTipPanel.ShowTip("幸运探宝券不足!")
@ -305,6 +306,7 @@ function this.SwitchTreasureType(treasureType)
end) end)
--探宝10次按钮 --探宝10次按钮
Util.AddOnceClick(this.treasureMultipleBtn, function() Util.AddOnceClick(this.treasureMultipleBtn, function()
local oneData,moreData,icon=LuckyTurnTableManager.GetTreasureBtnInfo(this.spLoader, treasureType)
if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-moreData[2]>=0 if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-moreData[2]>=0
and LuckyTurnTableManager.luckyTimes + 15 <= maxTimesCount then and LuckyTurnTableManager.luckyTimes + 15 <= maxTimesCount then
LuckyTurnTableManager.GetLuckyTurnRankRequest(TreasureType.Lucky,true,function() LuckyTurnTableManager.GetLuckyTurnRankRequest(TreasureType.Lucky,true,function()
@ -315,6 +317,7 @@ function this.SwitchTreasureType(treasureType)
LuckyTurnTableManager.SetTimes(LuckyTurnTableManager.luckyTimes + 15) LuckyTurnTableManager.SetTimes(LuckyTurnTableManager.luckyTimes + 15)
this.maxTimes.text =string.format(Language[11156],LuckyTurnTableManager.luckyTimes,maxTimesCount) this.maxTimes.text =string.format(Language[11156],LuckyTurnTableManager.luckyTimes,maxTimesCount)
isPlayVideo = true isPlayVideo = true
this.SetTreasureBtnShow(treasureType)
end) end)
else else
--PopupTipPanel.ShowTip("幸运探宝券不足!") --PopupTipPanel.ShowTip("幸运探宝券不足!")
@ -388,8 +391,7 @@ function this.SwitchTreasureType(treasureType)
this.SetPropShow(61,treasureType) this.SetPropShow(61,treasureType)
--探宝按钮显示 --探宝按钮显示
local oneData,moreData,icon=LuckyTurnTableManager.GetTreasureBtnInfo(this.spLoader, treasureType) this.SetTreasureBtnShow(treasureType)
this.SetTreasureBtnShow(oneData,moreData,icon)
--探宝泉预览 --探宝泉预览
Util.AddOnceClick(this.propBtn,function() Util.AddOnceClick(this.propBtn,function()
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,61) UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,61)
@ -448,7 +450,6 @@ function this.SwitchTreasureType(treasureType)
end) end)
--刷新按钮 --刷新按钮
Util.AddOnceClick(this.refreshBtn, function() Util.AddOnceClick(this.refreshBtn, function()
LogBlue("高级刷新券 "..BagManager.GetItemCountById(63))
if BagManager.GetItemCountById(63)>0 then if BagManager.GetItemCountById(63)>0 then
this.PlayItemListAnim() this.PlayItemListAnim()
LuckyTurnTableManager.GetLuckyTurnRefreshRequest(TreasureType.Advanced,true,function() LuckyTurnTableManager.GetLuckyTurnRefreshRequest(TreasureType.Advanced,true,function()
@ -458,9 +459,6 @@ function this.SwitchTreasureType(treasureType)
this.RefreshBtnCountDown() this.RefreshBtnCountDown()
end) end)
else else
LogBlue("高级刷新券 "..LuckyTurnTableManager.GetRefreshItemNum())
LogBlue("高级刷新券 "..LuckyTurnTableManager.dialRewardSettingConfig[2].Cost[2][4])
LogBlue("高级刷新券 ".. LuckyTurnTableManager.GetRefreshItemNum()-LuckyTurnTableManager.dialRewardSettingConfig[2].Cost[2][4])
if LuckyTurnTableManager.GetRefreshItemNum()-LuckyTurnTableManager.dialRewardSettingConfig[2].Cost[2][4]>=0 then if LuckyTurnTableManager.GetRefreshItemNum()-LuckyTurnTableManager.dialRewardSettingConfig[2].Cost[2][4]>=0 then
this.PlayItemListAnim() this.PlayItemListAnim()
LuckyTurnTableManager.GetLuckyTurnRefreshRequest(TreasureType.Advanced,false,function() LuckyTurnTableManager.GetLuckyTurnRefreshRequest(TreasureType.Advanced,false,function()
@ -629,13 +627,15 @@ function this.SetPropShow(itemId,treasureType)
end end
---探宝按钮显示 ---探宝按钮显示
function this.SetTreasureBtnShow(oneData,moreData,icon) function this.SetTreasureBtnShow(treasureType)
local oneData,moreData,icon=LuckyTurnTableManager.GetTreasureBtnInfo(this.spLoader, treasureType)
this.treasureOnceText.text=Language[11163]..oneData[1]..Language[10048] this.treasureOnceText.text=Language[11163]..oneData[1]..Language[10048]
this.treasureOnceNum.text=oneData[2] this.treasureOnceNum.text=oneData[2]
this.treasureOnceIcon.sprite=icon this.treasureOnceIcon.sprite=icon
this.treasureMultipleText.text=Language[11163]..moreData[1]..Language[10048] this.treasureMultipleText.text=Language[11163]..moreData[1]..Language[10048]
this.treasureMultipleNum.text=moreData[2] this.treasureMultipleNum.text=moreData[2]
this.treasureMultipleIcon.sprite=icon this.treasureMultipleIcon.sprite=icon
this.treasureMultipleRed.gameObject:SetActive(moreData[3])
end end
--------------------------------免费刷新-------------------------------- --------------------------------免费刷新--------------------------------