[限时祈愿活动]======修改bug提交

dev_chengFeng
wangzhenxing 2021-05-29 15:35:52 +08:00
parent ee90abf1b4
commit 574d95b607
9 changed files with 75 additions and 56 deletions

View File

@ -7725,9 +7725,9 @@ RectTransform:
m_Father: {fileID: 7816124763777208762}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 448.4, y: 749.7}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -88, y: -210.29999}
m_SizeDelta: {x: 128, y: 126}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5589450041689530360
@ -8419,7 +8419,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -48, y: -473.59998}
m_AnchoredPosition: {x: -88, y: -473.59998}
m_SizeDelta: {x: 71.599976, y: 69.92993}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7359118887627014995

View File

@ -437,8 +437,8 @@ SubUIConfig = {
[14] = {name = "ExChangePage",assetName = "ExChangePage",script = "Modules/NewActivity/ExChangePage"},--限时兑换界面预设
[15] = {name = "page2",assetName = "page2",script = "Modules/DynamicActivity/SheJiDaDian"}, --社稷大典
[16] = {name = "TimeLimitUpHero",assetName = "TimeLimitUpHero",script = "Modules/DynamicActivity/TimeLimitUpHero"}, --限时召唤
--[16] = {name = "page3",assetName = "page3",script = "Modules/DynamicActivity/TimeLimitedCall"}, --限时召唤
--[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"},--乾坤宝盒
[18] = {name = "page9",assetName = "page9",script = "Modules/DynamicActivity/YiJingBaoKu"},--易经宝库
[19] = {name = "page10",assetName = "page10",script = "Modules/DynamicActivity/ShengYiTianJiang"},--神衣天降
@ -449,5 +449,5 @@ SubUIConfig = {
[24] = { name = "ShopView", assetName = "ShopView", script = "View/ShopViewNew" },
[25] = { name = "FuXingGaoZhaoPanel", assetName = "FuXingGaoZhaoPanel", script = "Modules/FuXingGaoZhao/FuXingGaoZhaoPanel" },
[26] = { name = "NiuQiChongTianPanel", assetName = "NiuQiChongTianPanel", script = "Modules/NiuQiChongTian/NiuQiChongTianPanel" },
--[27] = {name = "TimeLimitUpHero",assetName = "TimeLimitUpHero",script = "Modules/DynamicActivity/TimeLimitUpHero"}, --限时英雄up界面
[27] = {name = "TimeLimitUpHero",assetName = "TimeLimitUpHero",script = "Modules/DynamicActivity/TimeLimitUpHero"}, --限时英雄up界面
}

View File

@ -132,7 +132,8 @@ function QianKunBoxBuyOnePanel:OnOpen(...)
local wish=ConfigManager.GetConfigData(ConfigName.WishActivitySetting,1)
if wish then
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.TimelimitCall })
d = RecruitManager.GetExpendDataByCostItem(wish.CostItemSingle)
local num=PrivilegeManager.GetPrivilegeRemainValue(wish.DiamondMaxTimes)
d = RecruitManager.GetExpendDataByCostItem(wish.CostItemSingle,1,num)
isLimitUpHero=true
end
else

View File

@ -24,7 +24,7 @@ local isLimitUpHero=false
--初始化组件(用于子类重写)
function QianKunBoxBuyTenPanel:InitComponent()
this.spLoader = SpriteLoader.New()
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft, panelType = PanelType.ElementDrawCard })
orginLayer = 0
self.bg = Util.GetGameObject(self.gameObject, "effect")
screenAdapte(self.bg)
@ -44,7 +44,7 @@ function QianKunBoxBuyTenPanel:InitComponent()
this.detailImage3=Util.GetGameObject(this.content3, "Tip")
this.itemIcon3=Util.GetGameObject(this.content3, "icon"):GetComponent("Image")
this.itemNum3=Util.GetGameObject(this.content3, "num"):GetComponent("Text")
this.itemInfo3=Util.GetGameObject(this.content3, "info"):GetComponent("Text")
this.content2=Util.GetGameObject(self.gameObject,"bottom/openTenAgainButton/Content2")
this.itemIcon2=Util.GetGameObject(this.content2,"Icon"):GetComponent("Image")
this.itemNum2=Util.GetGameObject(this.content2,"Num"):GetComponent("Text")
@ -143,15 +143,19 @@ function QianKunBoxBuyTenPanel:OnOpen(...)
local itemId=0
local itemNum=0
local d
local upConfig=ConfigManager.GetConfigDataByKey(ConfigName.WishActivityUp,"ActivityId",this.recruitType)
local upConfig=ConfigManager.TryGetConfigDataByKey(ConfigName.WishActivityUp,"ActivityId",this.recruitType)
if upConfig then
local wish=ConfigManager.GetConfigData(ConfigName.WishActivitySetting,1)
if wish then
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.TimelimitCall })
isLimitUpHero=true
d = RecruitManager.GetExpendDataByCostItem(wish.CostItemMul)
this.itemInfo3.text="10次"
local num=PrivilegeManager.GetPrivilegeRemainValue(wish.DiamondMaxTimes)
d = RecruitManager.GetExpendDataByCostItem(wish.CostItemMul,2,num)
end
else
d = RecruitManager.GetExpendData(this.recruitType)
SubUIManager.Close(this.UpView)
end
itemId=d[1]
itemNum=d[2]
@ -211,6 +215,7 @@ end
--界面销毁时调用(用于子类重写)
function QianKunBoxBuyTenPanel:OnDestroy()
this.spLoader:Destroy()
SubUIManager.Close(this.UpView)
this.views = nil
end

View File

@ -23,6 +23,7 @@ local Setting=nil
local oneFunc=nil
local tenFunc=nil
local oneFunc2=nil
local isYaojing=false
--初始化组件(用于子类重写)
function TimeLimitUpHero:InitComponent()
self.spLoader = SpriteLoader.New()
@ -80,6 +81,7 @@ function TimeLimitUpHero:InitComponent()
local SkeletonGraphic = heroLiveObj:GetComponent("SkeletonGraphic")
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
end)
end
--绑定事件(用于子类重写)
@ -141,7 +143,6 @@ function TimeLimitUpHero:OnShow(_sortingOrder)
for k,v in ipairs(self.bgs) do
v.bg.gameObject:SetActive(false)
end
LogError("actId "..self.actId)
wishConfig=ConfigManager.GetConfigDataByKey(ConfigName.WishActivityUp,"ActivityId",self.actId)
self.titleImg.sprite=self.spLoader:LoadSprite(self.actConfig.Icon[3])
Setting= ConfigManager.GetConfigData(ConfigName.WishActivitySetting,1)
@ -150,6 +151,8 @@ function TimeLimitUpHero:OnShow(_sortingOrder)
self.yaojingMaxTimeId =Setting.DiamondMaxTimes
activityData=ActivityGiftManager.GetActivityInfoByType(self.actId)
curHeroId=activityData.choiceRewardId
local curTimes = PrivilegeManager.GetPrivilegeUsedTimes(self.maxtimesId)
self.upper.text= "今日召唤上限:"..curTimes.."/"..privilegeConfig[self.maxtimesId].Condition[1][2]--特权上限
LogError("活动数据英雄id "..activityData.choiceRewardId)
self:RefreshHeroData()
self:RefreshGetHeroTimes()
@ -166,25 +169,22 @@ function TimeLimitUpHero:RefreshHeroData()
poolManager:UnLoadLive(lastLiveName, heroLiveObj)
end
lastLiveName=GetResourcePath(curConfig.Live)
LogError("lastLiveName=="..lastLiveName)
heroLiveObj=HeroManager.LoadHerolive1(curConfig,self.heroPar)
end
local isYaojing=false
local freeTime = 0
--刷新剩余次数
function TimeLimitUpHero:RefreshGetHeroTimes()
local curTimes = PrivilegeManager.GetPrivilegeUsedTimes(self.maxtimesId)
self.upper.text= "今日召唤上限:"..curTimes.."/"..privilegeConfig[self.maxtimesId].Condition[1][2]--特权上限
self.timeupdate.gameObject:SetActive(true)
if self.freeTimesId and self.freeTimesId > 0 then
freeTime = PrivilegeManager.GetPrivilegeRemainValue(self.freeTimesId)
LogError("self freetimes "..freeTime)
RecruitManager.freeUseTimeList[self.freeTimesId]=freeTime
end
--按钮赋值
local num=PrivilegeManager.GetPrivilegeRemainValue(Setting.DiamondMaxTimes)
self.recruitTimesUpdate.text = string.format("今日剩余妖晶召唤次数:<color=#F27D0F>%s</color>",num)
for n, m in ipairs(self.btns) do
--存在免费次数 并且 免费>=1 并且是1按钮
local isFree = freeTime >= 1 and n == 1
@ -206,7 +206,7 @@ function TimeLimitUpHero:RefreshGetHeroTimes()
self.timeupdate.gameObject:SetActive(false)
m.info.text="免费抽取"
else
local d = RecruitManager.GetExpendDataByCostItem(type)
local d = RecruitManager.GetExpendDataByCostItem(type,n,num)
itemId=d[1]
if itemId==16 then
isYaojing=true
@ -216,8 +216,12 @@ function TimeLimitUpHero:RefreshGetHeroTimes()
m.num.text= tostring(itemNum)
end
local sureFunc=function()
local isFree = PrivilegeManager.GetPrivilegeRemainValue(self.freeTimesId)>= 1 and n == 1
if not isFree then
if BagManager.GetItemCountById(itemId)<itemNum then
local count=PrivilegeManager.GetPrivilegeRemainValue(Setting.DiamondMaxTimes)
local d = RecruitManager.GetExpendDataByCostItem(type,n,count)
itemId=d[1]
if BagManager.GetItemCountById(itemId)<d[2] then
PopupTipPanel.ShowTip(itemConfig[itemId].Name.."数量不足!")
return
end
@ -227,10 +231,10 @@ function TimeLimitUpHero:RefreshGetHeroTimes()
local recrutNum = n == 1 and 1 or 10
if state==0 and itemId == 16 and not isFree then
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitConfirm,"timeLimitHero",function()
self:Recruit(self.actId,n)
self:Recruit(self.actId,n,itemId)
end,n)
else
self:Recruit(self.actId,n)
self:Recruit(self.actId,n,itemId)
end
end
if n==1 then
@ -241,8 +245,6 @@ function TimeLimitUpHero:RefreshGetHeroTimes()
end
Util.AddOnceClick(m.btn,sureFunc)
end
local reMaintimes = ActivityGiftManager.GetActivityValueInfo(self.actId)
local totalTimes = 0
for i = 1, #wishConfig.UpList do
@ -255,12 +257,10 @@ function TimeLimitUpHero:RefreshGetHeroTimes()
reMaintimes = totalTimes
end
local num=PrivilegeManager.GetPrivilegeRemainValue(Setting.DiamondMaxTimes)
self.recruitTimesUpdate.text = string.format("今日剩余妖晶召唤次数:<color=#F27D0F>%s</color>",num)
self.callTimeTxt.text=reMaintimes
end
function TimeLimitUpHero:Recruit(actId,type)
function TimeLimitUpHero:Recruit(actId,type,itemId)
local recrutType =type==1 and 1 or 10
if PrivilegeManager.GetPrivilegeUsedTimes(self.maxtimesId)+recrutType>privilegeConfig[self.maxtimesId].Condition[1][2] then
PopupTipPanel.ShowTip("无法超出每日召唤次数上限!")
@ -271,29 +271,20 @@ function TimeLimitUpHero:Recruit(actId,type)
PrivilegeManager.RefreshPrivilegeUsedTimes(self.freeTimesId,recrutType)--记录抽卡次数
end
PrivilegeManager.RefreshPrivilegeUsedTimes(self.maxtimesId,recrutType)--记录抽卡次数
-- if then
-- freeTime = PrivilegeManager.GetPrivilegeRemainValue(self.freeTimesId)
-- end
--记录妖晶抽卡
if isYaojing then
if itemId==16 then
LogError("记录妖晶次数")
PrivilegeManager.RefreshPrivilegeUsedTimes(self.yaojingMaxTimeId,recrutType)--记录妖晶抽卡次数
end
if type == 1 then
LogError("len=="..LengthOfTable(msg.drop.Hero))
local data=msg.drop.Hero
if oneFunc then
LogError(" one func ==")
end
UIManager.OpenPanel(UIName.QianKunBoxBuyOnePanel, msg.drop,actId,{RecruitType.PrayerSingle,RecruitType.PrayerTen},oneFunc)
else
--UIManager.OpenPanel(UIName.SingleRecruitPanel, msg.drop.Hero,actId,type,{RecruitType.TimeLimitSingle,RecruitType.TimeLimitTen})
UIManager.OpenPanel(UIName.QianKunBoxBuyTenPanel, msg.drop,actId,{RecruitType.PrayerSingle,RecruitType.PrayerTen},tenFunc)
end
if msg.drop.Hero[1] then
if not oneFunc then
LogError(" one func ==nil")
end
UIManager.OpenPanel(UIName.SingleRecruitPanel, msg.drop.Hero[1],actId,1,{RecruitType.TimeLimitSingle,RecruitType.TimeLimitTen},oneFunc2)
end
CheckRedPointStatus(RedPointType.TimeLimited)

View File

@ -63,12 +63,13 @@ function this:OnShow(_parent,...)
this.rootText.text = string.format(Language[11595],_args[3])
elseif _args[1] =="timeLimitHero" then
local wishSettingConfig=ConfigManager.GetConfigData(ConfigName.WishActivitySetting,1)
local num=PrivilegeManager.GetPrivilegeRemainValue(wishSettingConfig.DiamondMaxTimes)
var = PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.PrayerTen
local d = 0
if _args[3]==1 then
d=RecruitManager.GetExpendDataByCostItem(wishSettingConfig.CostItemSingle)
d=RecruitManager.GetExpendDataByCostItem(wishSettingConfig.CostItemSingle,1,num)
elseif _args[3]==2 then
d=RecruitManager.GetExpendDataByCostItem(wishSettingConfig.CostItemMul)
d=RecruitManager.GetExpendDataByCostItem(wishSettingConfig.CostItemMul,2,num)
end
if _args[3] == 1 then

View File

@ -327,22 +327,35 @@ function this.GetExpendData(type)
return d
end
function this.GetExpendDataByCostItem(str)
function this.GetExpendDataByCostItem(str,type,LimitNum)
local d
local k=0
for i, v in ipairs(str) do
if BagManager.GetItemCountById(v[1])>=v[2] then
d=v
break
local needNum= 0
if type==1 then
needNum=1
else
needNum=10
end
local cost=nil
for key, value in pairs(str) do
local bagNum=BagManager.GetItemCountById(value[1])
--不是妖晶 背包数量>=需要数量
if value[1]~=16 then
if bagNum>=needNum then
return value
else
cost=value
end
cost=value
else
k=k+1
--如果是妖晶 背包有足够妖晶 能抽的次数>=抽的次数
if bagNum>=needNum and LimitNum>=needNum then
return value
end
end
end
local l=#str
if k==l then
return str[l]
end
return d
return cost
end

View File

@ -156,6 +156,9 @@ function SingleRecruitPanel:BindEvent()
if state==1 then
this.goBtn:SetActive(false)
this.againBtn:SetActive(true)
if recruitType and recruitType[1]==RecruitType.PrayerSingle then
this.againBtn:SetActive(false)
end
this.sureBtn:SetActive(true)
this.info:SetActive(false)
elseif state==2 then
@ -399,7 +402,8 @@ function SingleRecruitPanel:UpdataPanelData(_heroData)
SetTextVerTial(self.posText.gameObject,Vector3.New(63.76,1.5,0),"MiddleLeft")
local d=nil
if recruitType and recruitType[1]==RecruitType.PrayerSingle then
d=RecruitManager.GetExpendDataByCostItem(wishSettingConfig[1].CostItemSingle)
local num=PrivilegeManager.GetPrivilegeRemainValue(wishSettingConfig[1].DiamondMaxTimes)
d=RecruitManager.GetExpendDataByCostItem(wishSettingConfig[1].CostItemSingle,1,num)
else
d=RecruitManager.GetExpendData(type)
end
@ -419,6 +423,9 @@ function SingleRecruitPanel:UpdataPanelData(_heroData)
this.goBtn:SetActive(heroStaticData.Star == 5 or heroStaticData.Star == 4)
this.sureBtn:SetActive(heroStaticData.Star ~= 5 and heroStaticData.Star ~= 4)
this.againBtn:SetActive(heroStaticData.Star ~= 5 and heroStaticData.Star ~= 4)
if recruitType and recruitType[1]==RecruitType.PrayerSingle then
this.againBtn:SetActive(false)
end
Util.GetGameObject(self.transform, "rolePanel/rolePanel2"):SetActive(true)
if heroStaticData.Quality == 5 and heroStaticData.Natural >= 13 then
HeroManager.DetectionOpenFiveStarActivity(heroStaticData.Star)

View File

@ -114,7 +114,8 @@ function TenRecruitPanel:OnOpen(...)
local config=ConfigManager.TryGetConfigDataByKey(ConfigName.WishActivityUp,"ActivityId",type)
if config then
local Setting= ConfigManager.GetConfigData(ConfigName.WishActivitySetting,1)
d=RecruitManager.GetExpendDataByCostItem(Setting.CostItemMul)
local num=PrivilegeManager.GetPrivilegeRemainValue(Setting.DiamondMaxTimes)
d=RecruitManager.GetExpendDataByCostItem(Setting.CostItemMul,2,num)
else
d=RecruitManager.GetExpendData(type)
end