From d52d40d741751063221216571765335b062bf5ef Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 25 Apr 2023 22:24:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/controller/battle_controller.lua | 2 +- lua/app/ui/battle/cell/skill_node_cell.lua | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 27d048d0..d8e25d2c 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -147,7 +147,7 @@ function BattleController:onLinkChange() end end - self.battleUI:refreshSkill(elementTypeMap, true) + self.battleUI:refreshSkill(elementTypeMap, count > 0) if mainElementType then self.atkTeam:changeMainUnit(mainElementType) end diff --git a/lua/app/ui/battle/cell/skill_node_cell.lua b/lua/app/ui/battle/cell/skill_node_cell.lua index 97eb962f..72a484c5 100644 --- a/lua/app/ui/battle/cell/skill_node_cell.lua +++ b/lua/app/ui/battle/cell/skill_node_cell.lua @@ -8,6 +8,12 @@ function SkillNodeCell:refresh(skillEntity, elementMap, showSfx) end local uiMap = self:getUIMap() + local mask2 = uiMap["skill_node_cell.icon_node.mask_2"] + if showSfx and add <= 0 then + mask2:setVisible(true) + else + mask2:setVisible(false) + end local iconNode = uiMap["skill_node_cell.icon_node"] if not skillEntity:getUnlocked() then iconNode:setVisible(false) From e085aad38f6fe198a7c1a5a390318479f78ce4c8 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 25 Apr 2023 22:39:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9D=A1=E6=98=BE?= =?UTF-8?q?=E7=A4=BAbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/main_city/component/main_comp.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index f3635c7d..1f03e92a 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -103,8 +103,19 @@ function MainComp:refreshChapter(force) local rewardChapterId = DataManager.ChapterData:getIsHaveRewardsMinId() local curMaxWave = DataManager.ChapterData:getChapterMaxWave(rewardChapterId) local boxCount = DataManager.ChapterData:getChapterBoxCount(rewardChapterId) - local maxWave = DataManager.ChapterData:getChapterBoxNum(rewardChapterId, boxCount) - slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = curMaxWave / maxWave + local unitValue = 1 / boxCount + local sliderValue = 0 + local lastValue = 0 + for i = 1, boxCount do + if curMaxWave < lastValue then + break + end + local maxWave = DataManager.ChapterData:getChapterBoxNum(rewardChapterId, i) + local wave = math.min(curMaxWave, maxWave) + sliderValue = sliderValue + unitValue * (wave - lastValue) / (maxWave - lastValue) + lastValue = maxWave + end + slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = sliderValue for index, objs in ipairs(self.boxObjs) do local show = boxCount >= index From fd70f87d65b5e4da636107c38bad9b54b79daca6 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 25 Apr 2023 23:01:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8A=A8=E7=94=BB=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/battle/battle_ui.lua | 58 +++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/lua/app/ui/battle/battle_ui.lua b/lua/app/ui/battle/battle_ui.lua index b77407ca..4106f357 100644 --- a/lua/app/ui/battle/battle_ui.lua +++ b/lua/app/ui/battle/battle_ui.lua @@ -11,8 +11,8 @@ local BOARD_POS_DOWN = BF.Vector2(0, -740) local BG_PATH = "assets/arts/textures/background/battle/%s.png" local CacheVector2 = CS.UnityEngine.Vector2(0, 0) -local CACHE_SKILL_POS_1 = {x = 0, y = 360} -local CACHE_SKILL_POS_2 = {x = 0, y = 420} +local CACHE_SKILL_POS_1 = {x = 10, y = 360} +local CACHE_SKILL_POS_2 = {x = 10, y = 420} local BATTLE_COMMON_PATH = "assets/arts/textures/background/battle_common/%s.png" function BattleUI:getPrefabPath() @@ -1036,7 +1036,7 @@ function BattleUI:doCacheAni(skillInfo, callback) self.cacheSkillAniSeq:AppendCallback(function() self.boardCacheBox:setAnchoredPositionX(- w) end) - self.cacheSkillAniSeq:Append(self.boardCacheBox:getTransform():DOAnchorPosX(0, 0.5)) + for index, info in ipairs(skillInfo) do local entity = self.root.skillAniGridEntities[index] if entity then @@ -1053,8 +1053,24 @@ function BattleUI:doCacheAni(skillInfo, callback) gridEntity:getCell():getBaseObject():setAnchoredPositionX(DEFAULT_X) -- 放到屏幕外 end end) - local path = {pos, CACHE_SKILL_POS_2, CACHE_SKILL_POS_1} - self.cacheSkillAniSeq:Insert(0.5 + 0.5 * (index - 1) + 0.02, obj:getTransform():DOLocalPath(path, 1)) + + self.cacheSkillAniSeq:Insert(0.5 * (index - 1) + 0.02, obj:getTransform():DOAnchorPos(CACHE_SKILL_POS_2, 0.7)) + end + end + end + + self.cacheSkillAniSeq:Append(self.boardCacheBox:getTransform():DOAnchorPosX(0, 0.5)) + for index, info in ipairs(skillInfo) do + local entity = self.root.skillAniGridEntities[index] + if entity then + local cell = entity:getCell() + if cell then + local obj = cell:getBaseObject() + if index == 1 then + self.cacheSkillAniSeq:Append(obj:getTransform():DOAnchorPos(CACHE_SKILL_POS_1, 0.3)) + else + self.cacheSkillAniSeq:Join(obj:getTransform():DOAnchorPos(CACHE_SKILL_POS_1, 0.3)) + end end end end @@ -1109,21 +1125,37 @@ function BattleUI:doCachePopAni(skillInfo, callback) obj:setAnchoredPositionX(DEFAULT_X) end) self.cacheSkillAniSeq:InsertCallback(0.5 + 0.5 * (index - 1), function() - obj:setAnchoredPosition(0, 360) + obj:setAnchoredPosition(CACHE_SKILL_POS_1.x, CACHE_SKILL_POS_1. y) end) - local path = {CACHE_SKILL_POS_1, CACHE_SKILL_POS_2, pos} - self.cacheSkillAniSeq:Insert(0.5 + 0.5 * (index - 1) + 0.02, obj:getTransform():DOLocalPath(path, 0.5)) - self.cacheSkillAniSeq:InsertCallback(0.5 + 0.5 * (index - 1) + 0.52, function() - if self.battleController then - self.battleController:setGridSkillId(info.posId, info.skillId) - end - end) + self.cacheSkillAniSeq:Insert(0.5 + 0.5 * (index - 1) + 0.02, obj:getTransform():DOAnchorPos(CACHE_SKILL_POS_2, 0.3)) end end end self.cacheSkillAniSeq:Append(self.boardCacheBox:getTransform():DOAnchorPosX(w, 0.5)) + + for index, info in ipairs(skillInfo) do + local entity = self.root.skillAniGridEntities[index] + if entity then + local pos = ModuleManager.BattleManager:getPosInfo(info.posId) + local cell = entity:getCell() + if cell then + local obj = cell:getBaseObject() + if index == 1 then + self.cacheSkillAniSeq:Append(obj:getTransform():DOAnchorPos(pos, 0.7)) + else + self.cacheSkillAniSeq:Join(obj:getTransform():DOAnchorPos(pos, 0.7)) + end + end + end + end + self.cacheSkillAniSeq:AppendCallback(function() + for index, info in ipairs(skillInfo) do + if self.battleController then + self.battleController:setGridSkillId(info.posId, info.skillId) + end + end self.boardCacheNode:setVisible(false) self:enableUITouch() if callback then