【七界试炼】战斗层数锁住了

dev_chengFeng
ZhangBiao 2021-09-16 21:05:43 +08:00
parent 60c954bf38
commit 4d8576d200
3 changed files with 54 additions and 28 deletions

View File

@ -163,6 +163,8 @@ function JumpServerPanel:BtnClick(id)
if id == JumpServer_Type.QiJieShiLian then if id == JumpServer_Type.QiJieShiLian then
local qiejieConfig = ConfigManager.GetConfig(ConfigName.QijieStage) local qiejieConfig = ConfigManager.GetConfig(ConfigName.QijieStage)
NetManager.SevenWorldInfoRequest(0,function (msg) NetManager.SevenWorldInfoRequest(0,function (msg)
QiJieShiLianManager.IsLock = false
QiJieShiLianManager.curLockStageId = QiJieShiLianManager.curLevelId
if qiejieConfig[msg.id] then if qiejieConfig[msg.id] then
UIManager.OpenPanel(UIName.QiJieShiLianPanel) UIManager.OpenPanel(UIName.QiJieShiLianPanel)
else else

View File

@ -16,6 +16,9 @@ function this.Initialize()
this.curScore = 1 this.curScore = 1
this.QijieType = 1 this.QijieType = 1
this.curProgress = 0 this.curProgress = 0
this.curMaxStage = 0
this.curLockStageId = 0
this.IsLock = false
this.treasureList = {} this.treasureList = {}
this.treasureActiveList = {} this.treasureActiveList = {}
@ -45,7 +48,7 @@ function this.InitTreasureData()
end end
--界面获取信息 --界面获取信息
function this.GetQiJieData(targetLevel) function this.GetQiJieData()
--上阵列表赋值 --上阵列表赋值
local curFormation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_NORMAL) local curFormation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_NORMAL)
if FormationManager.GetFormationByID(FormationTypeDef.FORMATION_QIJIESHILIAN) then if FormationManager.GetFormationByID(FormationTypeDef.FORMATION_QIJIESHILIAN) then
@ -71,13 +74,8 @@ function this.GetServerData(msg)
this.curRank = msg.ranking this.curRank = msg.ranking
this.curScore = msg.integral this.curScore = msg.integral
this.curProgress = msg.totalTier this.curProgress = msg.totalTier
LogRed("id:"..tostring(msg.id).." ranking:"..tostring(msg.ranking).." integral:"..tostring(msg.integral).." totalTier:"..tostring(msg.totalTier)) this.curMaxStage = this.curMaxStage >= msg.id and this.curMaxStage or msg.id
end -- LogRed("id:"..tostring(msg.id).." ranking:"..tostring(msg.ranking).." integral:"..tostring(msg.integral).." totalTier:"..tostring(msg.totalTier))
function this.CheckCurStageNum()
local data = ConfigManager.GetAllConfigsDataByKey(ConfigName.QijieStage,"QijieType",this.QijieType)
-- LogGreen(tostring(#data)..LengthOfTable(data))
-- return ConfigManager.GetAllConfigsDataByKey(ConfigName.QijieStage,"QijieType",this.QijieType)
end end
--获取下方滑动条数据 --获取下方滑动条数据
@ -227,7 +225,7 @@ function this.GetTreasureEffect(treasureList)
-- LogGreen("2") -- LogGreen("2")
attriList1[tData.AttriType].title = tData.Desc attriList1[tData.AttriType].title = tData.Desc
if not attriList1[tData.AttriType].ValueList then if not attriList1[tData.AttriType].ValueList then
LogGreen("3,tData.AttriType"..tostring(tData.AttriType)) -- LogGreen("3,tData.AttriType"..tostring(tData.AttriType))
attriList1[tData.AttriType].ValueList = {} attriList1[tData.AttriType].ValueList = {}
end end
-- LogGreen("4,tData.Buff:"..tostring(tData.Buff)) -- LogGreen("4,tData.Buff:"..tostring(tData.Buff))
@ -278,4 +276,35 @@ function this.GetSring(stringList,type)
return str return str
end end
--左右切换检测
function this.SwitchBtnCheck(num,func)
if num == -1 then
this.IsLock = true
if not QijieStage[this.curLockStageId - 1] then
LogPink("最低层"..this.curLockStageId)
return
end
this.curLockStageId = this.curLockStageId - 1
elseif num == 1 then
if not QijieStage[this.curLockStageId + 1] then
LogPink("最高层"..this.curLockStageId)
return
end
if this.curLockStageId + 1 > this.curMaxStage then
LogPink("最大层"..this.curLockStageId.." "..this.curMaxStage)
return
end
if this.curMaxStage == this.curLevelId then
this.IsLock = false
end
this.curLockStageId = this.curLockStageId + 1
end
LogYellow("请求的Id:"..tostring(this.curLockStageId))
NetManager.SevenWorldInfoRequest(this.curLockStageId,function ()
if func then
func()
end
end)
end
return QiJieShiLianManager return QiJieShiLianManager

View File

@ -128,21 +128,14 @@ function QiJieShiLianPanel:BindEvent()
end end
end) end)
Util.AddClick(self.lastBtn,function() Util.AddClick(self.lastBtn,function()
self.tempId = self.tempId - 1 QiJieShiLianManager.SwitchBtnCheck(-1,function ()
if self.curStage - 1 > 0 then
self.curStage = self.curStage - 1
self:Refresh() self:Refresh()
else end)
PopupTipPanel.ShowTip("当前为第一层!")
end
end) end)
Util.AddClick(self.nextBtn,function() Util.AddClick(self.nextBtn,function()
if self.curStage + 1 <= QiJieShiLianManager.CheckCurStageNum() then QiJieShiLianManager.SwitchBtnCheck(1,function ()
self.curStage = self.curStage + 1
self:Refresh() self:Refresh()
else end)
PopupTipPanel.ShowTip("当前为最终层!")
end
end) end)
end end
@ -161,21 +154,23 @@ end
--界面打开时调用(用于子类重写) --界面打开时调用(用于子类重写)
function QiJieShiLianPanel:OnShow() function QiJieShiLianPanel:OnShow()
self.curStage = 0 if QiJieShiLianManager.IsLock then
NetManager.SevenWorldInfoRequest(0) NetManager.SevenWorldInfoRequest(QiJieShiLianManager.curLockStageId)
else
NetManager.SevenWorldInfoRequest(0)
QiJieShiLianManager.curLockStageId = QiJieShiLianManager.curLevelId
end
self:Refresh() self:Refresh()
end end
function QiJieShiLianPanel:Refresh(targetLevel) function QiJieShiLianPanel:Refresh()
if targetLevel then self.qijieData = QiJieShiLianManager.GetQiJieData()
LogPink("targetLevel:"..tostring(targetLevel))
end
self.qijieData = QiJieShiLianManager.GetQiJieData(targetLevel)
self.curStage = self.qijieData.curStageData.QijieType
self.configData = self.qijieData.curStageData self.configData = self.qijieData.curStageData
LogGreen("当前层数Id:"..tostring(self.qijieData.curLevelId).." tempId:"..tostring(self.tempId)) LogGreen("当前层数Id:"..tostring(self.qijieData.curLevelId).." tempId:"..tostring(self.tempId))
local num = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,128).Value) local num = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,128).Value)
self.giftBtn:SetActive(self.qijieData.curProgress >= num) self.giftBtn:SetActive(self.qijieData.curProgress >= num)
self.lastBtn:SetActive(not not QijieStage[QiJieShiLianManager.curLevelId-1])
self.nextBtn:SetActive(QiJieShiLianManager.curMaxStage~=QiJieShiLianManager.curLevelId)
self:SetTabBox() self:SetTabBox()
self:SetTopBar() self:SetTopBar()
self:SetBottomBar() self:SetBottomBar()