From 795c3e52f0d5338093cc56c5dfffc059dfca1940 Mon Sep 17 00:00:00 2001 From: "PC-202302260912\\Administrator" <1545929779@qq.com> Date: Tue, 13 Jun 2023 18:46:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=83=E9=A1=98=E6=8A=BD=E5=8D=A1=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActivityGift/ActivityGiftManager.lua | 5 +- .../~Lua/Modules/Player/PrivilegeManager.lua | 2 +- .../Modules/Popup/WishHeroRewardPopup.lua | 112 +++++++++++------- .../Modules/Recruit/RecruitEquipPanelNew.lua | 15 +-- .../~Lua/Modules/Recruit/RecruitPanelNew.lua | 18 +-- 5 files changed, 90 insertions(+), 62 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua index 000a259c99..b203ab7f32 100644 --- a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua @@ -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 -- 获取服务器活动领取进度数据 diff --git a/Assets/ManagedResources/~Lua/Modules/Player/PrivilegeManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/PrivilegeManager.lua index 2b9c05f168..a6205fda67 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/PrivilegeManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/PrivilegeManager.lua @@ -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("已购买") diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/WishHeroRewardPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/WishHeroRewardPopup.lua index 8b9c579c1c..3fe8cb5e17 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/WishHeroRewardPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/WishHeroRewardPopup.lua @@ -79,83 +79,105 @@ 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() - -- if data.jump and data.jump > 0 then - -- JumpManager.GoJump(data.jump) - -- end - -- end) - -- Util.AddOnceClick(getBtn,function() - -- if getFunc then - -- getFunc(data.Id,function() - -- mask:SetActive(true) - -- getBtn:SetActive(false) - -- this.ChangeState(data.Id) - -- this.RefreshPanel(false,false) - -- end) - -- end - -- end) + Util.AddOnceClick(goBtn,function() + this:ClosePanel() + -- if data.jump and data.jump > 0 then + -- JumpManager.GoJump(data.jump) + -- end + end) + Util.AddOnceClick(getBtn,function() + -- if getFunc then + -- getFunc(data.Id,function() + -- mask:SetActive(true) + -- getBtn:SetActive(false) + -- this.ChangeState(data.Id) + -- this.RefreshPanel(false,false) + -- 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 diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitEquipPanelNew.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitEquipPanelNew.lua index 941ddf1fd0..b71d30a91a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitEquipPanelNew.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitEquipPanelNew.lua @@ -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 - UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[1][1]) - end + -- 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) --奖池预览按钮 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 diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitPanelNew.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitPanelNew.lua index df7763d2c6..082b75a24f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitPanelNew.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitPanelNew.lua @@ -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 - UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[4][1]) - end + -- 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) --奖池预览按钮 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