[乾坤宝盒]===========功能修改

dev_chengFeng
wangzhenxing 2021-07-15 14:57:34 +08:00
parent 37dd3100b9
commit fcaa098564
4 changed files with 38 additions and 31 deletions

View File

@ -7,6 +7,7 @@ local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local lotterySpecialConfig = ConfigManager.GetConfig(ConfigName.LotterySpecialConfig)
local wishSoulData
function QianKunBox:New(gameObject)
local b = {}
b.gameObject = gameObject
@ -78,7 +79,8 @@ function QianKunBox:BindEvent()
end)
Util.AddOnceClick(self.btn_soul, function()
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.ChooseUpSoul,self.actId,self.wishSoulData)
local data=RecruitManager.GetWishEquipData()
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.ChooseUpSoul,self.actId,wishSoulData)
end)
end
@ -220,18 +222,18 @@ end
--五个魂印头像
function QianKunBox:contentShow()
self.wishSoulData=RecruitManager.GetWishEquipData()
wishSoulData =RecruitManager.GetWishEquipData()
local iconsData = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotteryRewardConfig,"Pool",self.singleRecruit.DiamondBoxContain[1][1])
local num=1
--如果没有默认数值,默认的就是表里面的请三个魂印
if self.wishSoulData and #self.wishSoulData~=0 then
if wishSoulData and #wishSoulData~=0 then
for i = 1, 3 do
if i<=#self.wishSoulData then
if i<=#wishSoulData then
self.icons[i].icon.gameObject:SetActive(true)
self.icons[i].kuang.gameObject:SetActive(true)
local id=self.wishSoulData[i]
local id=wishSoulData[i]
self.icons[i].icon.sprite = self.spLoader:LoadSprite(artConfig[itemConfig[id].ResourceID].Name)
self.icons[i].kuang.sprite = self.spLoader:LoadSprite(SoulPrintSpriteByQuantity[itemConfig[self.wishSoulData[i]].Quantity].circle)
self.icons[i].kuang.sprite = self.spLoader:LoadSprite(SoulPrintSpriteByQuantity[itemConfig[wishSoulData[i]].Quantity].circle)
--点击能查看魂印信息
Util.AddOnceClick(self.icons[i].kuang.gameObject,function ()
UIManager.OpenPanel(UIName.SoulPrintPopUp,nil,nil,iconsData[i].Reward[1],nil,nil)
@ -247,7 +249,7 @@ function QianKunBox:contentShow()
for i = num, 5 do
self.icons[i].icon.sprite = self.spLoader:LoadSprite(artConfig[itemConfig[iconsData[i].Reward[1]].ResourceID].Name)
if i<4 then
table.insert(self.wishSoulData,iconsData[i].Reward[1])
table.insert(wishSoulData,iconsData[i].Reward[1])
end
self.icons[i].kuang.sprite = self.spLoader:LoadSprite(SoulPrintSpriteByQuantity[itemConfig[iconsData[i].Reward[1]].Quantity].circle)
--点击能查看魂印信息
@ -255,7 +257,7 @@ function QianKunBox:contentShow()
UIManager.OpenPanel(UIName.SoulPrintPopUp,nil,nil,iconsData[i].Reward[1],nil,nil)
end)
end
self.upSoulImg.sprite=self.spLoader:LoadSprite(artConfig[itemConfig[self.wishSoulData[1]].ResourceID].Name)
self.upSoulImg.sprite=self.spLoader:LoadSprite(artConfig[itemConfig[wishSoulData[1]].ResourceID].Name)
end
--刷新时间

View File

@ -230,8 +230,6 @@ function this:ReculateUpHeroRate(itemList,UpItemList,_tag,config)
for k,v in ipairs(UpItemList) do
for n,m in ipairs(itemList) do
if v.Reward[1] == m.Reward[1] then
LogError("ppppppppp")
LogError("v id=="..v.Id.." m.id=="..m.Id)
local _config = ConfigManager.GetConfigData(config,v.Reward[1])
local readingName = _config.ReadingName or _config.Name
table.insert(rateList,{id = m.Reward[1],tag=_tag,name = readingName,value = m.WeightShow,color = "AD4152"})

View File

@ -5,7 +5,7 @@ local parent
--传入特效层级
local sortingOrder=0
local args=nil
local currHeroIds={}
local equipConfig=ConfigManager.GetConfig(ConfigName.EquipConfig)
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
@ -23,7 +23,7 @@ function this:InitComponent(gameObject)
--滚动条根节点
this.root = Util.GetGameObject(gameObject, "Root")
this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.root.transform,this.prefab, nil,
Vector2.New(this.root.transform.rect.width,this.root.transform.rect.height),1,4,Vector2.New(50,15))
Vector2.New(this.root.transform.rect.width,this.root.transform.rect.height),1,4,Vector2.New(50,20))
this.scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0)
this.scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
this.scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
@ -31,22 +31,24 @@ function this:InitComponent(gameObject)
this.scrollView.moveTween.MomentumAmount = 1
this.scrollView.moveTween.Strength = 2
this.preList={}
this.currHeroIds={}
end
function this:BindEvent()
Util.AddClick(this.confirmBtn,function()
NetManager.BeautyBagWishEquipRequest(this.currHeroIds,function()
Game.GlobalEvent:DispatchEvent(GameEvent.Activity.TimeLimitUpHeroChange,this.currHeroIds[1])
parent:ClosePanel()
end)
end)
Util.AddClick(this.cancelBtn,function()
parent:ClosePanel()
end)
Util.AddClick(this.btn_close,function()
parent:ClosePanel()
end)
Util.AddClick(this.confirmBtn,function()
NetManager.BeautyBagWishEquipRequest(currHeroIds,function()
Game.GlobalEvent:DispatchEvent(GameEvent.Activity.TimeLimitUpHeroChange,currHeroIds[1])
parent:ClosePanel()
end)
end)
end
function this:AddListener()
@ -59,11 +61,11 @@ function this:OnShow(_parent,...)
parent=_parent
sortingOrder =_parent.sortingOrder
args = {...}
currHeroIds=args[2]
this.currHeroIds=RecruitManager.GetWishEquipData()
local heroDatas={}
for k, v in ConfigPairs(equipConfig) do
if v.Position==5 and v.Quality==6 then
if BattleUtil.ChecklistIsContainValue(currHeroIds,v.Id) then
if BattleUtil.ChecklistIsContainValue(this.currHeroIds,v.Id) then
table.insert(heroDatas,1,itemConfig[v.Id])
else
table.insert(heroDatas,itemConfig[v.Id])
@ -99,24 +101,25 @@ function this.SingleHeroDataShow(go,_heroData)
local selectObj=Util.GetGameObject(_go.transform, "choosed"):GetComponent("Image")
selectObj.sprite=this.spLoader:LoadSprite("r_chouka_yixuanding")
local cardclickBtn = Util.GetGameObject(_go.transform, "icon")
local isHave=BattleUtil.ChecklistIsContainValue(currHeroIds,heroData.Id)
local isHave=BattleUtil.ChecklistIsContainValue(this.currHeroIds,heroData.Id)
selectObj.gameObject:SetActive(isHave)
Util.AddOnceClick(cardclickBtn, function()
if #currHeroIds==3 and not isHave then
if #this.currHeroIds==3 and not isHave then
PopupTipPanel.ShowTip("Up魂印最多3个")
return
end
if isHave then
if #currHeroIds==1 then
if #this.currHeroIds==1 then
PopupTipPanel.ShowTip("至少选择一个Up魂印")
return
end
table.removebyvalue(currHeroIds,heroData.Id)
table.removebyvalue(this.currHeroIds,heroData.Id)
isHave=false
else
table.insert(currHeroIds,heroData.Id)
table.insert(this.currHeroIds,heroData.Id)
isHave=true
end
local aa=RecruitManager.GetWishEquipData()
selectObj.gameObject:SetActive(isHave)
end)
@ -127,7 +130,7 @@ end
function this:OnClose()
currHeroIds=nil
this.currHeroIds=nil
args=nil
end

View File

@ -29,7 +29,7 @@ function this.Initialize()
this.recruitFreeUseTime = 0 --现在只剩下秘盒招募在用了
this.isTenRecruit = 0 --首次十连
this.WishCardData = {}
this.wishEquipData={}
this.wishSoulData={}
this.isFirstEnterElementScroll=true
this.isFirstEnterHeroScroll=true
this.InitPreData()
@ -448,13 +448,17 @@ end
--心愿魂印
function this.SetWishEquipData(infoList)
this.wishEquipData={}
this.wishSoulData={}
for i = 1, #infoList do
table.insert(this.wishEquipData,infoList[i].equip)
table.insert(this.wishSoulData,infoList[i].equip)
end
end
function this.GetWishEquipData()
return this.wishEquipData
local data={}
for i = 1, #this.wishSoulData do
table.insert(data,this.wishSoulData[i])
end
return data
end
function this.GetCurHeroList(curIndex)