【工會技能】长按升级bug

dev_chengFeng
zhangqiang 2020-12-31 15:29:08 +08:00
parent 694320d99c
commit 7402a7ce6c
1 changed files with 6 additions and 23 deletions

View File

@ -94,10 +94,10 @@ function GuildSkillUpLvPopup:BindEvent()
end end
--长按升级抬起状态 --长按升级抬起状态
this._onPointerUp = function(Pointgo, data) this._onPointerUp = function(Pointgo, data)
LogPink("连续升级抬起请求升级 "..tostring(_isLongPress)) -- LogPink("连续升级抬起请求升级 "..tostring(_isLongPress))
if _isLongPress then--and isTriggerLongClick if _isLongPress then--and isTriggerLongClick
--连续升级抬起请求升级 --连续升级抬起请求升级
LogPink("连续升级抬起请求升级 ") -- LogPink("连续升级抬起请求升级 ")
this.LongLvUpClick(oldLv) this.LongLvUpClick(oldLv)
end end
_isClicked = false _isClicked = false
@ -105,7 +105,6 @@ function GuildSkillUpLvPopup:BindEvent()
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
FixedUpdateBeat:Add(this.OnUpdate, self)--长按方法注册
Util.AddClick(this.btnRest,function() Util.AddClick(this.btnRest,function()
@ -120,6 +119,7 @@ function GuildSkillUpLvPopup:BindEvent()
this.OnClickTabBtn(curIndex,true) this.OnClickTabBtn(curIndex,true)
this.RefreshTabRedPoint() this.RefreshTabRedPoint()
Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName) Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName)
oldWarPowerValue = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
end) end)
end) end)
end end
@ -136,6 +136,7 @@ function GuildSkillUpLvPopup:OnOpen(_curIndex)
GuildSkillManager.UpdataHeroProList = {} GuildSkillManager.UpdataHeroProList = {}
curIndex = _curIndex or 1 curIndex = _curIndex or 1
tabRedPotList = {} tabRedPotList = {}
FixedUpdateBeat:Add(this.OnUpdate, self)--长按方法注册
end end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写) --界面打开或者重新打开后,界面刷新时调用(用于子类重写)
@ -151,7 +152,6 @@ function this.OnUpdate()
if _isClicked then if _isClicked then
if Time.realtimeSinceStartup - this.timePressStarted > 0.4 then if Time.realtimeSinceStartup - this.timePressStarted > 0.4 then
_isLongPress = true _isLongPress = true
-- LogPink("_isReqLvUp "..tostring(_isReqLvUp))
if not _isReqLvUp then if not _isReqLvUp then
_isReqLvUp = true _isReqLvUp = true
this.LvUpClick(false) this.LvUpClick(false)
@ -300,6 +300,7 @@ function this.LongLvUpClick(oldLv)
this.OnClickTabBtn(curIndex,true) this.OnClickTabBtn(curIndex,true)
this.RefreshTabRedPoint(curIndex) this.RefreshTabRedPoint(curIndex)
_isReqLvUp = false _isReqLvUp = false
newWarPowerValue = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
if oldWarPowerValue ~= newWarPowerValue then if oldWarPowerValue ~= newWarPowerValue then
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPowerValue,newValue = newWarPowerValue}) UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPowerValue,newValue = newWarPowerValue})
Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName) Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName)
@ -318,32 +319,14 @@ function this.LvUpClick(isSingleLvUp)
PopupTipPanel.ShowTip(ConfigManager.GetConfigData(ConfigName.ItemConfig,materialNoId).Name..Language[11085]) PopupTipPanel.ShowTip(ConfigManager.GetConfigData(ConfigName.ItemConfig,materialNoId).Name..Language[11085])
if not isSingleLvUp then if not isSingleLvUp then
this.LongLvUpClick(oldLv) this.LongLvUpClick(oldLv)
_isClicked = false
_isLongPress = false
end end
return return
end end
-- NetManager.SinGleGuildSkillUpLv(curIndex,function(msg)
-- PopupTipPanel.ShowTip(Language[11086])
-- GuildSkillManager.SetSkillDataLv(curIndex,curSeletSkill.id,curSeletSkill.level + 1)
-- this.OnClickTabBtn(curIndex,true)
-- this.RefreshTabRedPoint(curIndex)
-- newWarPowerValue = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
-- if oldWarPowerValue ~= newWarPowerValue then
-- UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPowerValue,newValue = newWarPowerValue})
-- Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName)
-- oldWarPowerValue = newWarPowerValue
-- end
-- Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName)
-- -- CheckRedPointStatus(RedPointType.Guild_Skill)
-- end)
if isMaxLv then if isMaxLv then
if not isSingleLvUp then if not isSingleLvUp then
this.LongLvUpClick(oldLv) this.LongLvUpClick(oldLv)
_isClicked = false
_isLongPress = false
end end
return return
end end
@ -361,7 +344,7 @@ function this.LvUpClick(isSingleLvUp)
oldWarPowerValue = newWarPowerValue oldWarPowerValue = newWarPowerValue
end end
Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName) Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName)
-- CheckRedPointStatus(RedPointType.Guild_Skill) -- CheckRedPointStatus(RedPointType.Guild_Skill)
end) end)
else else
--前端先扣除材料 --前端先扣除材料