心願抽卡修改提交
parent
8f3e691ba6
commit
795c3e52f0
|
@ -101,7 +101,7 @@ function this.InitActivityData()
|
|||
end
|
||||
end
|
||||
|
||||
function this.GetActivityRewardRequest(type, index)
|
||||
function this.GetActivityRewardRequest(type, index,func)
|
||||
--local rewardId=0
|
||||
--向服务器发送领取在线奖励请求
|
||||
NetManager.GetActivityRewardRequest(index, type, function(_drop)
|
||||
|
@ -140,6 +140,9 @@ function this.GetActivityRewardRequest(type, index)
|
|||
end
|
||||
--CheckRedPointStatus(RedPointType.SecretTer)
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnRefreshRedShow)
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- 获取服务器活动领取进度数据
|
||||
|
|
|
@ -108,7 +108,7 @@ local function _CompareCondition(type, condition, value)
|
|||
return true
|
||||
else
|
||||
local id = 2200 + condition+1
|
||||
LogError("condition===="..condition.." id=="..id)
|
||||
--LogError("condition===="..condition.." id=="..id)
|
||||
local isBuy = OperatingManager.IsBuyGift(id)
|
||||
if isBuy then
|
||||
LogError("已购买")
|
||||
|
|
|
@ -79,72 +79,87 @@ local sortIndex = {
|
|||
[2] = 1,
|
||||
}
|
||||
--刷新
|
||||
local actId=0
|
||||
local actconfigs
|
||||
function this.RefreshPanel(isTop,isAni)
|
||||
LogError("type============="..type)
|
||||
local configs=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.WishConfig,"LotteryType",type)
|
||||
table.sort(configs,function(a,b)
|
||||
return a.Id < b.Id
|
||||
end)
|
||||
scrollView:SetData(configs,function(index,root)
|
||||
this.SetScrollPre(root,configs[index])
|
||||
end,not isTop,not isAni)
|
||||
-- local configs=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.WishConfig,"LotteryType",type)
|
||||
-- table.sort(configs,function(a,b)
|
||||
-- return a.Id < b.Id
|
||||
-- end)
|
||||
|
||||
if type==1 then
|
||||
this.title.text = "神将心愿奖励"
|
||||
actId=11701
|
||||
elseif type==4 then
|
||||
this.title.text = "法宝心愿奖励"
|
||||
actId=11901
|
||||
end
|
||||
actconfigs=ActivityGiftManager.GetActivityInfoByType(actId)
|
||||
--LogError("len================="..#actconfigs)
|
||||
table.sort(actconfigs.mission,function(a,b)
|
||||
return a.missionId < b.missionId
|
||||
end)
|
||||
scrollView:SetData(actconfigs.mission,function(index,root)
|
||||
this.SetScrollPre(root,actconfigs.mission[index])
|
||||
end,not isTop,not isAni)
|
||||
|
||||
|
||||
end
|
||||
|
||||
--设置每条数据
|
||||
function this.SetScrollPre(root,data)
|
||||
local wishData=ConfigManager.GetConfigData(ConfigName.WishConfig, data.missionId)
|
||||
local info=Util.GetGameObject(root,"Title/Info"):GetComponent("Text")
|
||||
local grid=Util.GetGameObject(root,"Grid")
|
||||
local goBtn=Util.GetGameObject(root,"GoBtn")
|
||||
local getBtn=Util.GetGameObject(root,"GetBtn")
|
||||
local goText=Util.GetGameObject(root,"GetBtn/Text"):GetComponent("Text")
|
||||
goBtn:SetActive(false)
|
||||
getBtn:SetActive(false)
|
||||
local mask=Util.GetGameObject(root,"mask")
|
||||
info.text="宝箱"..data.Level.."级奖励"
|
||||
info.text="宝箱"..wishData.Level.."级奖励,心愿概率提升为"..wishData.Weight/100 .."%"
|
||||
if not itemList[root] then
|
||||
itemList[root] = {}
|
||||
end
|
||||
for k,v in ipairs(itemList[root]) do
|
||||
v.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1 , #data.Reward do
|
||||
for i = 1 , #wishData.Reward do
|
||||
if not itemList[root][i] then
|
||||
itemList[root][i] = SubUIManager.Open(SubUIConfig.ItemView,grid.transform)
|
||||
itemList[root][i].gameObject:SetActive(false)
|
||||
end
|
||||
itemList[root][i]:OnOpen(false, data.Reward[i], 0.9,false,false,false,sortingOrder)
|
||||
itemList[root][i]:OnOpen(false, wishData.Reward[i], 0.9,false,false,false,sortingOrder)
|
||||
itemList[root][i].gameObject:SetActive(true)
|
||||
end
|
||||
-- if data.state==0 then
|
||||
-- -- goText.text="已领取"
|
||||
-- mask:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_slbz_yilingqu_zh")
|
||||
-- mask:SetActive(true)
|
||||
-- goBtn:SetActive(false)
|
||||
-- getBtn:SetActive(false)
|
||||
-- elseif data.state==1 then
|
||||
-- -- goText.text="领取"
|
||||
-- mask:SetActive(false)
|
||||
-- goBtn:SetActive(false)
|
||||
-- getBtn:SetActive(true)
|
||||
-- elseif data.state==2 then
|
||||
-- -- goText.text="前往"
|
||||
-- mask:SetActive(false)
|
||||
-- goBtn:SetActive(true)
|
||||
-- getBtn:SetActive(false)
|
||||
-- end
|
||||
if data.state==1 then
|
||||
goText.text="已领取"
|
||||
mask:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_slbz_yilingqu_zh")
|
||||
mask:SetActive(true)
|
||||
goBtn:SetActive(false)
|
||||
getBtn:SetActive(false)
|
||||
else
|
||||
if RecruitManager.drawTimes[type]>=wishData.DrawCardNumber then
|
||||
goText.text="领取"
|
||||
mask:SetActive(false)
|
||||
goBtn:SetActive(false)
|
||||
getBtn:SetActive(true)
|
||||
else
|
||||
goText.text="前往"
|
||||
mask:SetActive(false)
|
||||
goBtn:SetActive(true)
|
||||
getBtn:SetActive(false)
|
||||
end
|
||||
end
|
||||
|
||||
-- Util.AddOnceClick(goBtn,function()
|
||||
-- this:ClosePanel()
|
||||
Util.AddOnceClick(goBtn,function()
|
||||
this:ClosePanel()
|
||||
-- if data.jump and data.jump > 0 then
|
||||
-- JumpManager.GoJump(data.jump)
|
||||
-- end
|
||||
-- end)
|
||||
-- Util.AddOnceClick(getBtn,function()
|
||||
end)
|
||||
Util.AddOnceClick(getBtn,function()
|
||||
-- if getFunc then
|
||||
-- getFunc(data.Id,function()
|
||||
-- mask:SetActive(true)
|
||||
|
@ -153,9 +168,16 @@ function this.SetScrollPre(root,data)
|
|||
-- this.RefreshPanel(false,false)
|
||||
-- end)
|
||||
-- end
|
||||
-- end)
|
||||
ActivityGiftManager.GetActivityRewardRequest(actId,data.missionId,function()
|
||||
mask:SetActive(true)
|
||||
getBtn:SetActive(false)
|
||||
this.ChangeState(data.missionId)
|
||||
this.RefreshPanel(false,false)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
--设置每条数据
|
||||
function this.SetScrollPre2(root,data)
|
||||
local info=Util.GetGameObject(root,"Title/Info"):GetComponent("Text")
|
||||
|
@ -186,8 +208,8 @@ function this.SetScrollPre2(root,data)
|
|||
end
|
||||
|
||||
function this.ChangeState(id)
|
||||
for k,v in ipairs(rewardConfig) do
|
||||
if v.Id == id then
|
||||
for k,v in ipairs(actconfigs) do
|
||||
if v.missionId == id then
|
||||
v.state = 0
|
||||
return
|
||||
end
|
||||
|
|
|
@ -100,12 +100,13 @@ function RecruitEquipPanelNew:BindEvent()
|
|||
Util.AddClick(self.boxBtn,function()
|
||||
--UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitBox)
|
||||
--self.UI_effect_RecruitPanel_box_normal:SetActive(true)
|
||||
if RecruitManager.isCanOpenBox then
|
||||
LogError("getid=========="..getId)
|
||||
ActivityGiftManager.GetActivityRewardRequest(11901,getId)
|
||||
else
|
||||
-- if RecruitManager.isCanOpenBox then
|
||||
-- LogError("getid=========="..getId)
|
||||
-- ActivityGiftManager.GetActivityRewardRequest(11901,getId)
|
||||
-- else
|
||||
-- UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[1][1])
|
||||
-- end
|
||||
UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[1][1])
|
||||
end
|
||||
end)
|
||||
--奖池预览按钮
|
||||
Util.AddClick(self.previewBtn, function()
|
||||
|
@ -174,7 +175,7 @@ function RecruitEquipPanelNew:UpdataPanel()
|
|||
end
|
||||
end
|
||||
|
||||
LogError("progress==============="..progresss)
|
||||
--LogError("progress==============="..progresss)
|
||||
|
||||
for i, v in ConfigPairs(wishConfig) do
|
||||
if RecruitManager.drawTimes[4] and RecruitManager.drawTimes[4]>= v.DrawCardNumber and v.LotteryType==4 then
|
||||
|
|
|
@ -100,12 +100,13 @@ function RecruitPanelNew:BindEvent()
|
|||
Util.AddClick(self.boxBtn,function()
|
||||
--UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitBox)
|
||||
--self.UI_effect_RecruitPanel_box_normal:SetActive(true)
|
||||
if RecruitManager.isCanOpenBox then
|
||||
LogError("getid=========="..getId)
|
||||
ActivityGiftManager.GetActivityRewardRequest(11701,getId)
|
||||
else
|
||||
-- if RecruitManager.isCanOpenBox then
|
||||
-- LogError("getid=========="..getId)
|
||||
-- ActivityGiftManager.GetActivityRewardRequest(11701,getId)
|
||||
-- else
|
||||
-- UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[4][1])
|
||||
-- end
|
||||
UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[4][1])
|
||||
end
|
||||
end)
|
||||
--奖池预览按钮
|
||||
Util.AddClick(self.previewBtn, function()
|
||||
|
@ -180,10 +181,11 @@ function RecruitPanelNew:UpdataPanel()
|
|||
self.title.sprite = self.spLoader:LoadSprite(self.config.Icon[5])
|
||||
--宝箱活动数据
|
||||
local actconfigs=ActivityGiftManager.GetActivityInfoByType(11701)
|
||||
--LogError("actconfigs len=================="..#actconfigs)
|
||||
for i = 1,#actconfigs.mission do
|
||||
progresss=actconfigs.mission[i].progress
|
||||
end
|
||||
LogError("progress==============="..progresss)
|
||||
--LogError("progress==============="..progresss)
|
||||
|
||||
for i, v in ConfigPairs(wishConfig) do
|
||||
if RecruitManager.drawTimes[1] and RecruitManager.drawTimes[1]>= v.DrawCardNumber and v.LotteryType==1 then
|
||||
|
@ -280,7 +282,7 @@ end
|
|||
|
||||
function RecruitPanelNew:UpdataBoxReward()
|
||||
--local num = BagManager.GetItemCountById(self.XianZhaoConfig.CostItem[1][1])
|
||||
LogError("更新宝箱显示s")
|
||||
--LogError("更新宝箱显示s")
|
||||
local actconfigs=ActivityGiftManager.GetActivityInfoByType(11701)
|
||||
RecruitManager.isCanOpenBox=false
|
||||
for i = 1,#actconfigs.mission do
|
||||
|
|
Loading…
Reference in New Issue