Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev
This commit is contained in:
commit
1cf9b182d0
@ -27,6 +27,7 @@ local LOCAL_DATA_KEY = {
|
||||
LAST_LOGIN_TIME = "LAST_LOGIN_TIME",
|
||||
GATE = "GATE",
|
||||
BOUNTY_POP_TIME = "BOUNTY_POP_TIME",
|
||||
CHALLENGE_TASK_POP_TIME = "CHALLENGE_TASK_POP_TIME",
|
||||
}
|
||||
|
||||
LocalData.KEYS = LOCAL_DATA_KEY
|
||||
@ -345,4 +346,12 @@ function LocalData:getBountyPopTime()
|
||||
return self:getInt(LOCAL_DATA_KEY.BOUNTY_POP_TIME, 0)
|
||||
end
|
||||
|
||||
function LocalData:setChallengeTaskPopTime(time)
|
||||
self:setInt(LOCAL_DATA_KEY.CHALLENGE_TASK_POP_TIME, time)
|
||||
end
|
||||
|
||||
function LocalData:getChallengeTaskPopTime()
|
||||
return self:getInt(LOCAL_DATA_KEY.CHALLENGE_TASK_POP_TIME, 0)
|
||||
end
|
||||
|
||||
return LocalData
|
||||
@ -183,6 +183,7 @@ GConst.ATLAS_PATH = {
|
||||
ICON_ITEM = "assets/arts/atlas/icon/item.asset",
|
||||
UI_LOGIN = "assets/arts/atlas/ui/login.asset",
|
||||
ICON_SKILL = "assets/arts/atlas/icon/skill.asset",
|
||||
ICON_SKILL_BIG = "assets/arts/atlas/icon/skill_big.asset",
|
||||
ICON_HERO = "assets/arts/atlas/icon/hero.asset",
|
||||
ICON_HERO_2 = "assets/arts/atlas/icon/hero_2.asset",
|
||||
ICON_SKILL_ROGUE = "assets/arts/atlas/icon/skill_rogue.asset",
|
||||
|
||||
@ -1339,18 +1339,24 @@ end
|
||||
function BattleController:generateBoard(isFirst)
|
||||
local boardList, _, mysteryBoxIndexMap = self:getInitBoard()
|
||||
if self.curBoardIndex and self.curBoardIndex >= #boardList then
|
||||
if isFirst then
|
||||
self.needWaitingBoardOver = false
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
if not self.battleUI then
|
||||
if isFirst then
|
||||
self.needWaitingBoardOver = false
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
self.curBoardIndex = (self.curBoardIndex or 0) + 1
|
||||
if not boardList[self.curBoardIndex] then -- 容错
|
||||
if isFirst then
|
||||
self.needWaitingBoardOver = false
|
||||
end
|
||||
return
|
||||
end
|
||||
local board = boardList[self.curBoardIndex].board
|
||||
@ -1361,10 +1367,11 @@ function BattleController:generateBoard(isFirst)
|
||||
self.battleUI:switchBoard(function()
|
||||
self.battleData:refreshBoard(board, self:getBlockIcon())
|
||||
self.battleUI:initGridCell(function()
|
||||
if isFirst then
|
||||
self.needWaitingBoardOver = false
|
||||
end
|
||||
end)
|
||||
end, function()
|
||||
-- self:enterRoundBegin()
|
||||
end, isFirst)
|
||||
end
|
||||
|
||||
|
||||
@ -166,7 +166,7 @@ end
|
||||
function BattleControllerStage:getFixedRogueSkill()
|
||||
if not self.fixedRogueSkill then
|
||||
local config = ConfigManager:getConfig("chapter")[self.chapterId]
|
||||
if config.involved_skill then
|
||||
if not DataManager.ChapterData:getChapterPassed(self.chapterId) and config.involved_skill then
|
||||
self.fixedRogueSkill = GFunc.getTable(config.involved_skill)
|
||||
else
|
||||
self.fixedRogueSkill = {}
|
||||
|
||||
@ -105,11 +105,6 @@ function ChapterManager:endFightFinish(result)
|
||||
-- 处理金猪,要在章节更新之后
|
||||
DataManager.GoldPigData:addGoldPigCount()
|
||||
|
||||
if ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.DAILY_CHALLENGE, true) and not DataManager.DailyChallengeData:isOpen() then
|
||||
-- 满足配置开启条件,请求挑战数据
|
||||
ModuleManager.DailyChallengeManager:onResetState()
|
||||
end
|
||||
|
||||
local newMaxChapter = DataManager.ChapterData:getNewChapterId()
|
||||
if maxChapter ~= newMaxChapter then
|
||||
local data = {}
|
||||
@ -121,6 +116,8 @@ function ChapterManager:endFightFinish(result)
|
||||
end
|
||||
-- 新章节通关,尝试解锁新功能
|
||||
DataManager:tryOpenModules()
|
||||
-- 更新每日挑战数据
|
||||
ModuleManager.DailyChallengeManager:onResetState()
|
||||
-- 章节通关 标记可弹出章节礼包
|
||||
DataManager.ShopData:markPopUpGiftForActChapterStore(maxChapter)
|
||||
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_PASS_CHAPTER)
|
||||
|
||||
@ -34,6 +34,7 @@ function DailyChallengeTaskUI:ctor()
|
||||
end
|
||||
|
||||
function DailyChallengeTaskUI:onLoadRootComplete()
|
||||
DataManager.DailyChallengeData:markPopTask()
|
||||
self:_display()
|
||||
self:_addListeners()
|
||||
end
|
||||
|
||||
@ -32,16 +32,14 @@ function HeroDetailUI:_display(lvChange)
|
||||
uiMap["hero_detail_ui.bg.skill_desc"]:setText(ModuleManager.HeroManager:getSkillDesc(self.heroEntity:getBaseSkill()))
|
||||
uiMap["hero_detail_ui.bg.hp_name"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_2))
|
||||
uiMap["hero_detail_ui.bg.atk_name"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_3))
|
||||
|
||||
uiMap["hero_detail_ui.bg.skill_icon"]:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(self.heroEntity:getUnlockRogueId()))
|
||||
uiMap["hero_detail_ui.bg.hero_element"]:setSprite(GConst.ATLAS_PATH.HERO, ModuleManager.HeroManager:getMatchTypeIcon(self.heroEntity:getMatchType()))
|
||||
uiMap["hero_detail_ui.bg.skill_node.skill_icon"]:setSprite(GConst.ATLAS_PATH.ICON_SKILL_BIG, ModuleManager.HeroManager:getSkillIcon(self.heroEntity:getBaseSkill()))
|
||||
|
||||
local materials = self.heroEntity:getLvUpMaterials() or {}
|
||||
local fragmentCount = DataManager.BagData.ItemData:getItemNumById(self.heroEntity:getFragmentId())
|
||||
local needFragmentCount = materials[1] or 1
|
||||
uiMap["hero_detail_ui.bg.fragment_num"]:setText(fragmentCount .. "/" .. needFragmentCount)
|
||||
uiMap["hero_detail_ui.bg.fragment_bg.fragment_num"]:setText(fragmentCount .. "/" .. needFragmentCount)
|
||||
|
||||
local slider = uiMap["hero_detail_ui.bg.slider"]
|
||||
local slider = uiMap["hero_detail_ui.bg.fragment_bg.slider"]
|
||||
if fragmentCount >= needFragmentCount then
|
||||
slider:setSprite(GConst.ATLAS_PATH.COMMON, "common_progress_1", nil, slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER))
|
||||
else
|
||||
@ -82,7 +80,7 @@ function HeroDetailUI:_display(lvChange)
|
||||
uiMap["hero_detail_ui.bg.fragment_bg"]:setVisible(not self.heroEntity:isMaxLv())
|
||||
|
||||
local canLvUp = self.heroEntity:canLvUp()
|
||||
uiMap["hero_detail_ui.bg.fragment_icon"]:setVisible(not canLvUp)
|
||||
uiMap["hero_detail_ui.bg.fragment_bg.fragment_icon"]:setVisible(not canLvUp)
|
||||
|
||||
local lv = self.heroEntity:getLv()
|
||||
local str
|
||||
|
||||
@ -35,6 +35,9 @@ function MainComp:refreshModule(selectModule)
|
||||
elseif self.curModuleType == GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE then
|
||||
-- 切换到每日挑战
|
||||
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_DAILY_CHALLENGE)
|
||||
if DataManager.DailyChallengeData:getIsPopTask() then
|
||||
ModuleManager.DailyChallengeManager:showBattleTaskUI()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -167,6 +170,7 @@ end
|
||||
|
||||
function MainComp:refresh()
|
||||
self:refreshStageFormaion()
|
||||
self:refreshChallenge()
|
||||
end
|
||||
|
||||
function MainComp:getCurModuleType()
|
||||
|
||||
@ -23,6 +23,7 @@ function DailyChallengeData:init(data)
|
||||
self.totalFightCount = data.total_challenge_count or 0
|
||||
self.todayFightCount = data.today_challenge_count or 0
|
||||
self.initDay = Time:getBeginningOfServerToday()
|
||||
self.popTaskTime = LocalData:getChallengeTaskPopTime()
|
||||
self:setDirty()
|
||||
end
|
||||
|
||||
@ -40,12 +41,6 @@ function DailyChallengeData:isOpen()
|
||||
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.DAILY_CHALLENGE, true) then
|
||||
return false
|
||||
end
|
||||
if self.tasks == nil then
|
||||
return false
|
||||
end
|
||||
if self.buffIds == nil then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
@ -295,4 +290,19 @@ function DailyChallengeData:getIsInReset()
|
||||
return self.isInReset
|
||||
end
|
||||
|
||||
function DailyChallengeData:getIsPopTask()
|
||||
if not self:isOpen() then
|
||||
return false
|
||||
end
|
||||
return self.popTaskTime < Time:getBeginningOfServerToday()
|
||||
end
|
||||
|
||||
function DailyChallengeData:markPopTask()
|
||||
if self.popTaskTime >= Time:getBeginningOfServerToday() then
|
||||
return
|
||||
end
|
||||
self.popTaskTime = Time:getBeginningOfServerToday()
|
||||
LocalData:setChallengeTaskPopTime(self.popTaskTime)
|
||||
end
|
||||
|
||||
return DailyChallengeData
|
||||
Loading…
x
Reference in New Issue
Block a user