From 5741d68dd3dca6a4f2a6811190c4a86fbe252e3d Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 4 Aug 2022 16:40:37 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=81=B5=E5=85=BD=E5=AE=9D=E9=98=81]=3D=3D=3D?= =?UTF-8?q?=3D=3D=E6=B7=BB=E5=8A=A0=E5=A6=96=E6=99=B6=E5=8F=AC=E5=94=A4?= =?UTF-8?q?=E4=B8=8A=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/DynamicActivity/LingShouBaoGe.lua | 44 ++++++++++++------- .../LingShouBaoGeOneResultPanel.lua | 7 ++- .../LingShouBaoGeTenResultPanel.lua | 22 +++++++--- 3 files changed, 49 insertions(+), 24 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGe.lua b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGe.lua index 117826ddd7..077229953c 100644 --- a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGe.lua +++ b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGe.lua @@ -185,13 +185,17 @@ function LingShouBaoGe:SetData() end end - +local maxMoneyId function LingShouBaoGe:refreshBtnShow() --下方的数量显示 - local maxtimesId=lotterySetting[self.singleRecruit.Id].MaxTimes - local curTimes=PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId) - self.upper.text = Language[10483]..curTimes.."/"..privilegeConfig[maxtimesId].Condition[1][2]--召唤上限 - + local maxtimesId=lotterySetting[self.singleRecruit.Id].MoneyTimes + maxMoneyId=lotterySetting[self.singleRecruit.Id].MoneyTimes + -- local curTimes=PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId) + local curTimes=PrivilegeManager.GetPrivilegeRemainValue(maxtimesId) + self.upper.text ="今日妖晶召唤上限"..curTimes.."/"..privilegeConfig[maxtimesId].Condition[1][2]--召唤上限 + --if curTimes==0 then + maxtimesId=lotterySetting[self.singleRecruit.Id].MaxTimes + --end --是否是免费抽 local freeTimesId=lotterySetting[self.singleRecruit.Id].FreeTimes @@ -218,8 +222,10 @@ function LingShouBaoGe:refreshBtnShow() local type = 0 type = n == bType.Btn1 and self.singleRecruit.Id or self.tenRecruit.Id - local d = RecruitManager.GetExpendData(type) - + local str=n == bType.Btn1 and self.singleRecruit.CostItem or self.tenRecruit.CostItem + --local d = RecruitManager.GetExpendData(type) + local d = RecruitManager.GetExpendDataByCostItem(str,n,curTimes) + local payId=0 if isFree then info.text=" "..Language[10493] else @@ -228,18 +234,22 @@ function LingShouBaoGe:refreshBtnShow() icon.sprite = self.spLoader:LoadSprite(artResourcesConfig[itemConfig[itemId].ResourceID].Name) info.text = m.isInfo num.text = itemNum + if itemId==16 then + payId=maxMoneyId + else + payId=maxtimesId + end end - Util.AddOnceClick(btn,function() local state = PlayerPrefs.GetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.BaoGeTen) if n == bType.Btn1 then if isFree then - self:Recruit(type,maxtimesId,0,0,state,freeTimesId,{RecruitType.BaoGeSingle,RecruitType.BaoGeTen}) + self:Recruit(type,payId,0,0,state,freeTimesId,{RecruitType.BaoGeSingle,RecruitType.BaoGeTen}) else - self:Recruit(type,maxtimesId,itemId,itemNum,state,freeTimesId,{RecruitType.BaoGeSingle,RecruitType.BaoGeTen}) + self:Recruit(type,payId,itemId,itemNum,state,freeTimesId,{RecruitType.BaoGeSingle,RecruitType.BaoGeTen}) end elseif n==bType.Btn10 then - self:Recruit(type,maxtimesId,itemId,itemNum,state,freeTimesId,{RecruitType.BaoGeTen,RecruitType.BaoGeTen}) + self:Recruit(type,payId,itemId,itemNum,state,freeTimesId,{RecruitType.BaoGeTen,RecruitType.BaoGeTen}) end end) end @@ -247,11 +257,11 @@ end function LingShouBaoGe:Recruit(id,RecruitMaxtimesId,itemId,itemNum,state,freeTimesId,recruitType) local num = id%2 == 0 and 1 or 10 - --是否超过每日最大上限 - if PrivilegeManager.GetPrivilegeRemainValue(RecruitMaxtimesId) < num then - PopupTipPanel.ShowTip(Language[10485]) - return - end + -- --是否超过每日最大上限 + -- if PrivilegeManager.GetPrivilegeRemainValue(RecruitMaxtimesId) < num then + -- PopupTipPanel.ShowTip(Language[10485]) + -- return + -- end if itemId ~= 0 then if BagManager.GetItemCountById(itemId) < itemNum then PopupTipPanel.ShowTip(GetLanguageStrById(itemConfig[itemId].Name)..Language[10486]) @@ -262,7 +272,7 @@ function LingShouBaoGe:Recruit(id,RecruitMaxtimesId,itemId,itemNum,state,freeTim UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitConfirm,id, function() RecruitManager.RecruitRequest(id,function(msg) - PrivilegeManager.RefreshPrivilegeUsedTimes(RecruitMaxtimesId,num) + PrivilegeManager.RefreshPrivilegeUsedTimes(maxMoneyId,num) UIManager.OpenPanel(UIName.PokemonSingleResultPanel,id,msg.drop,self.activityId,recruitType,function () self:Refresh() end) diff --git a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGeOneResultPanel.lua b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGeOneResultPanel.lua index 4810f07235..6b61088258 100644 --- a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGeOneResultPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGeOneResultPanel.lua @@ -108,6 +108,7 @@ function LingShouBaoGeOneResultPanel:OnOpen(...) local currLottery= ConfigManager.GetConfigData(ConfigName.LotterySetting,singleRecruit.Id) freeTimesId=currLottery.FreeTimes RecruitMaxtimesId = currLottery.MaxTimes + local curTimes=PrivilegeManager.GetPrivilegeRemainValue(currLottery.MoneyTimes) local freeTime=0 if freeTimesId>0 then freeTime= PrivilegeManager.GetPrivilegeRemainValue(freeTimesId) @@ -124,10 +125,12 @@ function LingShouBaoGeOneResultPanel:OnOpen(...) this.itemIcon3.gameObject:SetActive(true) this.itemInfo3.text=Language[10490] itemId=0 - local d = RecruitManager.GetExpendData(this.recruitType) + local d = RecruitManager.GetExpendDataByCostItem(currLottery.CostItem,1,curTimes) itemId = d[1] itemNum = d[2] - + if itemId==16 then + RecruitMaxtimesId =currLottery.MoneyTimes + end this.tipText.gameObject:SetActive(false) this.itemIcon3.sprite=this.spLoader:LoadSprite(artResourcesConfig[ItemConfig[itemId].ResourceID].Name) this.itemNum3.text= "×"..itemNum diff --git a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGeTenResultPanel.lua b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGeTenResultPanel.lua index 57b17e5a26..77f50d00cc 100644 --- a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGeTenResultPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/LingShouBaoGeTenResultPanel.lua @@ -20,6 +20,7 @@ this.contentList={} this.contentListParent={} this.isElementDrawPanel=false local orginLayer +local lotteryConfig --初始化组件(用于子类重写) function LingShouBaoGeTenResultPanel:InitComponent() this.spLoader = SpriteLoader.New() @@ -48,7 +49,7 @@ function LingShouBaoGeTenResultPanel:InitComponent() end this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft, panelType = PanelType.LingShouBaoGe }) end - +local maxTimesId=0 --绑定事件(用于子类重写) function LingShouBaoGeTenResultPanel:BindEvent() @@ -57,8 +58,10 @@ function LingShouBaoGeTenResultPanel:BindEvent() self:ClosePanel() end) Util.AddClick(this.openTenAgainButton, function () - local d=RecruitManager.GetExpendData(this.recruitType) - local maxTimesId = lotterySetting[singleRecruit.Id].MaxTimes + --local d=RecruitManager.GetExpendData(this.recruitType) + local curTimes=PrivilegeManager.GetPrivilegeRemainValue(lotteryConfig.MoneyTimes) + local d=RecruitManager.GetExpendDataByCostItem(lotteryConfig.CostItem,2,curTimes) + -- maxTimesId = lotterySetting[singleRecruit.Id].MaxTimes local freeTimesId = lotterySetting[singleRecruit.Id].FreeTimes --是否超过每日最大上限 if PrivilegeManager.GetPrivilegeRemainValue(maxTimesId) < 10 then @@ -121,15 +124,24 @@ function LingShouBaoGeTenResultPanel:OnOpen(...) this.content1:SetActive(false) this.content2:SetActive(false) this.content3:SetActive(true) - local array = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotterySetting,"ActivityId",activityId) singleRecruit = array[1] tenRecruit = array[2] + lotteryConfig=lotterySetting[this.recruitType] local d - d = RecruitManager.GetExpendData(this.recruitType) + --d = RecruitManager.GetExpendData(this.recruitType) + maxTimesId=lotteryConfig.MoneyTimes + local curTimes=PrivilegeManager.GetPrivilegeRemainValue(maxTimesId) + if curTimes==0 then + maxTimesId=lotteryConfig.MaxTimes + end + d=RecruitManager.GetExpendDataByCostItem(lotteryConfig.CostItem,2,curTimes) itemId = d[1] itemNum = d[2] + if itemId~=16 then + maxTimesId=lotteryConfig.MaxTimes + end this.itemIcon3.sprite=this.spLoader:LoadSprite(artResourcesConfig[ItemConfig[itemId].ResourceID].Name) this.tipText.gameObject:SetActive(false)