Merge branch 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev

dev_chengFeng
ZhangBiao 2022-01-12 14:28:26 +08:00
commit 6d29d5dce2
2 changed files with 92 additions and 117 deletions

View File

@ -103,14 +103,22 @@ end
function this:BindEvent() function this:BindEvent()
Util.AddClick(this.BtnBack, function() Util.AddClick(this.BtnBack, function()
NetManager.RequestTrialReward(function(msg) NetManager.RequestTrialReward(function(msg)
if msg.drop and #msg.drop.itemlist > 0 then if CarbonManager.difficulty ~= 4 then
UIManager.OpenPanel(UIName.TrialRewardBackPopup,msg.drop,function() if msg.drop and #msg.drop.itemlist > 0 then
UIManager.OpenPanel(UIName.TrialRewardBackPopup,msg.drop,function()
if ctrlView.GetCallListCount() > 1 then
PopupTipPanel.ShowTip(Language[11258])
return
end
this.SetEndlessShow()
end)
else
if ctrlView.GetCallListCount() > 1 then if ctrlView.GetCallListCount() > 1 then
PopupTipPanel.ShowTip(Language[11258]) PopupTipPanel.ShowTip(Language[11258])
return return
end end
this.SetEndlessShow() this.SetEndlessShow()
end) end
else else
if ctrlView.GetCallListCount() > 1 then if ctrlView.GetCallListCount() > 1 then
PopupTipPanel.ShowTip(Language[11258]) PopupTipPanel.ShowTip(Language[11258])

View File

@ -20,12 +20,11 @@ local upStarRankUpConfig={}--即将要升星的数据
local curStarRankUpConfig={}--当前升星的数据 local curStarRankUpConfig={}--当前升星的数据
local curTuPoRankUpConfig={}--当前突破的数据 local curTuPoRankUpConfig={}--当前突破的数据
--长按升级状态 --长按升级状态
local _isClicked = false local _isClicked = false --是否点击
local _isReqLvUp = false local _isReqLvUp = false
local _isLongPress = false local _isLongPress = false --是否长按
this.timePressStarted = 0--监听长按事件 this.timePressStarted = 0--监听长按事件
this.priThread = nil--协同程序播放升级属性提升值动画用 this.priThread = nil--协同程序播放升级属性提升值动画用
local isTriggerLongClick = false--长按是否升过级
local oldLv = 0 local oldLv = 0
local curHeroData--当前英雄信息 local curHeroData--当前英雄信息
local parent = {} local parent = {}
@ -33,7 +32,7 @@ local isUpZhen = false--当前英雄是否上阵
local isHeroUpStar local isHeroUpStar
local herodatas = {} local herodatas = {}
this.isPressed = false this.isPressed = false
local timer = 0
local proSort = { local proSort = {
[1] = HeroProType.Attack, [1] = HeroProType.Attack,
[2] = HeroProType.Hp, [2] = HeroProType.Hp,
@ -138,34 +137,32 @@ function RoleInfoLayout:BindEvent()
PopupTipPanel.ShowTip("神将正在共鸣中,无法升级!") PopupTipPanel.ShowTip("神将正在共鸣中,无法升级!")
return return
end end
if Time.realtimeSinceStartup - RoleInfoLayout.timePressStarted <= 0.4 then
this:LvUpClick(true)
end
end) end)
--长按升级按下状态 --长按升级按下状态
this._onPointerDown = function(Pointgo, data) this._onPointerDown = function(Pointgo, data)
if this.isGongMing then if this.isGongMing then
return return
end end
isTriggerLongClick = false _isLongPress = false
_isClicked = true _isClicked = true
RoleInfoLayout.timePressStarted = Time.realtimeSinceStartup this.timePressStarted = Time.realtimeSinceStartup
oldLv = curHeroData.lv oldLv = curHeroData.lv
this.isPressed = true this.isPressed = true
timer = 0
_isReqLvUp = false
end end
--长按升级抬起状态 --长按升级抬起状态
this._onPointerUp = function(Pointgo, data) this._onPointerUp = function(Pointgo, data)
if this.isGongMing then if Time.realtimeSinceStartup - RoleInfoLayout.timePressStarted <= 0.4 then
PopupTipPanel.ShowTip("神将正在共鸣中,无法升级!") this:LvUpClick(false)
return
end end
if _isLongPress and isTriggerLongClick then if _isReqLvUp then
--连续升级抬起请求升级
this:LongLvUpClick(oldLv) this:LongLvUpClick(oldLv)
end end
_isClicked = false _isClicked = false
_isLongPress = false _isLongPress = false
this.isPressed = false this.isPressed = false
timer = 0
end end
this.upLvTrigger.onPointerDown = this.upLvTrigger.onPointerDown + this._onPointerDown this.upLvTrigger.onPointerDown = this.upLvTrigger.onPointerDown + this._onPointerDown
this.upLvTrigger.onPointerUp = this.upLvTrigger.onPointerUp + this._onPointerUp this.upLvTrigger.onPointerUp = this.upLvTrigger.onPointerUp + this._onPointerUp
@ -400,7 +397,6 @@ function this.UpdateHeroUpStarProUpSkillShow(skillGridGO,skillTabs,passiveSkills
this.skillList[i].skillName.text= GetLanguageStrById(this.skillData[i].skillConfig.Name)--(curSkillData.skillId % 10) this.skillList[i].skillName.text= GetLanguageStrById(this.skillData[i].skillConfig.Name)--(curSkillData.skillId % 10)
this.skillList[i].icon.sprite=this.spLoader:LoadSprite(GetResourcePath(this.skillData[i].skillConfig.Icon))--被动技 this.skillList[i].icon.sprite=this.spLoader:LoadSprite(GetResourcePath(this.skillData[i].skillConfig.Icon))--被动技
if this.skillData[i].state == 0 then if this.skillData[i].state == 0 then
LogGreen("this.skillData[i].star:"..this.skillData[i].star)
local str = NumToChinese[this.skillData[i].star].."" local str = NumToChinese[this.skillData[i].star]..""
if this.skillData[i].star > 11 then if this.skillData[i].star > 11 then
str = "飞升"..NumToChinese[this.skillData[i].star - 11] str = "飞升"..NumToChinese[this.skillData[i].star - 11]
@ -500,20 +496,21 @@ function RoleInfoLayout:GetCurHeroUpLvOrUpStarSData()
if v.Star==curHeroData.heroConfig.Star then--初始星级相等 if v.Star==curHeroData.heroConfig.Star then--初始星级相等
if v.Show==1 then -- 1 突破 if v.Show==1 then -- 1 突破
if v.Id ~= curHeroData.breakId and curHeroData.lv == v.LimitLevel then--and curHeroData.star == v.LimitStar if v.Id ~= curHeroData.breakId and curHeroData.lv == v.LimitLevel then--and curHeroData.star == v.LimitStar
--Log("突破 "..v.Id) -- Log("突破 "..v.Id)
isHeroUpTuPo = true isHeroUpTuPo = true
upTuPoRankUpConfig = v upTuPoRankUpConfig = v
end end
end end
if v.Show==2 then -- 2 升星 if v.Show==2 then -- 2 升星
if v.Id ~= curHeroData.upStarId and curHeroData.star == v.LimitStar then if v.Id ~= curHeroData.upStarId and curHeroData.star == v.LimitStar then
--Log("升星 "..v.Id) -- Log("升星 "..v.Id)
upStarRankUpConfig=v upStarRankUpConfig=v
isHeroUpStar=true isHeroUpStar=true
end end
end end
end end
end end
-- Log("isHeroUpTuPo"..tostring(isHeroUpTuPo).." isHeroUpStar:"..tostring(isHeroUpStar))
end end
--更新英雄升级 和 突破数据 --更新英雄升级 和 突破数据
@ -530,15 +527,14 @@ function this:UpdateHeroUpLvAndBreakData()
_isReqLvUp = false _isReqLvUp = false
else else
this.itemGrid.gameObject:SetActive(true) this.itemGrid.gameObject:SetActive(true)
-- if curHeroData.lv < 30 then--策划规定三十级之前一直显示持续长按可快速升级
-- this.tipUpLv.gameObject:SetActive(false)
-- this.tipUpLv.text = Language[11807]
-- else
-- this.tipUpLv.gameObject:SetActive(false)
-- end
this.tipUpLv.gameObject:SetActive(false) this.tipUpLv.gameObject:SetActive(false)
this.upLvBtnText.text=Language[11063] if isHeroUpTuPo and upTuPoRankUpConfig and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
this.upLvBtnImage.sprite = this.spLoader:LoadSprite("r_hero_button_002") this.upLvBtnText.text=Language[11805]
this.upLvBtnImage.sprite = this.spLoader:LoadSprite("r_hero_button_001")--r_chouka_button_004
else
this.upLvBtnText.text=Language[11063]
this.upLvBtnImage.sprite = this.spLoader:LoadSprite("r_hero_button_002")
end
if isHeroUpStar and upStarRankUpConfig and curTuPoRankUpConfig and curTuPoRankUpConfig.JudgeClass==1 and curHeroData.lv >= curTuPoRankUpConfig.OpenLevel then--当前突破全部完成 if isHeroUpStar and upStarRankUpConfig and curTuPoRankUpConfig and curTuPoRankUpConfig.JudgeClass==1 and curHeroData.lv >= curTuPoRankUpConfig.OpenLevel then--当前突破全部完成
if curStarRankUpConfig then--进阶过处理 if curStarRankUpConfig then--进阶过处理
if curHeroData.lv == curStarRankUpConfig.OpenLevel then if curHeroData.lv == curStarRankUpConfig.OpenLevel then
@ -560,24 +556,25 @@ end
--升级按钮点击事件处理 --升级按钮点击事件处理
function RoleInfoLayout:LvUpClick(isSingleLvUp) function RoleInfoLayout:LvUpClick(isSingleLvUp)
--是否为最大等级
-- --LogGreen("isSingleLvUp "..tostring(isSingleLvUp))
if curHeroData.lv>=HeroManager.heroLvEnd[curHeroData.heroConfig.Id] then if curHeroData.lv>=HeroManager.heroLvEnd[curHeroData.heroConfig.Id] then
PopupTipPanel.ShowTip(Language[11788]) PopupTipPanel.ShowTip(Language[11788])
_isClicked = false _isClicked = false
_isReqLvUp = false _isLongPress = false
this.isPressed = false
timer = 0
return return
end end
--如果此时需要进阶 每次都要跳转 --可以升星 是当前星级突破已满,等级也到了突破最大等级
if isHeroUpStar and upStarRankUpConfig and curTuPoRankUpConfig and curTuPoRankUpConfig.JudgeClass==1 and curHeroData.lv >= curTuPoRankUpConfig.OpenLevel then--当前突破全部完成 if isHeroUpStar and upStarRankUpConfig and curTuPoRankUpConfig and curTuPoRankUpConfig.JudgeClass==1 and curHeroData.lv >= curTuPoRankUpConfig.OpenLevel then--当前突破全部完成
if curStarRankUpConfig then--进阶过处理 if curStarRankUpConfig then--进阶过处理
--等级到达当前星级开放的最大等级
if curHeroData.lv == curStarRankUpConfig.OpenLevel then if curHeroData.lv == curStarRankUpConfig.OpenLevel then
--是否能升星
if curHeroData.star >= curHeroData.heroConfig.MaxRank then if curHeroData.star >= curHeroData.heroConfig.MaxRank then
MsgPanel.ShowOne("当前神将已达最大星级") MsgPanel.ShowOne("当前神将已达最大星级")
return return
end end
_isClicked = false _isClicked = false
_isReqLvUp = false
local showTipStr = Language[11808] local showTipStr = Language[11808]
local showIndex = RoleInfoPanelIndex.jinjie local showIndex = RoleInfoPanelIndex.jinjie
local showBtnTipStr = Language[11809] local showBtnTipStr = Language[11809]
@ -603,17 +600,9 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp)
end end
else else
if isUpLvMaterials then if isUpLvMaterials then
if isSingleLvUp then--是否是单次升级 this:DeleteLvUpMaterials()
NetManager.HeroLvUpEvent(curHeroData.dynamicId,curHeroData.lv + 1,curHeroData.lv,function (msg)
this:DeleteLvUpMaterials(isSingleLvUp,msg)
end)
else
isTriggerLongClick = true
this:DeleteLvUpMaterials(isSingleLvUp)
end
else else
_isClicked = false _isClicked = false
_isReqLvUp = false
if isHeroUpTuPo and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then if isHeroUpTuPo and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
PopupTipPanel.ShowTip(Language[11813]) PopupTipPanel.ShowTip(Language[11813])
else else
@ -623,36 +612,34 @@ function RoleInfoLayout:LvUpClick(isSingleLvUp)
end end
else--从未进阶过处理 else--从未进阶过处理
_isClicked = false _isClicked = false
_isReqLvUp = false
MsgPanel.ShowTwo(Language[11808], nil, function() MsgPanel.ShowTwo(Language[11808], nil, function()
parent:SetSelectBtn(RoleInfoPanelIndex.jinjie) parent:SetSelectBtn(RoleInfoPanelIndex.jinjie)
parent:OnPageTabChange(RoleInfoPanelIndex.jinjie) parent:OnPageTabChange(RoleInfoPanelIndex.jinjie)
end,Language[10731],Language[11809]) end,Language[10731],Language[11809])
end end
else elseif isHeroUpTuPo and oldLv == upTuPoRankUpConfig.LimitLevel then --点击按钮之前的等级 == 突破最大等级 说明是突破
_isClicked = false
_isLongPress = false
this.isPressed = false
timer = 0
if isUpLvMaterials then if isUpLvMaterials then
if isSingleLvUp then--是否是单次升级 this:DeleteLvUpMaterials()
local curUpLv = curHeroData.lv
if isHeroUpTuPo and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
curUpLv = curHeroData.lv
else
curUpLv = curHeroData.lv + 1
end
NetManager.HeroLvUpEvent(curHeroData.dynamicId,curUpLv,curHeroData.lv,function (msg)
this:DeleteLvUpMaterials(isSingleLvUp,msg)
end)
else
isTriggerLongClick = true
this:DeleteLvUpMaterials(isSingleLvUp)
end
else else
PopupTipPanel.ShowTip(Language[11813])
end
_isClicked = false
_isLongPress = false
this.isPressed = false
timer = 0
elseif not isHeroUpTuPo or curHeroData.lv < upTuPoRankUpConfig.LimitLevel then
if isUpLvMaterials then
this:DeleteLvUpMaterials()
else
PopupTipPanel.ShowTip(Language[11814])
_isClicked = false _isClicked = false
_isReqLvUp = false _isLongPress = false
if isHeroUpTuPo and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then this.isPressed = false
PopupTipPanel.ShowTip(Language[11813]) timer = 0
else
PopupTipPanel.ShowTip(Language[11814])
end
end end
end end
end end
@ -663,40 +650,26 @@ function RoleInfoLayout:LongLvUpClick(oldLv)
end) end)
end end
--扣除升级 突破 消耗的材料 更新英雄数据 --扣除升级 突破 消耗的材料 更新英雄数据
function RoleInfoLayout:DeleteLvUpMaterials(isSingleLvUp,msg) function RoleInfoLayout:DeleteLvUpMaterials()
if isSingleLvUp == false then--连续升级的时候需要自己先扣除 _isReqLvUp = true
for i = 1, #costItemList do for i = 1, #costItemList do
--Log(string.format("扣除id=%s 数量=%s",costItemList[i][1],costItemList[i][2])) --Log(string.format("扣除id=%s 数量=%s",costItemList[i][1],costItemList[i][2]))
BagManager.HeroLvUpUpdateItemsNum(costItemList[i][1],costItemList[i][2]) BagManager.HeroLvUpUpdateItemsNum(costItemList[i][1],costItemList[i][2])
end
end end
-- for i, v in pairs(heroDatas) do if isHeroUpTuPo and upTuPoRankUpConfig and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
-- if curHeroData == v then UIManager.OpenPanel(UIName.RoleUpLvBreakSuccessPanel,curHeroData,upTuPoRankUpConfig.Id,upTuPoRankUpConfig.OpenLevel)
if isHeroUpTuPo and upTuPoRankUpConfig and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then curHeroData.breakId=upTuPoRankUpConfig.Id
UIManager.OpenPanel(UIName.RoleUpLvBreakSuccessPanel,curHeroData,upTuPoRankUpConfig.Id,upTuPoRankUpConfig.OpenLevel) curHeroData.breakId=curHeroData.breakId
curHeroData.breakId=upTuPoRankUpConfig.Id if curHeroData.star<upTuPoRankUpConfig.OpenStar then
curHeroData.breakId=curHeroData.breakId curHeroData.star=upTuPoRankUpConfig.OpenStar
--突破有可能会升星 curHeroData.star=curHeroData.star
if curHeroData.star<upTuPoRankUpConfig.OpenStar then end
curHeroData.star=upTuPoRankUpConfig.OpenStar else
curHeroData.star=curHeroData.star curHeroData.lv=curHeroData.lv + 1
end PopupTipPanel.ShowTip(Language[11867])
_isClicked = false end
_isReqLvUp = false
else
if msg then
curHeroData.lv=msg.targetLevel
-- Log("后端更新猎妖师技术前端刷新界面targetLevel "..msg.targetLevel)
else
curHeroData.lv=curHeroData.lv + 1
-- Log("后端更新猎妖师技术前端刷新界面curHeroData.lv "..curHeroData.lv)
end
-- curHeroData.lv=curHeroData.lv
-- PopupTipPanel.ShowTip("升级成功!")
PopupTipPanel.ShowTip(Language[11867])
end
-- end
-- end
--Log("刷新英雄库里单个英雄数据 "..curHeroData.dynamicId.." "..curHeroData.lv.." "..curHeroData.star.." "..curHeroData.breakId.." "..curHeroData.upStarId) --Log("刷新英雄库里单个英雄数据 "..curHeroData.dynamicId.." "..curHeroData.lv.." "..curHeroData.star.." "..curHeroData.breakId.." "..curHeroData.upStarId)
--刷新英雄库里单个英雄数据 --刷新英雄库里单个英雄数据
if isHeroUpTuPo and upTuPoRankUpConfig and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then if isHeroUpTuPo and upTuPoRankUpConfig and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
@ -708,22 +681,10 @@ function RoleInfoLayout:DeleteLvUpMaterials(isSingleLvUp,msg)
-- 升级音效 -- 升级音效
PlaySoundWithoutClick(SoundConfig.Sound_Upgrade) PlaySoundWithoutClick(SoundConfig.Sound_Upgrade)
end end
if msg then HeroManager.UpdateSingleHeroDatas(curHeroData.dynamicId,curHeroData.lv,curHeroData.star,curHeroData.breakId,curHeroData.upStarId,true)
HeroManager.UpdateSingleHeroDatas(curHeroData.dynamicId,msg.targetLevel,curHeroData.star,curHeroData.breakId,curHeroData.upStarId,isSingleLvUp)
else
HeroManager.UpdateSingleHeroDatas(curHeroData.dynamicId,curHeroData.lv,curHeroData.star,curHeroData.breakId,curHeroData.upStarId,isSingleLvUp)
end
local allAddProValOld = allAddProVal local allAddProValOld = allAddProVal
parent:UpdateHeroInfoData()--刷新界面 parent:UpdateHeroInfoData()--刷新界面
this.ShowProAddVal(allAddProValOld) this.ShowProAddVal(allAddProValOld)
if isSingleLvUp then
parent.upLvEffect:SetActive(false)
parent.upLvEffect:SetActive(true)
end
-- _isReqLvUp = false
Timer.New(function()
_isReqLvUp = false
end, 0.1):Start()
end end
--连续升级更新后端英雄数据 --连续升级更新后端英雄数据
@ -746,17 +707,23 @@ function RoleInfoLayout:DeleteLvUpMaterials2(msg)
parent.upLvEffect:SetActive(false) parent.upLvEffect:SetActive(false)
parent.upLvEffect:SetActive(true) parent.upLvEffect:SetActive(true)
end end
local oldFrame = 0
--长按升级处理 --长按升级处理
function this.OnUpdate() function this.OnUpdate()
if _isClicked then if _isClicked then
if Time.realtimeSinceStartup - RoleInfoLayout.timePressStarted > 0.4 then --长按
_isLongPress = true if Time.realtimeSinceStartup - this.timePressStarted > 0.4 then
if not _isReqLvUp then if timer <= 0 then
_isReqLvUp = true timer = timer + 0.2
this:LvUpClick(false) _isLongPress = true
this:LvUpClick(false)
end
if Time.frameCount - oldFrame > 0 then
oldFrame = Time.frameCount
timer = timer - Time.deltaTime
end end
end end
end end
end end
--播放升级 属性提升动画 --播放升级 属性提升动画
function this.ShowProAddVal(allAddProValOld) function this.ShowProAddVal(allAddProValOld)