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