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()
Util.AddClick(this.BtnBack, function()
NetManager.RequestTrialReward(function(msg)
if msg.drop and #msg.drop.itemlist > 0 then
UIManager.OpenPanel(UIName.TrialRewardBackPopup,msg.drop,function()
if CarbonManager.difficulty ~= 4 then
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
PopupTipPanel.ShowTip(Language[11258])
return
end
this.SetEndlessShow()
end)
end
else
if ctrlView.GetCallListCount() > 1 then
PopupTipPanel.ShowTip(Language[11258])

View File

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