心願抽卡修改提交

dev_chengFeng
PC-202302260912\Administrator 2023-06-13 18:46:34 +08:00
parent 8f3e691ba6
commit 795c3e52f0
5 changed files with 90 additions and 62 deletions

View File

@ -101,7 +101,7 @@ function this.InitActivityData()
end end
end end
function this.GetActivityRewardRequest(type, index) function this.GetActivityRewardRequest(type, index,func)
--local rewardId=0 --local rewardId=0
--向服务器发送领取在线奖励请求 --向服务器发送领取在线奖励请求
NetManager.GetActivityRewardRequest(index, type, function(_drop) NetManager.GetActivityRewardRequest(index, type, function(_drop)
@ -140,6 +140,9 @@ function this.GetActivityRewardRequest(type, index)
end end
--CheckRedPointStatus(RedPointType.SecretTer) --CheckRedPointStatus(RedPointType.SecretTer)
Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnRefreshRedShow) Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnRefreshRedShow)
if func then
func()
end
end) end)
end end
-- 获取服务器活动领取进度数据 -- 获取服务器活动领取进度数据

View File

@ -108,7 +108,7 @@ local function _CompareCondition(type, condition, value)
return true return true
else else
local id = 2200 + condition+1 local id = 2200 + condition+1
LogError("condition===="..condition.." id=="..id) --LogError("condition===="..condition.." id=="..id)
local isBuy = OperatingManager.IsBuyGift(id) local isBuy = OperatingManager.IsBuyGift(id)
if isBuy then if isBuy then
LogError("已购买") LogError("已购买")

View File

@ -79,83 +79,105 @@ local sortIndex = {
[2] = 1, [2] = 1,
} }
--刷新 --刷新
local actId=0
local actconfigs
function this.RefreshPanel(isTop,isAni) function this.RefreshPanel(isTop,isAni)
LogError("type============="..type) LogError("type============="..type)
local configs=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.WishConfig,"LotteryType",type) -- local configs=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.WishConfig,"LotteryType",type)
table.sort(configs,function(a,b) -- table.sort(configs,function(a,b)
return a.Id < b.Id -- return a.Id < b.Id
end) -- end)
scrollView:SetData(configs,function(index,root)
this.SetScrollPre(root,configs[index])
end,not isTop,not isAni)
if type==1 then if type==1 then
this.title.text = "神将心愿奖励" this.title.text = "神将心愿奖励"
actId=11701
elseif type==4 then elseif type==4 then
this.title.text = "法宝心愿奖励" this.title.text = "法宝心愿奖励"
actId=11901
end 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 end
--设置每条数据 --设置每条数据
function this.SetScrollPre(root,data) function this.SetScrollPre(root,data)
local wishData=ConfigManager.GetConfigData(ConfigName.WishConfig, data.missionId)
local info=Util.GetGameObject(root,"Title/Info"):GetComponent("Text") local info=Util.GetGameObject(root,"Title/Info"):GetComponent("Text")
local grid=Util.GetGameObject(root,"Grid") local grid=Util.GetGameObject(root,"Grid")
local goBtn=Util.GetGameObject(root,"GoBtn") local goBtn=Util.GetGameObject(root,"GoBtn")
local getBtn=Util.GetGameObject(root,"GetBtn") local getBtn=Util.GetGameObject(root,"GetBtn")
local goText=Util.GetGameObject(root,"GetBtn/Text"):GetComponent("Text")
goBtn:SetActive(false) goBtn:SetActive(false)
getBtn:SetActive(false) getBtn:SetActive(false)
local mask=Util.GetGameObject(root,"mask") local mask=Util.GetGameObject(root,"mask")
info.text="宝箱"..data.Level.."级奖励" info.text="宝箱"..wishData.Level.."级奖励,心愿概率提升为"..wishData.Weight/100 .."%"
if not itemList[root] then if not itemList[root] then
itemList[root] = {} itemList[root] = {}
end end
for k,v in ipairs(itemList[root]) do for k,v in ipairs(itemList[root]) do
v.gameObject:SetActive(false) v.gameObject:SetActive(false)
end end
for i = 1 , #data.Reward do for i = 1 , #wishData.Reward do
if not itemList[root][i] then if not itemList[root][i] then
itemList[root][i] = SubUIManager.Open(SubUIConfig.ItemView,grid.transform) itemList[root][i] = SubUIManager.Open(SubUIConfig.ItemView,grid.transform)
itemList[root][i].gameObject:SetActive(false) itemList[root][i].gameObject:SetActive(false)
end 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) itemList[root][i].gameObject:SetActive(true)
end end
-- if data.state==0 then if data.state==1 then
-- -- goText.text="已领取" goText.text="已领取"
-- mask:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_slbz_yilingqu_zh") mask:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_slbz_yilingqu_zh")
-- mask:SetActive(true) mask:SetActive(true)
-- goBtn:SetActive(false) goBtn:SetActive(false)
-- getBtn:SetActive(false) getBtn:SetActive(false)
-- elseif data.state==1 then else
-- -- goText.text="领取" if RecruitManager.drawTimes[type]>=wishData.DrawCardNumber then
-- mask:SetActive(false) goText.text="领取"
-- goBtn:SetActive(false) mask:SetActive(false)
-- getBtn:SetActive(true) goBtn:SetActive(false)
-- elseif data.state==2 then getBtn:SetActive(true)
-- -- goText.text="前往" else
-- mask:SetActive(false) goText.text="前往"
-- goBtn:SetActive(true) mask:SetActive(false)
-- getBtn:SetActive(false) goBtn:SetActive(true)
-- end getBtn:SetActive(false)
end
end
-- Util.AddOnceClick(goBtn,function() Util.AddOnceClick(goBtn,function()
-- this:ClosePanel() this:ClosePanel()
-- if data.jump and data.jump > 0 then -- if data.jump and data.jump > 0 then
-- JumpManager.GoJump(data.jump) -- JumpManager.GoJump(data.jump)
-- end -- end
-- end) end)
-- Util.AddOnceClick(getBtn,function() Util.AddOnceClick(getBtn,function()
-- if getFunc then -- if getFunc then
-- getFunc(data.Id,function() -- getFunc(data.Id,function()
-- mask:SetActive(true) -- mask:SetActive(true)
-- getBtn:SetActive(false) -- getBtn:SetActive(false)
-- this.ChangeState(data.Id) -- this.ChangeState(data.Id)
-- this.RefreshPanel(false,false) -- this.RefreshPanel(false,false)
-- end) -- end)
-- 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 end
--设置每条数据 --设置每条数据
function this.SetScrollPre2(root,data) function this.SetScrollPre2(root,data)
local info=Util.GetGameObject(root,"Title/Info"):GetComponent("Text") local info=Util.GetGameObject(root,"Title/Info"):GetComponent("Text")
@ -186,8 +208,8 @@ function this.SetScrollPre2(root,data)
end end
function this.ChangeState(id) function this.ChangeState(id)
for k,v in ipairs(rewardConfig) do for k,v in ipairs(actconfigs) do
if v.Id == id then if v.missionId == id then
v.state = 0 v.state = 0
return return
end end

View File

@ -100,12 +100,13 @@ function RecruitEquipPanelNew:BindEvent()
Util.AddClick(self.boxBtn,function() Util.AddClick(self.boxBtn,function()
--UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitBox) --UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitBox)
--self.UI_effect_RecruitPanel_box_normal:SetActive(true) --self.UI_effect_RecruitPanel_box_normal:SetActive(true)
if RecruitManager.isCanOpenBox then -- if RecruitManager.isCanOpenBox then
LogError("getid=========="..getId) -- LogError("getid=========="..getId)
ActivityGiftManager.GetActivityRewardRequest(11901,getId) -- ActivityGiftManager.GetActivityRewardRequest(11901,getId)
else -- else
UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[1][1]) -- UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[1][1])
end -- end
UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[1][1])
end) end)
--奖池预览按钮 --奖池预览按钮
Util.AddClick(self.previewBtn, function() Util.AddClick(self.previewBtn, function()
@ -174,7 +175,7 @@ function RecruitEquipPanelNew:UpdataPanel()
end end
end end
LogError("progress==============="..progresss) --LogError("progress==============="..progresss)
for i, v in ConfigPairs(wishConfig) do for i, v in ConfigPairs(wishConfig) do
if RecruitManager.drawTimes[4] and RecruitManager.drawTimes[4]>= v.DrawCardNumber and v.LotteryType==4 then if RecruitManager.drawTimes[4] and RecruitManager.drawTimes[4]>= v.DrawCardNumber and v.LotteryType==4 then

View File

@ -100,12 +100,13 @@ function RecruitPanelNew:BindEvent()
Util.AddClick(self.boxBtn,function() Util.AddClick(self.boxBtn,function()
--UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitBox) --UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitBox)
--self.UI_effect_RecruitPanel_box_normal:SetActive(true) --self.UI_effect_RecruitPanel_box_normal:SetActive(true)
if RecruitManager.isCanOpenBox then -- if RecruitManager.isCanOpenBox then
LogError("getid=========="..getId) -- LogError("getid=========="..getId)
ActivityGiftManager.GetActivityRewardRequest(11701,getId) -- ActivityGiftManager.GetActivityRewardRequest(11701,getId)
else -- else
UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[4][1]) -- UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[4][1])
end -- end
UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[4][1])
end) end)
--奖池预览按钮 --奖池预览按钮
Util.AddClick(self.previewBtn, function() Util.AddClick(self.previewBtn, function()
@ -180,10 +181,11 @@ function RecruitPanelNew:UpdataPanel()
self.title.sprite = self.spLoader:LoadSprite(self.config.Icon[5]) self.title.sprite = self.spLoader:LoadSprite(self.config.Icon[5])
--宝箱活动数据 --宝箱活动数据
local actconfigs=ActivityGiftManager.GetActivityInfoByType(11701) local actconfigs=ActivityGiftManager.GetActivityInfoByType(11701)
--LogError("actconfigs len=================="..#actconfigs)
for i = 1,#actconfigs.mission do for i = 1,#actconfigs.mission do
progresss=actconfigs.mission[i].progress progresss=actconfigs.mission[i].progress
end end
LogError("progress==============="..progresss) --LogError("progress==============="..progresss)
for i, v in ConfigPairs(wishConfig) do for i, v in ConfigPairs(wishConfig) do
if RecruitManager.drawTimes[1] and RecruitManager.drawTimes[1]>= v.DrawCardNumber and v.LotteryType==1 then if RecruitManager.drawTimes[1] and RecruitManager.drawTimes[1]>= v.DrawCardNumber and v.LotteryType==1 then
@ -280,7 +282,7 @@ end
function RecruitPanelNew:UpdataBoxReward() function RecruitPanelNew:UpdataBoxReward()
--local num = BagManager.GetItemCountById(self.XianZhaoConfig.CostItem[1][1]) --local num = BagManager.GetItemCountById(self.XianZhaoConfig.CostItem[1][1])
LogError("更新宝箱显示s") --LogError("更新宝箱显示s")
local actconfigs=ActivityGiftManager.GetActivityInfoByType(11701) local actconfigs=ActivityGiftManager.GetActivityInfoByType(11701)
RecruitManager.isCanOpenBox=false RecruitManager.isCanOpenBox=false
for i = 1,#actconfigs.mission do for i = 1,#actconfigs.mission do