TCX_LongZhu
DESKTOP-MMO982B\User 2026-04-10 15:15:04 +08:00
parent 5ff63f2a5a
commit ad23a765aa
2 changed files with 254 additions and 188 deletions

View File

@ -53,6 +53,9 @@ local jumpDic = {
[20015] = function(data)
this.JumpActivity(20015,data[1])
end,
[20019] = function(data)
this.JumpActivity(20019, data[1])
end,
[JumpType.Arena] = function(data)--竞技场
local arenaDefend = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ARENA_DEFEND)
-- local arenaAttack = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ARENA_ATTACK)
@ -1022,9 +1025,11 @@ function this.GoJump(_jumpId,fun,...)
this.isOpen = false
end
else
LogError("==="..jumpSData.Type)
jumpDic[jumpSData.Type](jumpSData.Skipfactor,args)
end
else
LogError("==="..jumpSData.Type)
jumpDic[jumpSData.Type](jumpSData.Skipfactor,args)
end
end

View File

@ -9,92 +9,89 @@ end
local gameSetting = ConfigManager.GetConfig(ConfigName.GameSetting)
local AllActSetConfig = ConfigManager.GetConfig(ConfigName.GlobalSystemConfig)
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local artResourcesConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local lotterySetting = ConfigManager.GetConfig(ConfigName.LotterySetting)
local privilegeConfig = ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
local specialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig)
local wishConfig=ConfigManager.GetConfig(ConfigName.WishConfig)
local getId=0
local wishConfig = ConfigManager.GetConfig(ConfigName.WishConfig)
local getId = 0
function RecruitEquipPanelNew:InitComponent()
self.spLoader = SpriteLoader.New()
self.panel = Util.GetGameObject(self.gameObject,"Panel")
self.bg1 = Util.GetGameObject(self.gameObject,"Bg/Bg1"):GetComponent("Image")
self.bg2 = Util.GetGameObject(self.gameObject,"Bg/Bg2"):GetComponent("Image")
self.bg3 = Util.GetGameObject(self.gameObject,"Bg/Bg3"):GetComponent("Image")
self.title=Util.GetGameObject(self.panel,"title"):GetComponent("Image")
self.root=Util.GetGameObject(self.panel,"root")
self.panel = Util.GetGameObject(self.gameObject, "Panel")
self.bg1 = Util.GetGameObject(self.gameObject, "Bg/Bg1"):GetComponent("Image")
self.bg2 = Util.GetGameObject(self.gameObject, "Bg/Bg2"):GetComponent("Image")
self.bg3 = Util.GetGameObject(self.gameObject, "Bg/Bg3"):GetComponent("Image")
self.title = Util.GetGameObject(self.panel, "title/Text"):GetComponent("Text")
self.root = Util.GetGameObject(self.panel, "root")
self.rewardBox = Util.GetGameObject(self.panel, "btngroup/rewardBox")
self.rewardBox:SetActive(false)
self.boxIcon = Util.GetGameObject(self.rewardBox, "boxIcon")
self.slider = Util.GetGameObject(self.rewardBox,"Bg/Slider"):GetComponent("Image")
self.slider = Util.GetGameObject(self.rewardBox, "Bg/Slider"):GetComponent("Image")
self.sliderText = Util.GetGameObject(self.rewardBox, "progress/Text"):GetComponent("Text")
self.boxNameText = Util.GetGameObject(self.rewardBox, "di/Text"):GetComponent("Text")
self.boxNameText.text="等级宝箱"
self.boxBtn=Util.GetGameObject(self.rewardBox,"Btn")
self.UI_effect_RecruitPanel_box_normal = Util.GetGameObject(self.rewardBox,"UI_effect_RecruitPanel_box_normal")
self.boxNameText.text = "等级宝箱"
self.boxBtn = Util.GetGameObject(self.rewardBox, "Btn")
self.UI_effect_RecruitPanel_box_normal = Util.GetGameObject(self.rewardBox, "UI_effect_RecruitPanel_box_normal")
effectAdapte(Util.GetGameObject(self.UI_effect_RecruitPanel_box_normal, "quan01"))
self.UI_effect_RecruitPanel_box_open = Util.GetGameObject(self.rewardBox,"UI_effect_RecruitPanel_box_open")
self.UI_effect_RecruitPanel_box_open = Util.GetGameObject(self.rewardBox, "UI_effect_RecruitPanel_box_open")
effectAdapte(Util.GetGameObject(self.UI_effect_RecruitPanel_box_open, "quan01"))
effectAdapte(Util.GetGameObject(self.UI_effect_RecruitPanel_box_open, "quan02"))
self.UI_effect_RecruitPanel_particle = Util.GetGameObject(self.gameObject,"UI_effect_RecruitPanel_particle")
self.UI_effect_RecruitPanel_particle = Util.GetGameObject(self.gameObject, "UI_effect_RecruitPanel_particle")
self.previewBtn = Util.GetGameObject(self.panel, "PreviewBtn")
self.helpBtn = Util.GetGameObject(self.panel, "helpBtn")
self.helpPosition = self.helpBtn:GetComponent("RectTransform").localPosition
self.wish = Util.GetGameObject(self.panel,"wishBtn")
self.wishNoOpen = Util.GetGameObject(self.wish,"noOpen")
self.wishBtn = Util.GetGameObject(self.wishNoOpen,"Img")
self.wishTextImg = Util.GetGameObject(self.wishNoOpen,"ImgText")
self.wishText = Util.GetGameObject(self.wishTextImg,"Text"):GetComponent("Text")
self.wishTipIma = Util.GetGameObject(self.wishNoOpen,"tip"):GetComponent("Text")
self.wishOpen = Util.GetGameObject(self.wish,"upHeroGrid")
self.wishPre = Util.GetGameObject(self.wish,"upHeroPre")
self.wish = Util.GetGameObject(self.panel, "wishBtn")
self.wishNoOpen = Util.GetGameObject(self.wish, "noOpen")
self.wishBtn = Util.GetGameObject(self.wishNoOpen, "Img")
self.wishTextImg = Util.GetGameObject(self.wishNoOpen, "ImgText")
self.wishText = Util.GetGameObject(self.wishTextImg, "Text"):GetComponent("Text")
self.wishTipIma = Util.GetGameObject(self.wishNoOpen, "tip"):GetComponent("Text")
self.wishOpen = Util.GetGameObject(self.wish, "upHeroGrid")
self.wishPre = Util.GetGameObject(self.wish, "upHeroPre")
self.lsth = Util.GetGameObject(self.gameObject,"btngroup/zqbg")
Util.GetGameObject(self.gameObject,"btngroup/zqbg/Text"):GetComponent("Text").text="意念礼包"
self.lsth.gameObject:SetActive(ActivityGiftManager.IsActivityTypeOpen(20015)~=nil)
self.zqbgRed = Util.GetGameObject(self.gameObject,"btngroup/zqbg/red")
BindRedPointObject(RedPointType.WishEquipStore,self.zqbgRed)
--self.zqbgEffect = Util.GetGameObject(self.gameObject,"btngroup/zqbg/Fx_Circle 1")
self.lsth = Util.GetGameObject(self.gameObject, "btngroup/zqbg")
self.lsth.gameObject:SetActive(ActivityGiftManager.IsActivityTypeOpen(20015) ~= nil)
self.zqbgRed = Util.GetGameObject(self.gameObject, "btngroup/zqbg/red")
BindRedPointObject(RedPointType.WishEquipStore, self.zqbgRed)
--self.zqbgEffect = Util.GetGameObject(self.gameObject, "btngroup/zqbg/Fx_Circle 1")
-- self.tip = Util.GetGameObject(self.panel, "tip/text"):GetComponent("Text")
self.tenTip = Util.GetGameObject(self.panel, "TenTip")
self.tenTipText = Util.GetGameObject(self.tenTip, "scroll/Text"):GetComponent("Text")
self.upper = Util.GetGameObject(self.panel,"Upper/Num"):GetComponent("Text")--"今日召唤上限:"
self.upper = Util.GetGameObject(self.panel, "Upper/Num"):GetComponent("Text") --Language[10596]
if not self.upHeroPreList then
self.upHeroPreList = {}
end
for i = 1,3 do
for i = 1, 3 do
self.upHeroPreList[i] = {}
self.upHeroPreList[i].go = Util.GetGameObject(self.wishOpen,"upHeroPre"..i)
self.upHeroPreList[i].pos = Util.GetGameObject(self.upHeroPreList[i].go,"di")
self.upHeroPreList[i].itempos = Util.GetGameObject(self.upHeroPreList[i].go,"itempos")
self.upHeroPreList[i].item = SubUIManager.Open(SubUIConfig.ItemView,self.upHeroPreList[i].itempos.transform)
self.upHeroPreList[i].go = Util.GetGameObject(self.wishOpen, "upHeroPre" .. i)
self.upHeroPreList[i].pos = Util.GetGameObject(self.upHeroPreList[i].go, "di")
self.upHeroPreList[i].itempos = Util.GetGameObject(self.upHeroPreList[i].go, "itempos")
self.upHeroPreList[i].item = SubUIManager.Open(SubUIConfig.ItemView, self.upHeroPreList[i].itempos.transform)
self.upHeroPreList[i].item.gameObject:SetActive(false)
self.upHeroPreList[i].item.transform:SetSiblingIndex(0)
self.upHeroPreList[i].choosed = Util.GetGameObject(self.upHeroPreList[i].go,"state")
self.upHeroPreList[i].choosed = Util.GetGameObject(self.upHeroPreList[i].go, "state")
--心愿神将现在只显示一个
if i>1 then
if i > 1 then
self.upHeroPreList[i].go:SetActive(false)
else
self.upHeroPreList[i].go:SetActive(true)
end
end
self.btns = {}
for i = 1,2 do
for i = 1, 2 do
self.btns[i] = {}
self.btns[i].btn = Util.GetGameObject(self.gameObject,"btngroup/btn"..i)
self.btns[i].layoutDi = Util.GetGameObject(self.btns[i].btn.gameObject,"layout/di"):GetComponent("Image")
self.btns[i].red = Util.GetGameObject(self.btns[i].btn.gameObject,"redPoint")
self.btns[i].info = Util.GetGameObject(self.btns[i].btn.gameObject,"layout/Text"):GetComponent("Text")
self.btns[i].icon = Util.GetGameObject(self.btns[i].btn.gameObject,"layout/icon"):GetComponent("Image")
self.btns[i].num = Util.GetGameObject(self.btns[i].btn.gameObject,"layout/num"):GetComponent("Text")
self.btns[i].time = Util.GetGameObject(self.btns[i].btn.gameObject,"time"):GetComponent("Text")
self.btns[i].btn = Util.GetGameObject(self.gameObject, "btngroup/btn" .. i)
self.btns[i].layoutDi = Util.GetGameObject(self.btns[i].btn.gameObject, "layout/di"):GetComponent("Image")
self.btns[i].red = Util.GetGameObject(self.btns[i].btn.gameObject, "redPoint")
self.btns[i].info = Util.GetGameObject(self.btns[i].btn.gameObject, "layout/Text"):GetComponent("Text")
self.btns[i].icon = Util.GetGameObject(self.btns[i].btn.gameObject, "layout/icon"):GetComponent("Image")
self.btns[i].num = Util.GetGameObject(self.btns[i].btn.gameObject, "layout/num"):GetComponent("Text")
self.btns[i].time = Util.GetGameObject(self.btns[i].btn.gameObject, "time"):GetComponent("Text")
end
end
@ -102,23 +99,35 @@ function RecruitEquipPanelNew:OnFocus()
CheckRedPointStatus(RedPointType.WishEquipStore)
end
function RecruitEquipPanelNew:BindEvent()
Util.AddOnceClick(self.lsth, function()
local isOpen =CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
local tip=GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
if isOpen==false then
local isOpen
local tip
if self.config.ShopData[1][1] == 4 then
isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
else
isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.Fabaojulingxinyuan)
tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.Fabaojulingxinyuan)
end
--[[
if isOpen == false then
PopupTipPanel.ShowTip(tip)
return
end
JumpManager.GoJump(40082)
]]
if self.config.ShopData[1][1] == 4 then
JumpManager.GoJump(40082)
else
JumpManager.GoJump(40089)
end
end)
--帮助按钮
Util.AddClick(self.helpBtn, function()
UIManager.OpenPanel(UIName.HelpPopup,self.config.HelpId,self.helpPosition.x,self.helpPosition.y)
UIManager.OpenPanel(UIName.HelpPopup, self.config.HelpId, self.helpPosition.x, self.helpPosition.y)
end)
--宝箱按钮
Util.AddClick(self.boxBtn,function()
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
@ -127,89 +136,97 @@ function RecruitEquipPanelNew:BindEvent()
-- else
-- UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[1][1])
-- end
UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[1][1])
UIManager.OpenPanel(UIName.WishHeroRewardPopup, self.config.ShopData[1][1])
end)
--奖池预览按钮
Util.AddClick(self.previewBtn, function()
UIManager.OpenPanel(UIName.HeroPreviewNewPanel,true,true,self.config.ShopData[4][1])
end)
UIManager.OpenPanel(UIName.HeroPreviewNewPanel, true, true, self.config.ShopData[4][1])
end)
end
function RecruitEquipPanelNew:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Recruit.OnRecruitRefreshData, self.UpdataPanel,self)
Game.GlobalEvent:AddEvent(GameEvent.Recruit.OnRecruitRefreshData, self.UpdataPanel, self)
end
function RecruitEquipPanelNew:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Recruit.OnRecruitRefreshData, self.UpdataPanel,self)
Game.GlobalEvent:RemoveEvent(GameEvent.Recruit.OnRecruitRefreshData, self.UpdataPanel, self)
end
function RecruitEquipPanelNew:OnSortingOrderChange(sortingOrder)
self.sortingOrder = sortingOrder
Util.SetParticleSortLayer(self.UI_effect_RecruitPanel_box_normal, self.sortingOrder + 1)
Util.SetParticleSortLayer(self.UI_effect_RecruitPanel_box_open, self.sortingOrder + 1)
Util.SetParticleSortLayer(self.UI_effect_RecruitPanel_particle, self.sortingOrder + 1)
--SetParticleSortLayer(self.zqbgEffect,self.sortingOrder+1)
--SetParticleSortLayer(self.zqbgEffect, self.sortingOrder + 1)
end
--界面打开时调用(用于子类重写)
function RecruitEquipPanelNew:OnOpen(_Config,_index, parent)
function RecruitEquipPanelNew:OnOpen(_Config, _index, parent)
self.config = _Config
self.parent = parent
self.gameObject.name = "RecruitEquipPanelNew"..self.config.Id
end
self.gameObject.name = "RecruitEquipPanelNew" .. self.config.Id
end
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)
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)
self:UpdataPanel()
SoundManager.PlayMusic(SoundConfig.BGM_Recruit)
if self.liveNode then
poolManager:UnLoadLive(self.liveNode.name, self.liveNode)
end
if self.config.ShopData[2][1] == 1 then
local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig,self.config.ShopData[2][2])
local name = GetResourcePath(heroConfig.Painting)
self.liveNode = poolManager:LoadLive(name, self.root.transform, Vector3.one *1., Vector3.New(heroConfig.Position[1], heroConfig.Position[2], 0))
local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, self.config.ShopData[2][2])
local name = GetResourcePath(heroConfig.Live)
self.liveNode = poolManager:LoadLive(name, self.root.transform, Vector3.one * heroConfig.Scale,
Vector3.New(heroConfig.Position[1], heroConfig.Position[2], 0))
self.liveNode.name = name
SetHEeroLiveToward(self.liveNode,heroConfig.Toward)
SetHEeroLiveToward(self.liveNode, heroConfig.Toward)
local SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
end
CheckRedPointStatus(RedPointType.WishEquipStore)
end
local progresss=0
local wishLv=0
local progresss = 0
local wishLv = 0
function RecruitEquipPanelNew:UpdataPanel()
-- self.bg1.sprite = self.spLoader:LoadSprite(self.config.Icon[3])
self.bg1.sprite = self.spLoader:LoadSprite(self.config.Icon[3])
self.bg2.sprite = self.spLoader:LoadSprite(self.config.Icon[4])
self.bg3.sprite = self.spLoader:LoadSprite(self.config.Icon[8])
if self.config.ShopData[1][1] == 4 then
self.title.text = "意念招募"
else
self.title.text = "羁绊招募"
end
--self.title.sprite = self.spLoader:LoadSprite(self.config.Icon[5])
--宝箱活动数据
local actconfigs=ActivityGiftManager.GetActivityInfoByType(11901)
local actconfigs = ActivityGiftManager.GetActivityInfoByType(11901)
if actconfigs then
for i = 1,#actconfigs.mission do
progresss=actconfigs.mission[i].progress
for i = 1, #actconfigs.mission do
progresss = actconfigs.mission[i].progress
end
end
--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
wishLv=v.Level
RecruitManager.SetWishPro(v.Weight/10000*100,v.MythWeight/10000*100)
if RecruitManager.drawTimes[self.config.ShopData[1][1]] and RecruitManager.drawTimes[self.config.ShopData[1][1]] >= v.DrawCardNumber and v.LotteryType == 4 then
wishLv = v.Level
RecruitManager.SetWishPro(v.Weight / 10000 * 100, v.MythWeight / 10000 * 100)
end
end
self.boxNameText.text="宝箱等级:"..wishLv
--self.title:SetNativeSize()
for i = 1,2 do
self.boxNameText.text = "宝箱等级:" .. wishLv
--:SetNativeSize()
for i = 1, 2 do
self.btns[i].layoutDi.sprite = self.spLoader:LoadSprite(self.config.Icon[6])
end
self.parent.mask2.sprite = self.spLoader:LoadSprite(self.config.Icon[7])
@ -218,8 +235,10 @@ function RecruitEquipPanelNew:UpdataPanel()
self:UpdataWishPanel()
self:UpdataBoxReward()
local num=PrivilegeManager.GetPrivilegeRemainValue(self.singleConfig.MoneyTimes)
self.upper.text=string.format(self.config.TitleText,PrivilegeManager.GetPrivilegeUsedTimes(self.singleConfig.MaxTimes),privilegeConfig[self.singleConfig.MaxTimes].Condition[1][2]) --string.format(self.config.TitleText,PrivilegeManager.GetPrivilegeUsedTimes(self.singleConfig.MaxTimes),privilegeConfig[self.singleConfig.MaxTimes].Condition[1][2].." 剩余钻石召唤次数:"..num) --特权上限
local num = PrivilegeManager.GetPrivilegeRemainValue(self.singleConfig.MoneyTimes)
self.upper.text = string.format(GetLanguageStrById(self.config.TitleText),
PrivilegeManager.GetPrivilegeUsedTimes(self.singleConfig.MaxTimes),
privilegeConfig[self.singleConfig.MaxTimes].Condition[1][2]) --string.format(self.config.TitleText,PrivilegeManager.GetPrivilegeUsedTimes(self.singleConfig.MaxTimes),privilegeConfig[self.singleConfig.MaxTimes].Condition[1][2]..Language[12580]..num) --特权上限
self:UpdatePanelData()
self:TimeCountDown()
end
@ -228,49 +247,65 @@ function RecruitEquipPanelNew:UpdataWishPanel()
self.tenTip.gameObject:SetActive(false)
--如果没有达到150抽按钮置灰
local data = tonumber(specialConfig[119].Value)
NetManager.ChoiceWishHeroRequest(self.config.ShopData[1][1],function ()
if RecruitManager.drawTimes[4] then
LogError(" RecruitManager.drawTimes[4]===".. RecruitManager.drawTimes[4])
NetManager.ChoiceWishHeroRequest(self.config.ShopData[1][1], function()
if RecruitManager.drawTimes[self.config.ShopData[1][1]] then
LogError(" RecruitManager.drawTimes[4]===" .. RecruitManager.drawTimes[self.config.ShopData[1][1]])
if wishLv < data then
self.wishNoOpen.gameObject:SetActive(true)
self.wishOpen.gameObject:SetActive(false)
Util.SetGray(self.wishBtn,true)
local wishData=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.WishConfig,"Level",data,"LotteryType",4)
self.wishText.text = string.format("%s/%s",RecruitManager.drawTimes[4] or 0,wishData.DrawCardNumber)
--self.wishText.text = string.format("%s/%s",wishLv,data)
--self.wishTipIma.text = "宝箱等级"..data.."级后开启心愿功能,\n将有更高概率获得心愿意念~"
self.wishTipIma.text = "召唤次数达到"..wishData.DrawCardNumber.."次后开启心愿功能,\n将有更高概率获得心愿意念~"
Util.SetGray(self.wishBtn, true)
--self.wishText.text = string.format("%s/%s", wishLv, data)
--self.wishTipIma.text = Language[12581] .. data .. Language[12582]
local wishData = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.WishConfig, "Level", data,
"LotteryType", self.config.ShopData[1][1])
--LogError("sssssssssss" .. self.config.ShopData[1][1])
self.wishText.text = string.format("%s/%s", RecruitManager.drawTimes[self.config.ShopData[1][1]] or 0,
wishData.DrawCardNumber)
if self.config.ShopData[1][1] == 4 then
self.wishTipIma.text = "召唤次数达到" .. wishData.DrawCardNumber .. "次后开启心愿功能,\n将有更高概率获得心愿法宝~"
else
self.wishTipIma.text = "召唤次数达到" .. wishData.DrawCardNumber .. "次后开启心愿功能,\n将有更高概率获得羁绊碎片~"
end
else
self.wishNoOpen.gameObject:SetActive(false)
self.wishOpen.gameObject:SetActive(true)
for i = 1,1 do
local data = RecruitManager.WishEquipData[i]
local id =0
if data then
id=data.heroTid
for i = 1, 1 do
local data = nil
if self.config.ShopData[1][1] == 4 then
data = RecruitManager.WishEquipData[i]
else
data = RecruitManager.WishJulingData[i]
end
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)
self.upHeroPreList[i].item.frame.sprite = self.spLoader:LoadSprite(GetBgByHeroNatural(ConfigManager.GetConfigData(ConfigName.ItemConfig,id).Quantity))
self.upHeroPreList[i].item:OnOpen(false, { id, 0 }, 1, false, false, false, self.sortingOrder)
self.upHeroPreList[i].item.frame.sprite = self.spLoader:LoadSprite(GetBgByHeroNatural(
ConfigManager.GetConfigData(ConfigName.ItemConfig, id).Quantity))
self.upHeroPreList[i].choosed:SetActive(data.status == 1)
else
self.upHeroPreList[i].item.gameObject:SetActive(false)
self.upHeroPreList[i].choosed.gameObject:SetActive(false)
end
Util.AddOnceClick(self.upHeroPreList[i].pos,function()
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)
if RecruitManager.drawTimes[self.config.ShopData[1][1]] then
RecruitManager.curWishType = self.config.ShopData[1][1]
if RecruitManager.drawTimes[self.config.ShopData[1][1]] >= tempdata then
if self.config.ShopData[1][1] == 4 then
UIManager.OpenPanel(UIName.GeneralBigPopup, GENERAL_POPUP_TYPE.WishEquipDraw)
else
UIManager.OpenPanel(UIName.GeneralBigPopup, GENERAL_POPUP_TYPE.WishJulingDraw)
end
else
PopupTipPanel.ShowTip(string.format("%s次英雄召唤后开启心愿抽卡",tempdata - RecruitManager.drawTimes[4]))
PopupTipPanel.ShowTip(string.format(Language[12583],
tempdata - RecruitManager.drawTimes[self.config.ShopData[1][1]]))
end
else
PopupTipPanel.ShowTip(string.format("%s次英雄召唤后开启心愿抽卡",tempdata))
PopupTipPanel.ShowTip(string.format(Language[12583], tempdata))
end
end)
end
@ -278,12 +313,19 @@ function RecruitEquipPanelNew:UpdataWishPanel()
else
self.wishNoOpen.gameObject:SetActive(true)
self.wishOpen.gameObject:SetActive(false)
Util.SetGray(self.wishBtn,true)
--self.wishText.text = string.format("%s/%s",0,data)
--self.wishTipIma.text = "宝箱等级"..data.."级后开启心愿功能,\n将有更高概率获得心愿意念~"
local wishData=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.WishConfig,"Level",data,"LotteryType",4)
self.wishText.text = string.format("%s/%s",RecruitManager.drawTimes[4] or 0,wishData.DrawCardNumber)
self.wishTipIma.text = "召唤次数达到"..wishData.DrawCardNumber.."次后开启心愿功能,\n将有更高概率获得心愿意念~"
Util.SetGray(self.wishBtn, true)
--self.wishText.text = string.format("%s/%s", 0, data)
--self.wishTipIma.text = Language[12581] .. data .. Language[12582]
LogError("==========Level:"..data.." LotteryType:"..self.config.ShopData[1][1])
local wishData = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.WishConfig, "Level", data,
"LotteryType", self.config.ShopData[1][1])
self.wishText.text = string.format("%s/%s", RecruitManager.drawTimes[self.config.ShopData[1][1]] or 0,
wishData.DrawCardNumber)
if self.config.ShopData[1][1] == 4 then
self.wishTipIma.text = "召唤次数达到" .. wishData.DrawCardNumber .. "次后开启心愿功能,\n将有更高概率获得心愿法宝~"
else
self.wishTipIma.text = "召唤次数达到" .. wishData.DrawCardNumber .. "次后开启心愿功能,\n将有更高概率获得羁绊碎片~"
end
end
--self:CheckNewWishHero()
end)
@ -291,36 +333,45 @@ function RecruitEquipPanelNew:UpdataWishPanel()
-- if RecruitManager.isTenRecruit == 0 then
-- self.tenTipText.text = "<color=#FFB83B><size=30>每次十连</size><color=#FEDA90><size=30>必得</size></color></color><color=#FFB83B><size=30>五星</size></color><color=#FEDA90><size=30>神将法宝</size></color>"
-- else
self.tenTipText.text = string.format("剩余<color=#22A70C>%s次</color>必得五星意念",RecruitManager.GetRecruit2MustCount())
if self.config.ShopData[1][1] == 4 then
self.tenTip:SetActive(true)
self.tenTipText.text = string.format("剩余<color=#22A70C>%s次</color>必得五星意念", RecruitManager.GetRecruit2MustCount())
else
self.tenTip:SetActive(false)
self.tenTipText.text = string.format("剩余<color=#22A70C>%s次</color>必得五星意念", RecruitManager.GetRecruit2MustCount())
end
--end
end
function RecruitEquipPanelNew:UpdataBoxReward()
--local num = BagManager.GetItemCountById(self.XianZhaoConfig.CostItem[1][1])
LogError("更新宝箱显示s")
local actconfigs=ActivityGiftManager.GetActivityInfoByType(11901)
RecruitManager.isCanOpenBox=false
local actconfigs = ActivityGiftManager.GetActivityInfoByType(11901)
RecruitManager.isCanOpenBox = false
if actconfigs then
for i = 1,#actconfigs.mission do
local config=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.WishConfig,"Level",actconfigs.mission[i].missionId,"LotteryType",4)
if config and actconfigs.mission[i].state==0 and RecruitManager.drawTimes[4] and RecruitManager.drawTimes[4]>=config.DrawCardNumber then
RecruitManager.isCanOpenBox=true
getId=actconfigs.mission[i].missionId
for i = 1, #actconfigs.mission do
local config = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.WishConfig, "Level",
actconfigs.mission[i].missionId, "LotteryType", self.config.ShopData[1][1])
if config and actconfigs.mission[i].state == 0 and RecruitManager.drawTimes[self.config.ShopData[1][1]] and RecruitManager.drawTimes[self.config.ShopData[1][1]] >= config.DrawCardNumber then
RecruitManager.isCanOpenBox = true
getId = actconfigs.mission[i].missionId
break
end
end
end
self.boxIcon:GetComponent("Animator").enabled = RecruitManager.isCanOpenBox
local wishData=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.WishConfig,"Level",wishLv+1,"LotteryType",4)
local wishData = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.WishConfig, "Level", wishLv + 1, "LotteryType",
self.config.ShopData[1][1])
if wishData then
self.sliderText.text = string.format("%s/%s", RecruitManager.drawTimes[4] or 0,wishData.DrawCardNumber )
if RecruitManager.drawTimes[4] then
self.slider.fillAmount = RecruitManager.drawTimes[4]/wishData.DrawCardNumber
self.sliderText.text = string.format("%s/%s", RecruitManager.drawTimes[self.config.ShopData[1][1]] or 0,
wishData.DrawCardNumber)
if RecruitManager.drawTimes[self.config.ShopData[1][1]] then
self.slider.fillAmount = RecruitManager.drawTimes[self.config.ShopData[1][1]] / wishData.DrawCardNumber
else
self.slider.fillAmount = 0 /wishData.DrawCardNumber
self.slider.fillAmount = 0 / wishData.DrawCardNumber
end
else
self.slider.fillAmount = 1
self.sliderText.text ="<color=#E15362>宝箱已达最大等级</color>"
@ -341,8 +392,8 @@ function RecruitEquipPanelNew:OnDestroy()
self.timer:Stop()
self.timer = nil
end
ClearRedPointObject(RedPointType.WishEquipStore,self.zqbgRed)
for i = 1,3 do
ClearRedPointObject(RedPointType.WishEquipStore, self.zqbgRed)
for i = 1, 3 do
if self.upHeroPreList[i] then
SubUIManager.Close(self.upHeroPreList[i].item)
end
@ -368,19 +419,21 @@ function RecruitEquipPanelNew:UpdatePanelData()
local isFree = freeTime >= 1 and n == 1
m.icon.gameObject:SetActive(not isFree)
m.num.gameObject:SetActive(not isFree)
local itemId=0
local itemNum=0
local itemId = 0
local itemNum = 0
local type = 0
if n == 1 then
type = self.singleConfig.Id
m.info.text = "1次"
m.time.gameObject:SetActive(true)
m.red.gameObject:SetActive(RecruitManager.GetRecruitBtnRedpoint1(PreConfigure[RevertPreConfigure[self.config.ShopData[3][1]]]))
m.red.gameObject:SetActive(RecruitManager.GetRecruitBtnRedpoint1(PreConfigure
[RevertPreConfigure[self.config.ShopData[3][1]]]))
else
m.time.gameObject:SetActive(false)
type = self.tenConfig.Id
m.info.text = "10次"
m.red.gameObject:SetActive(RecruitManager.GetRecruitBtnRedpoint1(PreConfigure[RevertPreConfigure[self.config.ShopData[3][2]]]))
m.red.gameObject:SetActive(RecruitManager.GetRecruitBtnRedpoint1(PreConfigure
[RevertPreConfigure[self.config.ShopData[3][2]]]))
end
if self.config.ShopData[1][1] == TableRecruitType.Youqing then
m.time.gameObject:SetActive(false)
@ -391,65 +444,73 @@ function RecruitEquipPanelNew:UpdatePanelData()
m.info.text="免费召唤"
else
local d = RecruitManager.GetExpendData(type)
itemId=d[1]
itemNum=d[2]
m.icon.sprite=self.spLoader:LoadSprite(artResourcesConfig[itemConfig[itemId].ResourceID].Name)
m.num.text= PrintWanNum2(itemNum)
itemId = d[1]
itemNum = d[2]
m.icon.sprite = self.spLoader:LoadSprite(artResourcesConfig[itemConfig[itemId].ResourceID].Name)
m.num.text = PrintWanNum2(itemNum)
end
Util.AddOnceClick(m.btn,function()
local isOpen =CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
local tip=GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
if isOpen==false then
Util.AddOnceClick(m.btn, function()
local isOpen
local tip
if self.config.ShopData[1][1] == 4 then
isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
else
isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.Fabaojulingxinyuan)
tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.Fabaojulingxinyuan)
end
if isOpen == false then
PopupTipPanel.ShowTip(tip)
return
end
if not isFree then
if BagManager.GetItemCountById(itemId)<itemNum then
if BagManager.GetItemCountById(itemId) < itemNum then
PopupTipPanel.ShowTip(itemConfig[itemId].Name.."数量不足!")
return
end
end
local state = PlayerPrefs.GetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..self.config.ShopData[3][2])
LogGreen("self.config.ShopData[3][2]:"..self.config.ShopData[3][2].." state:"..state)
local state = PlayerPrefs.GetInt(PlayerManager.uid ..
"GeneralPopup_RecruitConfirm" .. self.config.ShopData[3][2])
LogGreen("self.config.ShopData[3][2]:" .. self.config.ShopData[3][2] .. " state:" .. state)
local recrutId = n == 1 and self.singleConfig.Id or self.tenConfig.Id
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,recrutId,function()
self:Recruit(recrutNum,recrutId,n,itemId)
if state == 0 and itemId == 16 and not isFree then
UIManager.OpenPanel(UIName.GeneralPopup, GENERAL_POPUP_TYPE.RecruitConfirm, recrutId, function()
self:Recruit(recrutNum, recrutId, n, itemId)
end)
else
self:Recruit(recrutNum,recrutId,n,itemId)
self:Recruit(recrutNum, recrutId, n, itemId)
end
end)
end
end
function RecruitEquipPanelNew:Recruit(recrutType,recrutId,bType,itemId)
if PrivilegeManager.GetPrivilegeUsedTimes(self.singleConfig.MaxTimes)+recrutType>privilegeConfig[self.singleConfig.MaxTimes].Condition[1][2] then
function RecruitEquipPanelNew:Recruit(recrutType, recrutId, bType, itemId)
if PrivilegeManager.GetPrivilegeUsedTimes(self.singleConfig.MaxTimes) + recrutType > privilegeConfig[self.singleConfig.MaxTimes].Condition[1][2] then
PopupTipPanel.ShowTip("无法超出每日召唤次数上限!")
return
end
if itemId==16 and PrivilegeManager.GetPrivilegeRemainValue(self.singleConfig.MaxTimes)<recrutType then
if itemId == 16 and PrivilegeManager.GetPrivilegeRemainValue(self.singleConfig.MaxTimes) < recrutType then
PopupTipPanel.ShowTip("无法超出每日钻石召唤次数上限!")
return
return
end
RecruitManager.RecruitRequest(recrutId, function(msg)
PrivilegeManager.RefreshPrivilegeUsedTimes(self.singleConfig.MaxTimes,recrutType)--记录抽卡次数
if itemId==16 then
PrivilegeManager.RefreshPrivilegeUsedTimes(self.singleConfig.MoneyTimes,recrutType)
PrivilegeManager.RefreshPrivilegeUsedTimes(self.singleConfig.MaxTimes, recrutType) --记录抽卡次数
if itemId == 16 then
PrivilegeManager.RefreshPrivilegeUsedTimes(self.singleConfig.MoneyTimes, recrutType)
end
if bType == 1 then
UIManager.OpenPanel(UIName.WishEquipBuyOnePanel,msg.drop,recrutId,{self.config.ShopData[3][1],self.config.ShopData[3][2]})
UIManager.OpenPanel(UIName.WishEquipBuyOnePanel, msg.drop, recrutId,
{ self.config.ShopData[3][1], self.config.ShopData[3][2] })
else
RecruitManager.isTenRecruit = 1
UIManager.OpenPanel(UIName.WishEquipBuyTenPanel,msg.drop,recrutId,{self.config.ShopData[3][1],self.config.ShopData[3][2]})
UIManager.OpenPanel(UIName.WishEquipBuyTenPanel, msg.drop, recrutId,
{ self.config.ShopData[3][1], self.config.ShopData[3][2] })
end
CheckRedPointStatus(self.config.RpType)
end,self.singleConfig.FreeTimes)
end, self.singleConfig.FreeTimes)
end
function RecruitEquipPanelNew:TimeCountDown()
@ -457,7 +518,7 @@ function RecruitEquipPanelNew:TimeCountDown()
self.timer:Stop()
self.timer = nil
end
local timeDown=CalculateSecondsNowTo_N_OClock(0)
local timeDown = CalculateSecondsNowTo_N_OClock(0)
self.btns[1].time.text = Language[10023]..TimeToHMS(timeDown)
self.timer = Timer.New(function()
if timeDown < 1 then
@ -473,9 +534,9 @@ end
--检查是否有新开放的心愿英雄
function RecruitEquipPanelNew:CheckNewWishHero()
if #RecruitManager.newWishList > 0 and #RecruitManager.newWishList<10 then
if not GuideManager.IsFunctionGuideExist() and not GuideManager.IsInMainGuide() then
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.NewAddWishHero)
if #RecruitManager.newWishList > 0 and #RecruitManager.newWishList < 10 then
if not GuideManager.IsFunctionGuideExist() and not GuideManager.IsInMainGuide() then
UIManager.OpenPanel(UIName.GeneralPopup, GENERAL_POPUP_TYPE.NewAddWishHero)
end
end
end