diff --git a/lua/app/module/arena/arena_manager.lua b/lua/app/module/arena/arena_manager.lua index eec4643a..64595b3f 100644 --- a/lua/app/module/arena/arena_manager.lua +++ b/lua/app/module/arena/arena_manager.lua @@ -1,5 +1,9 @@ local ArenaManager = class("ArenaManager", BaseModule) +function ArenaManager:showArenaUI() + UIManager:showUI("app/ui/arena/arena_ui") +end + function ArenaManager:checkSeasonChange() if not DataManager.ArenaData:isInSeasonTime() then -- 不在赛季时间段,赛季改变 @@ -205,18 +209,21 @@ function ArenaManager:rspLastSeasonReward(result) end -- 更新赛季信息 -function ArenaManager:reqArenaInfo() +function ArenaManager:reqArenaInfo(showUI) if not DataManager.ArenaData:isOpen() then return end self.isResetting = true - self:sendMessage(ProtoMsgType.FromMsgEnum.PVPInfoReq, {}, {}, self.rspArenaInfo, nil) + self:sendMessage(ProtoMsgType.FromMsgEnum.PVPInfoReq, {showUI = showUI}, {}, self.rspArenaInfo, nil) end function ArenaManager:rspArenaInfo(result) if result.err_code == GConst.ERROR_STR.SUCCESS then self.isResetting = false DataManager.ArenaData:init(result.arena_info) + if result.reqData.showUI then + self:showArenaUI() + end end end diff --git a/lua/app/module/daily_challenge/daily_challenge_manager.lua b/lua/app/module/daily_challenge/daily_challenge_manager.lua index b2ca0144..ca20ed00 100644 --- a/lua/app/module/daily_challenge/daily_challenge_manager.lua +++ b/lua/app/module/daily_challenge/daily_challenge_manager.lua @@ -12,7 +12,7 @@ function DailyChallengeManager:init() end function DailyChallengeManager:showDailyChallengeUI() - UIManager:showUI("app/ui/battle/daily_challenge_ui") + UIManager:showUI("app/ui/daily_challenge/daily_challenge_ui") end function DailyChallengeManager:showBattleBuffUI() diff --git a/lua/app/ui/arena/arena_ui.lua b/lua/app/ui/arena/arena_ui.lua new file mode 100644 index 00000000..d15d7d88 --- /dev/null +++ b/lua/app/ui/arena/arena_ui.lua @@ -0,0 +1,268 @@ +local ArenaUI = class("ArenaUI", BaseUI) + +local GIFT_CELL = "app/ui/main_city/cell/side_bar_arena_gift_cell" +function ArenaUI:isFullScreen() + return false +end + +function ArenaUI:getPrefabPath() + return "assets/prefabs/ui/arena/arena_ui.prefab" +end + +function ArenaUI:getShowEntranceRedPoint() + return DataManager.ArenaData:hasEntranceRedDot() +end + +function ArenaUI:ctor() +end + +function ArenaUI:onClose() + if self.spineGrading then + self.spineGrading:destroy() + self.spineGrading = nil + end +end + +function ArenaUI:onLoadRootComplete() + local uiMap = self.root:genAllChildren() + + uiMap["arena_ui.close_btn"]:addClickListener(function () + self:closeUI() + end) + + self.txSeason = uiMap["arena_ui.tx_season"] + self.txTitle = uiMap["arena_ui.tx_title"] + self.txCountdown = uiMap["arena_ui.countdown.tx_time"] + self.txGarding = uiMap["arena_ui.tx_garding"] + self.spineRoot = uiMap["arena_ui.spine_root"] + self.imgProg = uiMap["arena_ui.prog.img_prog"] + self.txProg = uiMap["arena_ui.prog.tx_prog"] + self.btnHelp = uiMap["arena_ui.tx_season.btn_help"] + self.btnRecord = uiMap["arena_ui.btn_record"] + self.txRecord = uiMap["arena_ui.btn_record.tx_record"] + self.btnFormation = uiMap["arena_ui.btn_formation"] + self.txFormation = uiMap["arena_ui.btn_formation.tx_formation"] + self.btnReward = uiMap["arena_ui.btn_reward"] + self.txReward = uiMap["arena_ui.btn_reward.tx_reward"] + self.btnRank = uiMap["arena_ui.btn_rank"] + self.txRank = uiMap["arena_ui.btn_rank.tx_rank"] + self.btnGradingReward = uiMap["arena_ui.btn_grading_reward"] + self.txGradingReward = uiMap["arena_ui.btn_grading_reward.tx_grading_reward"] + + self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_4)) + self.txRecord:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_7)) + self.txFormation:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_9)) + self.txReward:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_41)) + self.txRank:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_5)) + self.txGradingReward:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_40)) + + self.btnHelp:addClickListener(function() + local params = { + type = GConst.TipsConst.HELP_TIPS_TYPE.ARENA, + title = I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_4), + desc = I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_HELP), + } + ModuleManager.TipsManager:showHelpTips(params) + end) + self.btnRecord:addClickListener(function() + UIManager:showUI("app/ui/arena/arena_recent_battle_ui") + end) + self.btnFormation:addClickListener(function() + UIManager:showUI("app/ui/arena/arena_formation_ui", {type = GConst.BattleConst.FORMATION_TYPE.ARENA_DEFEND}) + end) + self.btnReward:addClickListener(function() + UIManager:showUI("app/ui/arena/arena_season_reward_ui") + end) + self.btnRank:addClickListener(function() + UIManager:showUI("app/ui/arena/arena_rank_ui") + end) + self.btnGradingReward:addClickListener(function() + UIManager:showUI("app/ui/arena/arena_grading_reward_ui") + end) + self.bountyNode = uiMap["arena_ui.bounty_node"] + self.bountyBanner = uiMap["arena_ui.bounty_node.banner"] + self.bountyBanner:addClickListener(function() + ModuleManager.ArenaBountyManager:showBountyMainUI() + end) + self.bountyRewardSpine = uiMap["arena_ui.bounty_node.banner.spine"] + self.bountyBannerInfo = uiMap["arena_ui.bounty_node.banner.info"] + self.bountyBannerDescTx = uiMap["arena_ui.bounty_node.banner.desc"] + self.bountyBannerSlider = uiMap["arena_ui.bounty_node.banner.info.progress_bg.slider"] + self.bountyBannerSliderTx = uiMap["arena_ui.bounty_node.banner.info.progress_bg.slider_tx"] + self.bountyBannerLvTx = uiMap["arena_ui.bounty_node.banner.info.progress_bg.lv_tx"] + uiMap["arena_ui.bounty_node.banner.info.name"]:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_BATTLEPASS_1)) + + self.rightArrow = uiMap["arena_ui.right_node.arrow_node"] + self.rightArrow:setVisible(false) + self.rightNode = uiMap["arena_ui.right_node"] + self.rightBtnCells = {} + self.rightBtnCells.giftCell = CellManager:addCellComp(uiMap["arena_ui.right_node.side_bar.side_bar_cell"], GIFT_CELL) + + self.fightBtn = uiMap["arena_ui.fight_btn"] + -- 体力消耗 + self.fightCost = uiMap["arena_ui.fight_btn.cost"] + self.costTxDesc = uiMap["arena_ui.fight_btn.cost.tx_desc"] + self.costTxCost = uiMap["arena_ui.fight_btn.cost.tx_cost"] + -- 剩余次数 + self.countTxNum = uiMap["arena_ui.fight_btn.tx_count"] + -- 按钮文本 + self.txFight = uiMap["arena_ui.fight_btn.tx_desc"] + self.txFight:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_2)) + self.fightBtn:addClickListener(function () + -- 赛季结算 + if DataManager.ArenaData:isInSeasonSettlementTime() then + GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_29)) + return + end + UIManager:showUI("app/ui/arena/arena_match_ui") + end) + + self:updateTime() +end + +function ArenaUI:updateTime() + if self.seasonSettlementSid then + self:unscheduleGlobal(self.seasonSettlementSid) + self.seasonSettlementSid = nil + end + if self.seasonEndSid then + self:unscheduleGlobal(self.seasonEndSid) + self.seasonEndSid = nil + end + + if not DataManager.ArenaData:isInSeasonSettlementTime() then + -- 结算计时器 + if EDITOR_MODE then + Logger.logHighlight("赛季锁定倒计时:"..DataManager.ArenaData:getRemainSeasonSettlementTime()) + end + self.seasonSettlementSid = self:performWithDelayGlobal(function() + ModuleManager.ArenaManager:onSeasonSettlement() + end, DataManager.ArenaData:getRemainSeasonSettlementTime()) + else + -- 结束计时器 + if EDITOR_MODE then + Logger.logHighlight("赛季结束倒计时:"..DataManager.ArenaData:getRemainSeasonTime()) + end + self.seasonEndSid = self:performWithDelayGlobal(function() + ModuleManager.ArenaManager:onSeasonChanged() + end, DataManager.ArenaData:getRemainSeasonTime()) + end + + -- 显示倒计时 + if self.seasonChangeSid then + self:unscheduleGlobal(self.seasonChangeSid) + end + self.txCountdown:setText(Time:formatNumTimeStr(DataManager.ArenaData:getRemainSeasonTime())) + self.seasonChangeSid = self:scheduleGlobal(function() + self.txCountdown:setText(Time:formatNumTimeStr(DataManager.ArenaData:getRemainSeasonTime())) + end, 1) +end + +function ArenaUI:onRefresh() + self:refreshInfo() + self:refreshBounty() + self:refreshRightBtns() + self:refreshFightBtn() + self:refreshRedPoint() +end + +function ArenaUI:refreshBounty() + if GFunc.isShenhe() then + self.bountyNode:setVisible(false) + return + end + + self.bountyNode:setVisible(true) + if DataManager.ArenaBountyData:getIfCanClaimReward() then + self.bountyRewardSpine:setVisible(true) + self.bountyRewardSpine:playAnim("idle", true) + self.bountyRewardSpine:getSkeletonGraphic().enabled = true + self.bountyBannerInfo:setVisible(false) + self.bountyBannerDescTx:setText(I18N:getGlobalText(I18N.GlobalConst.COLLET_REWARDS)) + else + self.bountyRewardSpine:setVisible(false) + self.bountyRewardSpine:getSkeletonGraphic().enabled = false + local bannerName = DataManager.ArenaBountyData:getBannerName() + self.bountyBanner:setSprite(GConst.ATLAS_PATH.BOUNTY, bannerName) + self.bountyBannerInfo:setVisible(true) + self.bountyBannerDescTx:setText(GConst.EMPTY_STRING) + local exp = DataManager.ArenaBountyData:getExp() + local lvUpExp = DataManager.ArenaBountyData:getLvUpExp() + local level = DataManager.ArenaBountyData:getLevel() + local maxLevel = DataManager.ArenaBountyData:getMaxLevel() + self.bountyBannerSliderTx:setText(exp .. "/" .. lvUpExp) + self.bountyBannerSlider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = exp / lvUpExp + if level >= maxLevel then + self.bountyBannerLvTx:setText(I18N:getGlobalText(I18N.GlobalConst.STR_MAX)) + else + self.bountyBannerLvTx:setText(tostring(level)) + end + end +end + +function ArenaUI:refreshInfo() + local gradingId = DataManager.ArenaData:getGradingId() + local totalScore = DataManager.ArenaData:getScore() + local maxScore = DataManager.ArenaData:getGradingScoreTotal(totalScore) + local curScore = DataManager.ArenaData:getGradingScore(totalScore) + local gradingIconName = DataManager.ArenaData:getGradingIconName(gradingId) + local gradingNumName = DataManager.ArenaData:getGradingNumName(gradingId) + self.txSeason:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_3, DataManager.ArenaData:getSeason())) + self.txGarding:setText(DataManager.ArenaData:getGradingName(gradingId)) + if maxScore then + self.txProg:setText(curScore.."/"..maxScore) + self.imgProg:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = curScore/maxScore + else + self.txProg:setText(curScore) + self.imgProg:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = 1 + end + + if DataManager.ArenaData:hasSeasonReward() then + self.btnReward:addRedPoint(30, 25, 0.6) + else + self.btnReward:removeRedPoint() + end + + self.spineRoot:removeAllChildren() + -- SpineManager:loadUISpineWidgetAsync(gradingIconName.."_spine", self.spineRoot, function(spineObject) + -- self.spineGrading = spineObject + -- self.spineGrading:setSkin(gradingNumName) + -- self.spineGrading:playAnim("idle", true) + -- end) +end + +function ArenaUI:refreshRightBtns() + local y = 0 + if self.rightBtnCells.giftCell:checkIsOpen() then + y = y - 60 + self.rightBtnCells.giftCell:setActive(true) + self.rightBtnCells.giftCell:setVisible(true) + self.rightBtnCells.giftCell:getBaseObject():setAnchoredPositionY(y) + self.rightBtnCells.giftCell:refresh() + else + self.rightBtnCells.giftCell:setVisible(false) + end + + -- 暂不处理箭头的问题 + self.rightNode:setVisible(y < 0) +end + +-- 刷新段位奖励红点 +function ArenaUI:refreshRedPoint() + if DataManager.ArenaData:hasGradingRewardRedDot() then + self.btnGradingReward:addRedPoint(50, 50, 0.6) + else + self.btnGradingReward:removeRedPoint() + end +end + +function ArenaUI:refreshFightBtn() + local isShowFight = false + + -- 体力消耗 + self.fightCost:setActive(false) + self.countTxNum:setActive(false) + self.fightBtn:setActive(true) +end + +return ArenaUI \ No newline at end of file diff --git a/lua/app/ui/arena/arena_ui.lua.meta b/lua/app/ui/arena/arena_ui.lua.meta new file mode 100644 index 00000000..78782768 --- /dev/null +++ b/lua/app/ui/arena/arena_ui.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1d2877c73be00634aa62655ced77efc5 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/daily_challenge/daily_challenge_ui.lua b/lua/app/ui/daily_challenge/daily_challenge_ui.lua index 2b498887..3bdfc3c4 100644 --- a/lua/app/ui/daily_challenge/daily_challenge_ui.lua +++ b/lua/app/ui/daily_challenge/daily_challenge_ui.lua @@ -1,19 +1,23 @@ local DailyChallengeUI = class("DailyChallengeUI", BaseUI) -function DailyChallengeUI:getIsOpen() - return DataManager.DailyChallengeData:isOpen() +-- function DailyChallengeUI:getIsOpen() +-- return DataManager.DailyChallengeData:isOpen() +-- end + +-- function DailyChallengeUI:getEntranceName() +-- return I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE) +-- end + +-- function DailyChallengeUI:getShowEntranceRedPoint() +-- return DataManager.DailyChallengeData:isMeetChallenge() +-- end + +function DailyChallengeUI:isFullScreen() + return false end -function DailyChallengeUI:getEntranceName() - return I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE) -end - -function DailyChallengeUI:getShowEntranceRedPoint() - return DataManager.DailyChallengeData:isMeetChallenge() -end - -function DailyChallengeUI:onClickFight() - ModuleManager.DailyChallengeManager:startChallenge() +function DailyChallengeUI:getPrefabPath() + return "assets/prefabs/ui/daily_challenge/daily_challenge_ui.prefab" end function DailyChallengeUI:ctor() @@ -23,8 +27,11 @@ end function DailyChallengeUI:onLoadRootComplete() local uiMap = self.root:genAllChildren() - uiMap["daily_challenge_ui.title.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE)) - uiMap["daily_challenge_ui.record_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CHAPTER_DESC_1, DataManager.DailyChallengeData:getMaxWave())) + uiMap["daily_challenge_ui.close_btn"]:addClickListener(function () + self:closeUI() + end) + uiMap["daily_challenge_ui.challenge.info.title.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE)) + uiMap["daily_challenge_ui.challenge.info.record_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CHAPTER_DESC_1, DataManager.DailyChallengeData:getMaxWave())) self.tasks = GFunc.getTable() table.insert(self.tasks, uiMap["daily_challenge_ui.challenge.task.icon_task1"]) @@ -45,9 +52,11 @@ function DailyChallengeUI:onLoadRootComplete() self.countTxNum = uiMap["daily_challenge_ui.fight_btn.tx_count"] -- 按钮文本 self.txFight = uiMap["daily_challenge_ui.fight_btn.tx_desc"] + self.fightBtn:addClickListener(function () + ModuleManager.DailyChallengeManager:startChallenge() + end) end - function DailyChallengeUI:updateTime() ModuleManager.DailyChallengeManager:checkDayChange() local remainTime = Time:getTodaySurplusTime() @@ -95,11 +104,11 @@ function DailyChallengeUI:refreshBuff() local buffIds = DataManager.DailyChallengeData:getTodayBuffIds() self.buffObj:addClickListener(function() ModuleManager.TipsManager:showDescTips(DataManager.DailyChallengeData:getBuffDesc(buffIds[1]), self.buffObj) - end) + end) self.debuffObj:addClickListener(function() ModuleManager.TipsManager:showDescTips(DataManager.DailyChallengeData:getBuffDesc(buffIds[2]), self.debuffObj) - end) + end) end function DailyChallengeUI:refreshBoss() @@ -117,14 +126,14 @@ function DailyChallengeUI:refreshBoss() end self.curModelId = curBossInfo.model_id SpineManager:loadHeroAsync(self.curModelId, self.bossSpine, function(spineObject) - self.spineBoss = spineObject + self.spineBoss = spineObject self.spineBoss:setDefaultMix(0) self.spineBoss:setLocalScale(curBossInfo.model_ui, curBossInfo.model_ui, curBossInfo.model_ui) self.spineBoss:playAnimation(GConst.BattleConst.SPINE_ANIMATION_NAME.IDLE, true, false) - end) + end) end -function MainComp:refreshFightBtn() +function DailyChallengeUI:refreshFightBtn() local isShowFight = false -- 体力消耗 @@ -150,7 +159,6 @@ function MainComp:refreshFightBtn() if isShowFight then self.fightBtn:setActive(true) - self.fightBtn:addClickListener(moduleCell.onClickFight) else self.fightBtn:setActive(false) end diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index 8314669d..e76b7a7d 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -1,4 +1,4 @@ -local ChapterComp = class("ChapterComp", LuaComponent) +local MainComp = class("MainComp", LuaComponent) local UISpineObject = require "app/bf/unity/ui_spine_object" @@ -11,23 +11,7 @@ local BOX_ICON = { "common_chest_4" } -function ChapterComp:getIsOpen() - return true -end - -function ChapterComp:getEntranceName() - return I18N:getGlobalText(I18N.GlobalConst.MAIN_CHAPTER) -end - -function ChapterComp:getFightHpCost() - return DataManager.ChapterData:getFightCost() -end - -function ChapterComp:onClickFight() - ModuleManager.ChapterManager:startFight() -end - -function ChapterComp:init() +function MainComp:init() self.uiMap = self:getBaseObject():genAllChildren() self.chapterImg = self.uiMap["main_comp.img"] @@ -83,13 +67,20 @@ function ChapterComp:init() self.fightBtn:addClickListener(function () ModuleManager.ChapterManager:startFight() end) + + self.uiMap["main_comp.arena_btn"]:addClickListener(function() + ModuleManager.ArenaManager:reqArenaInfo(true) + end) + self.uiMap["main_comp.daily_challenge_btn"]:addClickListener(function() + ModuleManager.DailyChallengeManager:showDailyChallengeUI() + end) end -function ChapterComp:refresh() +function MainComp:refresh() self:refreshChapter() end -function ChapterComp:refreshChapter(force) +function MainComp:refreshChapter(force) local chapterId = DataManager.ChapterData:getChapterId() if self.currChapterId ~= chapterId or force then if DataManager.ChapterData:getIsFirstChapter(chapterId) then -- 第一章不需要左箭头 @@ -224,7 +215,7 @@ function ChapterComp:refreshChapter(force) self:doMonsterAction() end -function ChapterComp:onOpen() +function MainComp:onOpen() self.startMonsterAction = true if self.bossNode then self.bossNode:setAnchoredPositionX(0) @@ -237,7 +228,7 @@ function ChapterComp:onOpen() end end -function ChapterComp:onClose() +function MainComp:onClose() if self.chapterMoveSeq then self.chapterMoveSeq:Kill() self.chapterMoveSeq = nil @@ -263,7 +254,7 @@ function ChapterComp:onClose() self.smokeNodeDown:removeAllChildren() end -function ChapterComp:refreshFightBtn() +function MainComp:refreshFightBtn() -- 体力消耗 local cost = DataManager.ChapterData:getFightCost() self.fightCost:setActive(true) @@ -272,7 +263,7 @@ function ChapterComp:refreshFightBtn() end -- region 动画 -function ChapterComp:doChapterMove() +function MainComp:doChapterMove() if self.chapterMoveSeq then return end @@ -286,7 +277,7 @@ function ChapterComp:doChapterMove() self.chapterMoveSeq:SetLoops(-1) end -function ChapterComp:doBossAction() +function MainComp:doBossAction() if self.currChapterId == nil then return end @@ -339,7 +330,7 @@ function ChapterComp:doBossAction() end -- 切换boss -function ChapterComp:doChangeBossAction() +function MainComp:doChangeBossAction() local chapterBossId = self.chapterBossId local monsterCfg = ConfigManager:getConfig("monster_base") local monsterInfo = monsterCfg[self.chapterBossId] @@ -369,7 +360,7 @@ function ChapterComp:doChangeBossAction() end end -function ChapterComp:doMonsterAction() +function MainComp:doMonsterAction() if self.chapterMonsterGenerateSeq then return end @@ -383,7 +374,7 @@ function ChapterComp:doMonsterAction() self.chapterMonsterGenerateSeq:SetLoops(-1) end -function ChapterComp:generateChapterMonsters() +function MainComp:generateChapterMonsters() local monsterId if #self.chapterMonsterShowList <= 2 then monsterId = self.chapterMonsterShowList[2] @@ -437,7 +428,7 @@ function ChapterComp:generateChapterMonsters() end end -function ChapterComp:doMonsterMove(modelId, spine, posY, monsterInfo, isTopTurn) +function MainComp:doMonsterMove(modelId, spine, posY, monsterInfo, isTopTurn) spine:playAnim("move", true, true, true) local posX = GConst.UI_SCREEN_WIDTH / 2 + 100 local targetPosX = -GConst.UI_SCREEN_WIDTH / 2 - 300 @@ -504,7 +495,7 @@ function ChapterComp:doMonsterMove(modelId, spine, posY, monsterInfo, isTopTurn) end) end -function ChapterComp:enterChapterBattle() +function MainComp:enterChapterBattle() -- boss等一会再跑 local bossWaitTime = GFunc.getConstValue("chapter_fight_bosswait") / 1000 local bossSeq = DOTweenManager:createSeqWithIntId(GConst.DOTWEEN_IDS.CHAPTER_MONSTER) @@ -543,7 +534,7 @@ function ChapterComp:enterChapterBattle() return GFunc.getConstValue("chapter_fight_wait") / 1000 end -function ChapterComp:generateChapterFightMonsters() +function MainComp:generateChapterFightMonsters() local monsterId if #self.chapterMonsterShowList <= 2 then monsterId = self.chapterMonsterShowList[2] @@ -594,7 +585,7 @@ function ChapterComp:generateChapterFightMonsters() end end -function ChapterComp:doMonsterFightMove(modelId, spine, posY, monsterInfo, isTopTurn) +function MainComp:doMonsterFightMove(modelId, spine, posY, monsterInfo, isTopTurn) spine:playAnim("move", true, true, true) local posX = GConst.UI_SCREEN_WIDTH / 2 + math.random(100, math.floor(GConst.UI_SCREEN_WIDTH*2/3)) spine:setAnchoredPosition(posX, posY) @@ -671,14 +662,14 @@ function ChapterComp:doMonsterFightMove(modelId, spine, posY, monsterInfo, isTop end end -function ChapterComp:sortChapterFightMonstersOrder() +function MainComp:sortChapterFightMonstersOrder() self:sortChildrenOrder(self.monsterNodeTop) self:sortChildrenOrder(self.monsterNodeDown) self:sortChildrenOrder(self.smokeNodeTop) self:sortChildrenOrder(self.smokeNodeDown) end -function ChapterComp:sortChildrenOrder(parent) +function MainComp:sortChildrenOrder(parent) local children = parent:getChildList() if children and #children > 0 then table.sort(children, function(a, b) @@ -691,7 +682,7 @@ function ChapterComp:sortChildrenOrder(parent) end end -function ChapterComp:getMonsterSmoke(isTop) +function MainComp:getMonsterSmoke(isTop) local monsterSmoke if #self.monsterSmokePool > 0 then monsterSmoke = table.remove(self.monsterSmokePool) @@ -707,4 +698,4 @@ function ChapterComp:getMonsterSmoke(isTop) end -- endregion -return ChapterComp \ No newline at end of file +return MainComp \ No newline at end of file diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index b9b53c51..8b802736 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -198,11 +198,6 @@ function MainCityUI:_bind() self:bind(DataManager.PlayerData, "dirty", function(binder, value) self:refreshPlayerInfo() end, true) - self:bind(DataManager.FormationData, "dirty", function(binder, value) - if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.HERO then - self.subComps[self.selectedIndex]:refresh(GConst.BattleConst.BATTLE_TYPE.STAGE) - end - end) self:bind(DataManager.HeroData, "isDirty", function(binder, value) if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.HERO then @@ -217,14 +212,6 @@ function MainCityUI:_bind() self:refreshBottomRp() end) - self:bind(DataManager.BagData.ItemData, "dirty", function(binder, value) - if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN and self.subComps[self.selectedIndex] then - if self.subComps[self.selectedIndex] then - self.subComps[self.selectedIndex]:refreshBtns() - end - end - end) - self:bind(DataManager.DailyTaskData, "redPointFlag", function() self:refreshTask() end) @@ -232,9 +219,6 @@ function MainCityUI:_bind() self:bind(DataManager.BountyData, "dirty", function() self:refreshBounty() end) - self:bind(DataManager.ArenaBountyData, "dirty", function() - self:refreshArenaBounty() - end) self:bind(DataManager.MailData, "redPoint", function() self:refreshSettingBtn() @@ -256,30 +240,6 @@ function MainCityUI:_bind() end end) - self:bind(DataManager.DailyChallengeData, "isDirty", function() - if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then - if self.subComps[self.selectedIndex] then - self.subComps[self.selectedIndex]:refreshChallenge() - end - end - end) - - self:bind(DataManager.DungeonData, "isDirty", function() - if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then - if self.subComps[self.selectedIndex] then - self.subComps[self.selectedIndex]:refreshDungeon() - end - end - end) - - self:bind(DataManager.ArenaData, "isDirty", function() - if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then - if self.subComps[self.selectedIndex] then - self.subComps[self.selectedIndex]:refreshArena() - end - end - end) - self:bind(DataManager.AIHelperData, "isDirty", function() self:refreshSettingBtn() end)