抽卡设置心愿修改提交
parent
71c005e068
commit
1b6b5ecdad
|
@ -144,7 +144,7 @@ function this:SetUpHero()
|
|||
else
|
||||
go:SetActive(false)
|
||||
end
|
||||
LogError("i==================="..i)
|
||||
--LogError("i==================="..i)
|
||||
if i>1 then
|
||||
self.wishListObj[i]:SetActive(false)
|
||||
LogError("false false")
|
||||
|
|
|
@ -95,7 +95,7 @@ function this:OnShow(_parent,_Data)
|
|||
if args[1] then
|
||||
self.curSelect = args[1]
|
||||
else
|
||||
self.curSelect = RecruitManager.CheckIndex()
|
||||
self.curSelect = 1 -- RecruitManager.CheckIndex()
|
||||
end
|
||||
this:Refresh(true,false)
|
||||
--end)
|
||||
|
@ -123,7 +123,10 @@ function this:SetUpHero()
|
|||
local proIcon = Util.GetGameObject(go, "proIcon"):GetComponent("Image")
|
||||
local starGrid = Util.GetGameObject(go, "star")
|
||||
local choosed = Util.GetGameObject(go, "choosed")
|
||||
local heroId = RecruitManager.WishCardData[i].heroTid
|
||||
local heroId =0
|
||||
if RecruitManager.WishEquipData[i] then
|
||||
heroId=RecruitManager.WishEquipData[i].heroTid
|
||||
end
|
||||
choosed:SetActive(false)
|
||||
if heroId > 0 then
|
||||
go:SetActive(true)
|
||||
|
@ -133,12 +136,12 @@ function this:SetUpHero()
|
|||
proIcon.gameObject:SetActive(false)
|
||||
--proIcon.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(heroData.Name))
|
||||
--SetHeroStars(self.spLoader,starGrid, heroData.Star)
|
||||
choosed:SetActive(RecruitManager.WishCardData[i].status == 1)
|
||||
choosed:SetActive(RecruitManager.WishEquipData[i].status == 1)
|
||||
Util.AddOnceClick(go,function ()
|
||||
if RecruitManager.WishCardData[i].status == 1 then
|
||||
if RecruitManager.WishEquipData[i].status == 1 then
|
||||
PopupTipPanel.ShowTip("同系神将每日只可选择一位获取一次概率提升~")
|
||||
elseif RecruitManager.WishCardData[i].status == 0 then
|
||||
RecruitManager.ChangeHero(2,heroId,function ()
|
||||
elseif RecruitManager.WishEquipData[i].status == 0 then
|
||||
RecruitManager.ChangeEquip(2,heroId,function ()
|
||||
this:Refresh(false,false)
|
||||
end)--英雄变更:1增加、2卸下
|
||||
end
|
||||
|
@ -192,7 +195,7 @@ function this:ShowSingleHero(go,data,index)
|
|||
elseif value == 1 then--上方存在自己
|
||||
self.maskList[self.curSelect][index]:SetActive(true)
|
||||
Util.AddOnceClick(go,function ()
|
||||
RecruitManager.ChangeHero(2,data,function ()
|
||||
RecruitManager.ChangeEquip(2,data,function ()
|
||||
this:Refresh(false,false)
|
||||
end)--英雄变更:1增加、2卸下
|
||||
end)
|
||||
|
@ -203,7 +206,7 @@ function this:ShowSingleHero(go,data,index)
|
|||
end)
|
||||
elseif value == 3 then--可选
|
||||
Util.AddOnceClick(go,function ()
|
||||
RecruitManager.ChangeHero(1,data,function ()
|
||||
RecruitManager.ChangeEquip(1,data,function ()
|
||||
this:Refresh(false,false)
|
||||
end)--英雄变更:1增加、2卸下
|
||||
end)
|
||||
|
|
|
@ -1062,7 +1062,7 @@ function this.WishDrawCardInfoIndication(buffer)
|
|||
local data = buffer:DataByte()
|
||||
local msg = HeroInfoProto_pb.wishDrawCardIndication()
|
||||
msg:ParseFromString(data)
|
||||
RecruitManager.GetWishCardData(msg)
|
||||
--RecruitManager.GetWishCardData(msg)
|
||||
end
|
||||
|
||||
--是否跨服推送
|
||||
|
|
|
@ -5826,8 +5826,14 @@ function NetManager.ChoiceWishHeroRequest(_type,func)
|
|||
wishData.status=0
|
||||
wishData.id=1
|
||||
local list={}
|
||||
|
||||
table.insert(list,wishData)
|
||||
RecruitManager.GetWishCardData(list)
|
||||
if _type==1 then
|
||||
RecruitManager.GetWishCardData(list)
|
||||
elseif _type==4 then
|
||||
LogError("設置心願裝備----------------------------")
|
||||
RecruitManager.SetWishTalismanData(list)
|
||||
end
|
||||
RecruitManager.newWishList = msg.newList--新增的心愿神将list
|
||||
--RecruitManager.openTime = msg.serverOpenTime--开服时间戳或是0(用于判断心愿神将是否加入卡池)
|
||||
if func then
|
||||
|
@ -5842,12 +5848,12 @@ function NetManager.DesireDrawCardRequest(_type,_id,func)
|
|||
local data = PlayerInfoProto_pb.DesireDrawCardRequest()
|
||||
data.type=_type
|
||||
data.tempId=_id
|
||||
LogError("_type==============".._type.." _id==".._id)
|
||||
--LogError("_type==============".._type.." _id==".._id)
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.DESIRE_DRAW_CARD_REQUEST, MessageTypeProto_pb.DESIRE_DRAW_CARD_RESPONSE, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = PlayerInfoProto_pb.DesireDrawCardResponse()
|
||||
LogError("设置心愿抽卡神将成功----------")
|
||||
--LogError("设置心愿抽卡神将成功----------")
|
||||
msg:ParseFromString(data)
|
||||
-- RecruitManager.GetWishCardData(msg.infoList)
|
||||
-- RecruitManager.newWishList = msg.heroList--新增的心愿神将list
|
||||
|
|
|
@ -141,6 +141,7 @@ function RecruitEquipPanelNew:OnShow(sortingOrder)
|
|||
self.sortingOrder = sortingOrder
|
||||
self:OnSortingOrderChange(sortingOrder)
|
||||
self.gameObject:SetActive(true)
|
||||
RecruitManager.curWishType=self.config.ShopData[1][1]
|
||||
self.singleConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"LotteryType",self.config.ShopData[1][1],"PerCount",1)
|
||||
self.tenConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"LotteryType",self.config.ShopData[1][1],"PerCount",10)
|
||||
self.XianZhaoConfig = ConfigManager.GetConfigDataByKey(ConfigName.LotterySetting,"LotteryType",TableRecruitType.xianyuan)
|
||||
|
@ -204,7 +205,6 @@ function RecruitEquipPanelNew:UpdataWishPanel()
|
|||
self.tenTip.gameObject:SetActive(false)
|
||||
--如果没有达到150抽按钮置灰
|
||||
local data = tonumber(specialConfig[119].Value)
|
||||
RecruitManager.curWishType=self.config.ShopData[1][1]
|
||||
NetManager.ChoiceWishHeroRequest(self.config.ShopData[1][1],function ()
|
||||
|
||||
if RecruitManager.drawTimes[4] then
|
||||
|
@ -219,8 +219,12 @@ function RecruitEquipPanelNew:UpdataWishPanel()
|
|||
self.wishNoOpen.gameObject:SetActive(false)
|
||||
self.wishOpen.gameObject:SetActive(true)
|
||||
for i = 1,1 do
|
||||
local data = RecruitManager.WishCardData[i]
|
||||
local id = data.heroTid
|
||||
local data = RecruitManager.WishEquipData[i]
|
||||
local id =0
|
||||
if data then
|
||||
id=data.heroTid
|
||||
end
|
||||
LogError("id================================"..id)
|
||||
if id > 0 then
|
||||
self.upHeroPreList[i].item.gameObject:SetActive(true)
|
||||
self.upHeroPreList[i].item:OnOpen(false, {id,0},1, false, false, false, self.sortingOrder)
|
||||
|
@ -233,6 +237,7 @@ function RecruitEquipPanelNew:UpdataWishPanel()
|
|||
Util.AddOnceClick(self.upHeroPreList[i].pos,function()
|
||||
local tempdata = tonumber(specialConfig[119].Value)
|
||||
if RecruitManager.drawTimes[4] then
|
||||
RecruitManager.curWishType=self.config.ShopData[1][1]
|
||||
if RecruitManager.drawTimes[4] >= tempdata then
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.WishEquipDraw)
|
||||
else
|
||||
|
|
|
@ -30,6 +30,7 @@ function this.Initialize()
|
|||
this.recruitFreeUseTime = 0 --现在只剩下秘盒招募在用了
|
||||
this.isTenRecruit = 0 --首次十连
|
||||
this.WishCardData = {}
|
||||
this.WishEquipData = {}
|
||||
this.wishSoulData={}
|
||||
this.isFirstEnterElementScroll=true
|
||||
this.isFirstEnterHeroScroll=true
|
||||
|
@ -535,6 +536,18 @@ function this.GetWishCardData(infoList)
|
|||
end
|
||||
end
|
||||
|
||||
function this.SetWishTalismanData(infoList)
|
||||
this.WishEquipData = {}
|
||||
for i = 1, #infoList do
|
||||
this.WishEquipData[i] = {}
|
||||
this.WishEquipData[i].id = infoList[i].id
|
||||
this.WishEquipData[i].heroTid = infoList[i].heroTid
|
||||
this.WishEquipData[i].status = infoList[i].status
|
||||
LogPink("Id:"..tostring(infoList[i].id).." heroIid:"..tostring(infoList[i].heroTid).." status:"..tostring(infoList[i].status))
|
||||
this.WishEquipData[i].PropertyName = infoList[i].heroTid > 0 and heroConfig[infoList[i].heroTid] and heroConfig[infoList[i].heroTid].PropertyName or nil
|
||||
end
|
||||
end
|
||||
|
||||
--心愿魂印
|
||||
function this.SetWishEquipData(infoList)
|
||||
this.wishSoulData={}
|
||||
|
@ -561,7 +574,7 @@ end
|
|||
|
||||
function this.GetCurHeroList(curIndex)
|
||||
local heroList = {}
|
||||
local time = (GetTimeStamp() - RecruitManager.openTime)/(60*60*24)--开服时间戳或是0(用于判断心愿神将是否加入卡池)
|
||||
local time = (GetTimeStamp() - PlayerManager.GetServerOpenTime())/(60*60*24)--开服时间戳或是0(用于判断心愿神将是否加入卡池)
|
||||
for index, v in ipairs(RecruitManager.GetRewardPreviewData(PRE_REWARD_POOL_TYPE.RECRUIT)) do
|
||||
if heroConfig[v.Reward[1]].Star == 5
|
||||
and heroConfig[v.Reward[1]].PropertyName == curIndex
|
||||
|
@ -577,7 +590,7 @@ end
|
|||
--获取当前神将法宝
|
||||
function this.GetCurHeroTalismanaList(curIndex)
|
||||
local heroList = {}
|
||||
local time = (GetTimeStamp() - RecruitManager.openTime)/(60*60*24)--开服时间戳或是0(用于判断心愿神将是否加入卡池)
|
||||
local time = (GetTimeStamp() - PlayerManager.GetServerOpenTime())/(60*60*24)--开服时间戳或是0(用于判断心愿神将是否加入卡池)
|
||||
for index, v in ipairs(RecruitManager.GetRewardPreviewData(PRE_REWARD_POOL_TYPE.RECRUIT)) do
|
||||
if heroConfig[v.Reward[1]].Star == 5
|
||||
and (curIndex==0 or heroConfig[v.Reward[1]].PropertyName == curIndex)
|
||||
|
@ -626,26 +639,26 @@ function this.CheckCurHeroState(_heroTid)
|
|||
end
|
||||
--检测当前法宝状态
|
||||
function this.CheckCurTalismanaState(_heroTid)
|
||||
for i = 1, #this.WishCardData do
|
||||
if this.WishCardData[i].heroTid == _heroTid then
|
||||
for i = 1, #this.WishEquipData do
|
||||
if this.WishEquipData[i].heroTid == _heroTid then
|
||||
--如果上方存在自己就✔
|
||||
if this.WishCardData[i].status == 0 then
|
||||
if this.WishEquipData[i].status == 0 then
|
||||
return 1
|
||||
elseif this.WishCardData[i].status == 1 then
|
||||
elseif this.WishEquipData[i].status == 1 then
|
||||
return 4
|
||||
end
|
||||
end
|
||||
end
|
||||
for i = 1, #this.WishCardData do
|
||||
if this.WishCardData[i].heroTid > 0 then
|
||||
for i = 1, #this.WishEquipData do
|
||||
if this.WishEquipData[i].heroTid > 0 then
|
||||
--如果上方存在和当前英雄相同阵营的就置灰
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
local num = 0
|
||||
for i = 1, #this.WishCardData do
|
||||
if this.WishCardData[i].heroTid > 0 then
|
||||
for i = 1, #this.WishEquipData do
|
||||
if this.WishEquipData[i].heroTid > 0 then
|
||||
num = num + 1
|
||||
end
|
||||
end
|
||||
|
@ -661,7 +674,6 @@ function this.ChangeHero(type,_heroTid,func)
|
|||
if type == 1 then --增加神将
|
||||
for i = 1, #this.WishCardData do
|
||||
if this.WishCardData[i].heroTid == 0 then
|
||||
LogError("111111111111111111111111111111111")
|
||||
this.WishCardData[i].heroTid = _heroTid
|
||||
break
|
||||
end
|
||||
|
@ -675,7 +687,7 @@ function this.ChangeHero(type,_heroTid,func)
|
|||
end
|
||||
end
|
||||
end
|
||||
LogError("RecruitManager.curWishType=="..RecruitManager.curWishType.." _heroid==".._heroTid)
|
||||
--LogError("RecruitManager.curWishType=="..RecruitManager.curWishType.." _heroid==".._heroTid)
|
||||
NetManager.DesireDrawCardRequest(RecruitManager.curWishType,_heroTid,function ()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Recruit.OnRecruitRefreshData)
|
||||
if func then
|
||||
|
@ -684,6 +696,34 @@ function this.ChangeHero(type,_heroTid,func)
|
|||
end)
|
||||
end
|
||||
|
||||
--添加和卸下法宝
|
||||
function this.ChangeEquip(type,_heroTid,func)
|
||||
if type == 1 then --增加神将
|
||||
for i = 1, #this.WishEquipData do
|
||||
if this.WishEquipData[i].heroTid == 0 then
|
||||
this.WishEquipData[i].heroTid = _heroTid
|
||||
break
|
||||
end
|
||||
end
|
||||
elseif type == 2 then --卸下神将
|
||||
for i = 1, #this.WishEquipData do
|
||||
if this.WishEquipData[i].heroTid == _heroTid then
|
||||
this.WishEquipData[i].heroTid = 0
|
||||
_heroTid=0
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
--LogError("RecruitManager.curWishType=="..RecruitManager.curWishType.." _heroid==".._heroTid)
|
||||
NetManager.DesireDrawCardRequest(RecruitManager.curWishType,_heroTid,function ()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Recruit.OnRecruitRefreshData)
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
--检查该跳转的页签
|
||||
function this.CheckIndex()
|
||||
local num = 0
|
||||
|
|
|
@ -153,6 +153,7 @@ function RecruitPanelNew:OnShow(sortingOrder)
|
|||
self.sortingOrder = sortingOrder
|
||||
self:OnSortingOrderChange(sortingOrder)
|
||||
self.gameObject:SetActive(true)
|
||||
RecruitManager.curWishType=self.config.ShopData[1][1]
|
||||
self.singleConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"LotteryType",self.config.ShopData[1][1],"PerCount",1)
|
||||
self.tenConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"LotteryType",self.config.ShopData[1][1],"PerCount",10)
|
||||
self.XianZhaoConfig = ConfigManager.GetConfigDataByKey(ConfigName.LotterySetting,"LotteryType",TableRecruitType.xianyuan)
|
||||
|
@ -218,11 +219,10 @@ function RecruitPanelNew:UpdataWishPanel()
|
|||
end
|
||||
--如果没有达到150抽按钮置灰
|
||||
local data = tonumber(specialConfig[119].Value)
|
||||
RecruitManager.curWishType=self.config.ShopData[1][1]
|
||||
NetManager.ChoiceWishHeroRequest(self.config.ShopData[1][1],function ()
|
||||
|
||||
if RecruitManager.drawTimes[1] then
|
||||
LogError(" RecruitManager.drawTimes[1]===".. RecruitManager.drawTimes[1])
|
||||
--LogError(" RecruitManager.drawTimes[1]===".. RecruitManager.drawTimes[1])
|
||||
if wishLv < data then
|
||||
self.wishNoOpen.gameObject:SetActive(true)
|
||||
self.wishOpen.gameObject:SetActive(false)
|
||||
|
@ -248,6 +248,7 @@ function RecruitPanelNew:UpdataWishPanel()
|
|||
local tempdata = tonumber(specialConfig[119].Value)
|
||||
if RecruitManager.drawTimes[1] then
|
||||
if RecruitManager.drawTimes[1] >= tempdata then
|
||||
RecruitManager.curWishType=self.config.ShopData[1][1]
|
||||
if id > 0 then
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.WishDraw,ConfigManager.GetConfigData(ConfigName.HeroConfig,id).PropertyName)
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue