[限时祈愿] 活动奖励界面提交
parent
fb9ced58fb
commit
510b2460ea
|
@ -1192,7 +1192,7 @@ ActivityTypeDef = {
|
||||||
DynamicAct = 20000,--主题活动任务
|
DynamicAct = 20000,--主题活动任务
|
||||||
DynamicAct_TimeLimitShop = 20001,--主题活动限时商市
|
DynamicAct_TimeLimitShop = 20001,--主题活动限时商市
|
||||||
DynamicAct_Treasure = 20002,--主题活动珍奇宝阁
|
DynamicAct_Treasure = 20002,--主题活动珍奇宝阁
|
||||||
|
LimitUpHero = 20003, --限时up活动 (祈愿)
|
||||||
TreasureStore = 6000,--百宝商会
|
TreasureStore = 6000,--百宝商会
|
||||||
YiJingBaoKu = 8000,--易经宝库
|
YiJingBaoKu = 8000,--易经宝库
|
||||||
|
|
||||||
|
|
|
@ -438,6 +438,7 @@ SubUIConfig = {
|
||||||
|
|
||||||
[15] = {name = "page2",assetName = "page2",script = "Modules/DynamicActivity/SheJiDaDian"}, --社稷大典
|
[15] = {name = "page2",assetName = "page2",script = "Modules/DynamicActivity/SheJiDaDian"}, --社稷大典
|
||||||
[16] = {name = "TimeLimitUpHero",assetName = "TimeLimitUpHero",script = "Modules/DynamicActivity/TimeLimitUpHero"}, --限时召唤
|
[16] = {name = "TimeLimitUpHero",assetName = "TimeLimitUpHero",script = "Modules/DynamicActivity/TimeLimitUpHero"}, --限时召唤
|
||||||
|
--[16] = {name = "page3",assetName = "page3",script = "Modules/DynamicActivity/TimeLimitedCall"}, --限时召唤
|
||||||
[17] = {name = "page4",assetName = "page4",script = "Modules/DynamicActivity/QianKunBox"},--乾坤宝盒
|
[17] = {name = "page4",assetName = "page4",script = "Modules/DynamicActivity/QianKunBox"},--乾坤宝盒
|
||||||
[18] = {name = "page9",assetName = "page9",script = "Modules/DynamicActivity/YiJingBaoKu"},--易经宝库
|
[18] = {name = "page9",assetName = "page9",script = "Modules/DynamicActivity/YiJingBaoKu"},--易经宝库
|
||||||
[19] = {name = "page10",assetName = "page10",script = "Modules/DynamicActivity/ShengYiTianJiang"},--神衣天降
|
[19] = {name = "page10",assetName = "page10",script = "Modules/DynamicActivity/ShengYiTianJiang"},--神衣天降
|
||||||
|
|
|
@ -80,22 +80,22 @@ end
|
||||||
--绑定事件(用于子类重写)
|
--绑定事件(用于子类重写)
|
||||||
function TimeLimitUpHero:BindEvent()
|
function TimeLimitUpHero:BindEvent()
|
||||||
Util.AddOnceClick(self.helpBtn, function()
|
Util.AddOnceClick(self.helpBtn, function()
|
||||||
UIManager.OpenPanel(UIName.HelpPopup,self.actConfig.HelpId,self.helpPosition.x,self.helpPosition.y)
|
UIManager.OpenPanel(UIName.HelpPopup,Setting.QAId,self.helpPosition.x,self.helpPosition.y)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Util.AddOnceClick(self.btnActivity, function()
|
Util.AddOnceClick(self.btnActivity, function()
|
||||||
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.RecrutDetail,self.actConfig.HelpId,self.actId,PRE_REWARD_POOL_TYPE.TIME_LIMITED_UP,PRE_REWARD_POOL_TYPE.TIME_LIMITED)
|
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.RecrutDetail,Setting.QAId,20003,PRE_REWARD_POOL_TYPE.TIME_LIMITED_UP,PRE_REWARD_POOL_TYPE.TIME_LIMITED,curHeroId,self.actId)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
function TimeLimitUpHero:AddListener()
|
function TimeLimitUpHero:AddListener()
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.Activity.ContinueRechargeRefresh,self.OnUPHeroChange,self)
|
Game.GlobalEvent:AddEvent(GameEvent.Activity.TimeLimitUpHeroChange,self.OnUPHeroChange,self)
|
||||||
end
|
end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
function TimeLimitUpHero:RemoveListener()
|
function TimeLimitUpHero:RemoveListener()
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.ContinueRechargeRefresh,self.OnUPHeroChange,self)
|
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.TimeLimitUpHeroChange,self.OnUPHeroChange,self)
|
||||||
end
|
end
|
||||||
|
|
||||||
--up的英雄改变
|
--up的英雄改变
|
||||||
|
@ -173,9 +173,6 @@ function TimeLimitUpHero:RefreshGetHeroTimes()
|
||||||
local curTimes = PrivilegeManager.GetPrivilegeUsedTimes(self.maxtimesId)
|
local curTimes = PrivilegeManager.GetPrivilegeUsedTimes(self.maxtimesId)
|
||||||
self.upper.text= "今日召唤上限:"..curTimes.."/"..privilegeConfig[self.maxtimesId].Condition[1][2]--特权上限
|
self.upper.text= "今日召唤上限:"..curTimes.."/"..privilegeConfig[self.maxtimesId].Condition[1][2]--特权上限
|
||||||
self.timeupdate.gameObject:SetActive(true)
|
self.timeupdate.gameObject:SetActive(true)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if self.freeTimesId and self.freeTimesId > 0 then
|
if self.freeTimesId and self.freeTimesId > 0 then
|
||||||
freeTime = PrivilegeManager.GetPrivilegeRemainValue(self.freeTimesId)
|
freeTime = PrivilegeManager.GetPrivilegeRemainValue(self.freeTimesId)
|
||||||
LogError("self freetimes "..freeTime)
|
LogError("self freetimes "..freeTime)
|
||||||
|
@ -292,7 +289,7 @@ function TimeLimitUpHero:Recruit(actId,type)
|
||||||
if not oneFunc then
|
if not oneFunc then
|
||||||
LogError(" one func ==nil")
|
LogError(" one func ==nil")
|
||||||
end
|
end
|
||||||
-- UIManager.OpenPanel(UIName.SingleRecruitPanel, msg.drop.Hero,actId,1,{RecruitType.TimeLimitSingle,RecruitType.TimeLimitTen},oneFunc2)
|
UIManager.OpenPanel(UIName.SingleRecruitPanel, msg.drop.Hero[1],actId,1,{RecruitType.TimeLimitSingle,RecruitType.TimeLimitTen},oneFunc2)
|
||||||
end
|
end
|
||||||
CheckRedPointStatus(RedPointType.TimeLimited)
|
CheckRedPointStatus(RedPointType.TimeLimited)
|
||||||
end,self.freeTimesId)
|
end,self.freeTimesId)
|
||||||
|
|
|
@ -6,7 +6,10 @@ local parent
|
||||||
local sortingOrder=0
|
local sortingOrder=0
|
||||||
local activityId = 0
|
local activityId = 0
|
||||||
local activityType = 0
|
local activityType = 0
|
||||||
|
local heroID =0
|
||||||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||||
|
local artResourcesConfig=ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
|
||||||
|
local pool=ConfigManager.GetConfig(ConfigName.WishActivityPool)
|
||||||
function this:InitComponent(gameObject)
|
function this:InitComponent(gameObject)
|
||||||
this.title = Util.GetGameObject(gameObject,"title"):GetComponent("Text")
|
this.title = Util.GetGameObject(gameObject,"title"):GetComponent("Text")
|
||||||
this.tip = Util.GetGameObject(gameObject,"tip"):GetComponent("Text")
|
this.tip = Util.GetGameObject(gameObject,"tip"):GetComponent("Text")
|
||||||
|
@ -66,11 +69,21 @@ function this:OnShow(_parent,...)
|
||||||
|
|
||||||
local poolUpType = args[3] or 0
|
local poolUpType = args[3] or 0
|
||||||
local poolType = args[4] or 0
|
local poolType = args[4] or 0
|
||||||
|
heroID = args[5]
|
||||||
|
local activityId = args[6]
|
||||||
LogGreen("poolUpType:"..poolUpType.." poolType:"..poolType)
|
LogGreen("poolUpType:"..poolUpType.." poolType:"..poolType)
|
||||||
local UpItemList=RecruitManager.GetRewardPreviewData(poolUpType)
|
if activityType == ActivityTypeDef.LimitUpHero and heroID then
|
||||||
local itemList = RecruitManager.GetRewardPreviewData(poolType)
|
local heroConfig=ConfigManager.TryGetConfigData(ConfigName.HeroConfig,heroID)
|
||||||
local _upRateList,rateList = this:BuildRateData(activityType,itemList,UpItemList)
|
if heroConfig then
|
||||||
this:ReFreshUpItem(UpItemList,_upRateList)
|
this:ShowUpItem(heroConfig,activityId)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local UpItemList=RecruitManager.GetRewardPreviewData(poolUpType)
|
||||||
|
local itemList = RecruitManager.GetRewardPreviewData(poolType)
|
||||||
|
local _upRateList,rateList = this:BuildRateData(activityType,itemList,UpItemList)
|
||||||
|
this:ReFreshUpItem(UpItemList,_upRateList)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:ReFreshUpItem(UpItem,rateList)
|
function this:ReFreshUpItem(UpItem,rateList)
|
||||||
|
@ -96,6 +109,70 @@ function this:ReFreshUpItem(UpItem,rateList)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--限时up英雄
|
||||||
|
function this:ShowUpItem(config,actId)
|
||||||
|
local hero=SubUIManager.Open(SubUIConfig.ItemView,this.itemGrid.transform)
|
||||||
|
local wishUpConfig=ConfigManager.TryGetConfigDataByKey(ConfigName.WishActivityUp,"ActivityId",actId)
|
||||||
|
local num=0
|
||||||
|
for i = 1, #wishUpConfig.UpList do
|
||||||
|
if wishUpConfig.UpList[i][1]==heroID then
|
||||||
|
num=wishUpConfig.UpList[i][3]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
hero:OnOpen(false,{config.Id,1},1.1,true)
|
||||||
|
hero.name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (num/100000)*100) .."%</color>"
|
||||||
|
hero.gameObject:SetActive(true)
|
||||||
|
|
||||||
|
for k,v in ipairs(this.ratePreList) do
|
||||||
|
v.go.gameObject:SetActive(false)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- table.sort(pool,function(a,b)
|
||||||
|
-- return a.GetRate>b.GetRate
|
||||||
|
-- end)
|
||||||
|
local rateList={}
|
||||||
|
local hero={tag="5星神将UP",name=config.ReadingName,value=num,Color=1}
|
||||||
|
|
||||||
|
--local aaa=ConfigManager.GetConfigData(ConfigName.WishActivityPool,2)
|
||||||
|
--LogError("aaa==="..aaa.GetRate)
|
||||||
|
for key, value in ConfigPairs(pool) do
|
||||||
|
local id=value.ItemId[1]
|
||||||
|
local itemConfig=ConfigManager.TryGetConfigData(ConfigName.ItemConfig,id)
|
||||||
|
local data={tag=itemConfig.Name,name=value.ItemId[2],value=value.GetRate,Color=0}
|
||||||
|
table.insert(rateList,data)
|
||||||
|
end
|
||||||
|
table.sort(rateList,function(a,b)
|
||||||
|
return a.value>b.value
|
||||||
|
end)
|
||||||
|
table.insert(rateList,1,hero)
|
||||||
|
for n,m in ipairs(rateList) do
|
||||||
|
if not this.ratePreList[n] then
|
||||||
|
this.ratePreList[n] = {}
|
||||||
|
this.ratePreList[n].go = newObjToParent(this.pre,this.grid)
|
||||||
|
this.ratePreList[n].star = Util.GetGameObject(this.ratePreList[n].go,"star"):GetComponent("Text")
|
||||||
|
this.ratePreList[n].name = Util.GetGameObject(this.ratePreList[n].go,"name"):GetComponent("Text")
|
||||||
|
this.ratePreList[n].rate = Util.GetGameObject(this.ratePreList[n].go,"rate"):GetComponent("Text")
|
||||||
|
end
|
||||||
|
this.ratePreList[n].go.gameObject:SetActive(true)
|
||||||
|
this.ratePreList[n].star.text=m.tag
|
||||||
|
if m.Color==1 then
|
||||||
|
this.ratePreList[n].star.color=Color.New(0.67, 0.25,0.32, 1)
|
||||||
|
this.ratePreList[n].name.color=Color.New(0.67, 0.25,0.32, 1)
|
||||||
|
this.ratePreList[n].rate.color=Color.New(0.67, 0.25,0.32, 1)
|
||||||
|
else
|
||||||
|
this.ratePreList[n].star.color=Color.New(0.66, 0.62,0.54, 1)
|
||||||
|
this.ratePreList[n].name.color=Color.New(0.66, 0.62,0.54, 1)
|
||||||
|
this.ratePreList[n].rate.color=Color.New(0.66, 0.62,0.54, 1)
|
||||||
|
end
|
||||||
|
this.ratePreList[n].name.text=m.name
|
||||||
|
this.ratePreList[n].rate.text=string.format("%.2f",(m.value/100000)*100).."%"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function this:BuildRateData(actType,UpItem,upItemList)
|
function this:BuildRateData(actType,UpItem,upItemList)
|
||||||
local rateList = {}
|
local rateList = {}
|
||||||
local _upRateList = {}
|
local _upRateList = {}
|
||||||
|
|
|
@ -29,7 +29,7 @@ function this:BindEvent()
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.confirmBtn,function()
|
Util.AddClick(this.confirmBtn,function()
|
||||||
NetManager.ChoiceHeroRewardRequest(args[1],currHeroId,function()
|
NetManager.ChoiceHeroRewardRequest(args[1],currHeroId,function()
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.Activity.ContinueRechargeRefresh,currHeroId)
|
Game.GlobalEvent:DispatchEvent(GameEvent.Activity.TimeLimitUpHeroChange,currHeroId)
|
||||||
parent:ClosePanel()
|
parent:ClosePanel()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue