挑战副本脚本修改
parent
b4a626d9e2
commit
b907383826
|
@ -594,6 +594,8 @@ function this.ShowBattleResult(result, msg)
|
|||
this.ShowBattleResultByTaSuiLingXiao()
|
||||
elseif fightType == BATTLE_TYPE.LINGMAIMIJING then
|
||||
this:ClosePanel()
|
||||
elseif fightType == BATTLE_TYPE.CHALLENG_COPY_1 or fightType == BATTLE_TYPE.CHALLENG_COPY_2 then
|
||||
this:ClosePanel()
|
||||
else
|
||||
LogRed("result:"..tostring(result))
|
||||
if result == 0 then -- 失败
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
require("Base/BasePanel")
|
||||
ChallengeCopyPanel = Inherit(BasePanel)
|
||||
local this = ChallengeCopyPanel
|
||||
local dailyChallengeConfig=ConfigManager.GetConfig(ConfigName.DailyChallengeConfig)
|
||||
local mainLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig)
|
||||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local specialConfig=ConfigManager.GetConfig(ConfigName.SpecialConfig)
|
||||
|
@ -11,6 +10,7 @@ local curData={}
|
|||
local orginLayer=0
|
||||
|
||||
local carbonIndex=0-- 1 无尽副本 2 金币副本 副本索引id
|
||||
local fightIndex=1 --关卡索引
|
||||
local maxForce = 0
|
||||
--顶部背景图
|
||||
local titleBg={
|
||||
|
@ -113,7 +113,7 @@ function ChallengeCopyPanel:OnShow()
|
|||
this.TabCtrl:SetTabAdapter(this.TabAdapter)
|
||||
this.TabCtrl:SetTabIsLockCheck(this.TabIsLockCheck)
|
||||
this.TabCtrl:SetChangeTabCallBack(function(index)
|
||||
this.RefreshShow(index, true,true)
|
||||
this.RefreshShow(index)
|
||||
end)
|
||||
this.TabCtrl:Init(this.tabBox, _TabData,carbonIndex)
|
||||
-- 音效
|
||||
|
@ -140,41 +140,34 @@ function ChallengeCopyPanel:OnDestroy()
|
|||
end
|
||||
|
||||
function this.FiveRefresh()
|
||||
this.RefreshShow(1,false,false)
|
||||
ChallengeCopyPanel:RefreshRedPotShow()
|
||||
this.RefreshShow(carbonIndex)
|
||||
end
|
||||
|
||||
--刷新面板
|
||||
function this.RefreshShow(i,isTop,isAni)
|
||||
function this.RefreshShow(i)
|
||||
carbonIndex = i
|
||||
LogBlue("~~~-------~carbonIndex:"..carbonIndex)
|
||||
local challengeStageId=CarbonManager.challengeCopyDataTable[carbonIndex].currentFloor
|
||||
if challengeStageId>0 then
|
||||
fightIndex= ConfigManager.GetConfigData(ConfigName.ChallengeStage,challengeStageId).Section
|
||||
end
|
||||
curData={}
|
||||
curData=ConfigManager.GetAllConfigsDataByKey(ConfigName.ChallengeStage,"Chapter",i)
|
||||
|
||||
this.titleBg.sprite=this.spLoader:LoadSprite(titleBg[i].bg)
|
||||
this.titleImg.sprite=this.spLoader:LoadSprite(titleBg[i].titleImg)
|
||||
this.titleTip.text=titleBg[i].titleTip
|
||||
this.SetTimeTip()
|
||||
this.SetScroll(i,isTop,isAni)
|
||||
this.SetScroll(fightIndex)
|
||||
ChallengeCopyPanel:RefreshRedPotShow()
|
||||
end
|
||||
|
||||
|
||||
--设置滚动条
|
||||
local curMaxOpenId = 0
|
||||
function this.SetScroll(i,isTop,isAni)
|
||||
function this.SetScroll(i)
|
||||
LogRed("列表索引:"..i)
|
||||
this.scrollView:SetData(curData,function(index,root)
|
||||
this.SetData(root,curData[index], curData[index - 1])
|
||||
end,not isTop,not isAni)
|
||||
for k,v in ipairs(curData) do
|
||||
if not CarbonManager.IsDailyCarbonPass(v.Id) then
|
||||
curMaxOpenId = k
|
||||
break
|
||||
end
|
||||
end
|
||||
if CarbonManager.IsDailyCarbonPass(curData[#curData].Id) then
|
||||
curMaxOpenId = #curData
|
||||
end
|
||||
this.scrollView:SetIndex(curMaxOpenId - 2 < 1 and 1 or (curMaxOpenId - 2))
|
||||
end,false,false)
|
||||
this.scrollView:SetIndex(i)
|
||||
end
|
||||
|
||||
--设置滚动条数据 root根节点 data本地表数据
|
||||
|
|
|
@ -68,13 +68,11 @@ function this.StartFight()
|
|||
end
|
||||
UIManager.OpenPanel(UIName.BattlePanel, fightData, battleType , function()
|
||||
LogGreen("222222战斗结果:"..msg.result)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
||||
if msg.result==1 then
|
||||
CarbonManager.UpdateChallengeCopyFloor(this.data.Chapter)
|
||||
end
|
||||
-- this.RefreshShow(carbonIndex,false,false)
|
||||
end)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1)
|
||||
end)
|
||||
if msg.result==1 then
|
||||
CarbonManager.UpdateChallengeCopyFloor(this.data.Chapter)
|
||||
end
|
||||
this.root:ClosePanel()
|
||||
end)
|
||||
end
|
||||
|
|
|
@ -57,7 +57,8 @@ function BattleWinPopup:NextStep()
|
|||
this.ShowBattleResultByExpedition(m_battleResult.drop)
|
||||
elseif m_fightType == BATTLE_TYPE.DAILY_CHALLENGE
|
||||
or m_fightType == BATTLE_TYPE.XUAN_YUAN_MIRROR
|
||||
or m_fightType == BATTLE_TYPE.TRIAL_FIGHT then -- 日常副本
|
||||
or m_fightType == BATTLE_TYPE.TRIAL_FIGHT -- 日常副本
|
||||
or m_fightType == BATTLE_TYPE.CHALLENG_COPY_2 then
|
||||
m_battlePanel:ClosePanel() self:ClosePanel(m_battleResult.drop)
|
||||
elseif m_fightType == BATTLE_TYPE.GUILD_CAR_DELAY then -- 车迟
|
||||
this.ShowBattleResultByCarDeleayType(m_battleResult.drop)
|
||||
|
|
|
@ -862,6 +862,9 @@ end
|
|||
--获取商品已购买次数
|
||||
function this.GetShopItemHadBuyTimes(shopType, itemId)
|
||||
local shopData = this.GetShopDataByType(shopType)
|
||||
if not shopData then
|
||||
return 0
|
||||
end
|
||||
for _, v in ipairs(shopData.storeItem) do
|
||||
if v.id == itemId then
|
||||
return v.buyNum
|
||||
|
|
Loading…
Reference in New Issue