From 93fda69ff53ed762bec4d530a76f05362339a721 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Wed, 12 Jan 2022 13:37:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=AA=81=E7=A0=B4?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/RoleInfo/RoleInfoLayout.lua | 195 ++++++++---------- 1 file changed, 81 insertions(+), 114 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua index 0f6bb9f27c..a40bf3c7c2 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua @@ -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 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) From bde65d0ecfcb78577b3e5fe2b7250279539a44ae Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Wed, 12 Jan 2022 13:49:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A3=AE=E7=BD=97=E5=B9=BB=E5=A2=83?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E5=A5=96=E5=8A=B1=E4=BF=AE=E6=94=B9=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManagedResources/~Lua/Modules/Map/MapPanel.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Map/MapPanel.lua b/Assets/ManagedResources/~Lua/Modules/Map/MapPanel.lua index 48f622c63e..e2b3e37313 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/MapPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/MapPanel.lua @@ -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])