每日挑战战斗内部界面
This commit is contained in:
parent
b8bbad816b
commit
13d470ad5b
@ -11,8 +11,8 @@ local BATTLE_CONTROLLER = {
|
||||
[BattleConst.BATTLE_TYPE.DAILY_CHALLENGE] = "app/module/battle/controller/battle_controller_daily_challenge",
|
||||
}
|
||||
|
||||
function BattleManager:showPauseUI()
|
||||
UIManager:showUI("app/ui/battle/battle_pause_ui")
|
||||
function BattleManager:showPauseUI(battleType)
|
||||
UIManager:showUI("app/ui/battle/battle_pause_ui", {battleType = battleType})
|
||||
end
|
||||
|
||||
function BattleManager:showBattleResultUI(rewards, combatReport, mysteryBoxIdx)
|
||||
|
||||
@ -26,11 +26,29 @@ end
|
||||
function BattleControllerDailyChallenge:getBuffs()
|
||||
if not self.initBuffs then
|
||||
self.initBuffs = {}
|
||||
local buffs = DataManager.DailyChallengeData:getTodayBuff()
|
||||
local cfg = ConfigManager:getConfig("buff_daily_challenge")
|
||||
for _, buffId in ipairs(buffs) do
|
||||
local effect = cfg[buffId] and cfg[buffId].effect
|
||||
if effect then
|
||||
local buffEntity = BattleBuffEntity:create()
|
||||
buffEntity:init(effect[1])
|
||||
buffEntity:setTargetSide(cfg[buffId].obj)
|
||||
buffEntity:setIsCantRemove(true)
|
||||
|
||||
table.insert(self.initBuffs, buffEntity)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return self.initBuffs
|
||||
end
|
||||
|
||||
function BattleControllerDailyChallenge:onLoadComplete(...)
|
||||
BattleController.onLoadComplete(self, ...)
|
||||
ModuleManager.DailyChallengeManager:showBattleBuffUI()
|
||||
end
|
||||
|
||||
function BattleControllerDailyChallenge:initOther()
|
||||
local ChapterId = DataManager.DailyChallengeData:getFixedChapterId()
|
||||
local cfg = ConfigManager:getConfig("chapter")[ChapterId]
|
||||
@ -216,7 +234,11 @@ function BattleControllerDailyChallenge:controllBattleEnd()
|
||||
if not self.victory then
|
||||
self.combatReport.wave = self.combatReport.wave - 1
|
||||
end
|
||||
ModuleManager.DailyChallengeManager:endFight(self.chapterId, self.combatReport, self.taskProgress, heroInfo)
|
||||
local lastBossRound = 0
|
||||
if self.victory then
|
||||
lastBossRound = self.waveRoundCount[self.waveIndex]
|
||||
end
|
||||
ModuleManager.DailyChallengeManager:endFight(self.chapterId, self.combatReport, self.taskProgress, heroInfo, lastBossRound)
|
||||
end
|
||||
|
||||
function BattleControllerDailyChallenge:postWaveOver(atkDead, isQuit)
|
||||
|
||||
@ -4,6 +4,15 @@ function DailyChallengeManager:init()
|
||||
-- body
|
||||
end
|
||||
|
||||
function DailyChallengeManager:showBattleBuffUI()
|
||||
UIManager:showUI("app/ui/battle/battle_daily_challenge_buff_ui")
|
||||
end
|
||||
|
||||
function DailyChallengeManager:getBuffDesc(id)
|
||||
local desc = I18N:getText("buff_daily_challenge", id, "desc")
|
||||
return desc
|
||||
end
|
||||
|
||||
-- 开始挑战
|
||||
function DailyChallengeManager:startChallenge()
|
||||
if not DataManager.DailyChallengeData:isEnoughChallengeTime() then
|
||||
@ -42,12 +51,13 @@ function DailyChallengeManager:rspStartChallenge(result)
|
||||
end
|
||||
|
||||
-- 挑战结束
|
||||
function DailyChallengeManager:endChallenge(chapterId, combatReport, taskProgress, heroInfo)
|
||||
function DailyChallengeManager:endChallenge(chapterId, combatReport, taskProgress, heroInfo, lastBossRound)
|
||||
local parmas = {
|
||||
win = combatReport.victory,
|
||||
chapter_id = chapterId,
|
||||
pass_wave = combatReport.wave,
|
||||
hero_info = heroInfo,
|
||||
kills_boss_turn = lastBossRound,
|
||||
combatReport = combatReport,
|
||||
}
|
||||
for fieldName, value in pairs(taskProgress) do
|
||||
@ -62,7 +72,7 @@ function DailyChallengeManager:endChallengeFinish(result)
|
||||
local reqData = result.reqData
|
||||
local rewards = result.rewards
|
||||
ModuleManager.BattleManager:showBattleResultUI(rewards, reqData.combatReport)
|
||||
-- todo
|
||||
DataManager.DailyChallengeData:init(result.daily_challenge)
|
||||
|
||||
ModuleManager.TaskManager:addFightTaskProgress(reqData)
|
||||
end
|
||||
|
||||
44
lua/app/ui/battle/battle_daily_challenge_buff_ui.lua
Normal file
44
lua/app/ui/battle/battle_daily_challenge_buff_ui.lua
Normal file
@ -0,0 +1,44 @@
|
||||
local BattleDailyChallengeBuffUI = class("BattleDailyChallengeBuffUI", BaseUI)
|
||||
|
||||
function BattleDailyChallengeBuffUI:isFullScreen()
|
||||
return false
|
||||
end
|
||||
|
||||
function BattleDailyChallengeBuffUI:getPrefabPath()
|
||||
return "assets/prefabs/ui/battle/battle_daily_challenge_buff_ui.prefab"
|
||||
end
|
||||
|
||||
function BattleDailyChallengeBuffUI:ctor()
|
||||
self.buffDescs = {}
|
||||
for _, id in ipairs(DataManager.DailyChallengeData:getTodayBuff()) do
|
||||
local cfg = ConfigManager:getConfig("buff_daily_challenge")[id]
|
||||
if cfg then
|
||||
self.buffDescs[cfg.buff_type] = ModuleManager.DailyChallengeManager:getBuffDesc(id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function BattleDailyChallengeBuffUI:onLoadRootComplete()
|
||||
self:_display()
|
||||
self:_addListeners()
|
||||
end
|
||||
|
||||
function BattleDailyChallengeBuffUI:_display()
|
||||
local uiMap = self.root:genAllChildren()
|
||||
local buffDescs = {
|
||||
uiMap["battle_daily_challenge_buff_ui.raw_img.desc_1"],
|
||||
uiMap["battle_daily_challenge_buff_ui.raw_img.desc_2"]
|
||||
}
|
||||
for index, obj in ipairs(buffDescs) do
|
||||
obj:setText(self.buffDescs[index])
|
||||
end
|
||||
end
|
||||
|
||||
function BattleDailyChallengeBuffUI:_addListeners()
|
||||
local uiMap = self.root:genAllChildren()
|
||||
uiMap["battle_daily_challenge_buff_ui.mask"]:addClickListener(function()
|
||||
self:closeUI()
|
||||
end)
|
||||
end
|
||||
|
||||
return BattleDailyChallengeBuffUI
|
||||
10
lua/app/ui/battle/battle_daily_challenge_buff_ui.lua.meta
Normal file
10
lua/app/ui/battle/battle_daily_challenge_buff_ui.lua.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f8cfb53ae0f60824da0759e9827d46f5
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
@ -20,6 +20,7 @@ function BattlePauseUI:getPrefabPath()
|
||||
end
|
||||
|
||||
function BattlePauseUI:ctor(params)
|
||||
self.battleType = params.battleType
|
||||
local map = DataManager.BattleData:getSelectSkillMap()
|
||||
self.skillList = {}
|
||||
for skillId, info in pairs(map) do
|
||||
@ -39,6 +40,7 @@ function BattlePauseUI:_display()
|
||||
local uiMap = self.root:genAllChildren()
|
||||
uiMap["battle_pause_ui.skill_node.title"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_2))
|
||||
self:_refreshScrollRect()
|
||||
self:refreshDailyChallengeNode()
|
||||
end
|
||||
|
||||
function BattlePauseUI:_addListeners()
|
||||
@ -91,4 +93,36 @@ function BattlePauseUI:_refreshScrollRect()
|
||||
self.scrollRect:refillCells(#self.skillList)
|
||||
end
|
||||
|
||||
function BattlePauseUI:refreshDailyChallengeNode()
|
||||
local uiMap = self.root:genAllChildren()
|
||||
local node = uiMap["battle_pause_ui.daily_challenge_node"]
|
||||
if self.battleType ~= GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE then
|
||||
node:setVisible(false)
|
||||
return
|
||||
end
|
||||
node:setVisible(true)
|
||||
local buffDescs = {}
|
||||
for _, id in ipairs(DataManager.DailyChallengeData:getTodayBuff()) do
|
||||
local cfg = ConfigManager:getConfig("buff_daily_challenge")[id]
|
||||
if cfg then
|
||||
buffDescs[cfg.buff_type] = ModuleManager.DailyChallengeManager:getBuffDesc(id)
|
||||
end
|
||||
end
|
||||
local buffBtns = {
|
||||
uiMap["battle_pause_ui.daily_challenge_node.buff_1"],
|
||||
uiMap["battle_pause_ui.daily_challenge_node.buff_2"]
|
||||
}
|
||||
for i, obj in ipairs(buffBtns) do
|
||||
obj:addClickListener(function()
|
||||
ModuleManager.TipsManager:showDescTips(buffDescs[i] or GConst.EMPTY_STRING, obj)
|
||||
end)
|
||||
end
|
||||
|
||||
uiMap["battle_pause_ui.daily_challenge_node.task"]:addClickListener(function()
|
||||
|
||||
end)
|
||||
uiMap["battle_pause_ui.daily_challenge_node.buff_title"]:setText(I18N:getGlobalText(I18N.GlobalConst.BUFF_NAME))
|
||||
uiMap["battle_pause_ui.daily_challenge_node.task_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_NAME))
|
||||
end
|
||||
|
||||
return BattlePauseUI
|
||||
@ -73,7 +73,7 @@ end
|
||||
function BattleUI:_addListeners()
|
||||
local uiMap = self.root:genAllChildren()
|
||||
uiMap["battle_ui.top_node.close_btn"]:addClickListener(function()
|
||||
ModuleManager.BattleManager:showPauseUI()
|
||||
ModuleManager.BattleManager:showPauseUI(self.battleController.battleType)
|
||||
end)
|
||||
|
||||
self:addEventListener(EventManager.CUSTOM_EVENT.SHOW_ELIMINATION_TUTORAIL, function(posIdList)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user