From f465fa1435b787dd7ea6dfe43ff3f837036f5a0d Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 24 Apr 2023 11:29:16 +0800 Subject: [PATCH 1/4] =?UTF-8?q?bug=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/main_city_ui.lua | 69 ++++----------------------- 1 file changed, 9 insertions(+), 60 deletions(-) diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index 6971b439..cff97614 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -70,6 +70,10 @@ function MainCityUI:onLoadRootComplete() end, 1) end +function MainCityUI:onReshow() + self:checkMainPop() +end + function MainCityUI:onSetUIOrder() if self.subComps then for index, comp in pairs(self.subComps) do @@ -120,9 +124,11 @@ function MainCityUI:_bind() end end) - -- self:bind(DataManager.BagData.ItemData, "dirty", function(binder, value) - -- UIManager:refreshCurrencyBarTxt() - -- end) + self:bind(DataManager.BagData.ItemData, "dirty", function(binder, value) + if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN and self.subComps[self.selectedIndex] then + self.subComps[self.selectedIndex]:refreshStageFormaion() + end + end) -- self:addEventListener(EventManager.CUSTOM_EVENT.CHANGE_MAIN_CITY_PAGE_VIT, function(params) @@ -259,50 +265,7 @@ function MainCityUI:refreshRoleInfo() end) end -function MainCityUI:checkFuncOpen() - -- if not self.lvUpHide then - -- return - -- end - -- for k,v in pairs(ModuleManager.MODULE_KEY) do - -- if not DataManager.PlayerData:isShowFuncOpen(v) and ModuleManager:getIsOpen(v, true) then - -- local params = {} - -- params.funcType = v - -- params.callback = function () - -- self:checkFuncOpen() - -- end - -- ModuleManager.MaincityManager:showFuncOpenUI(params) - -- return - -- end - -- end -end - function MainCityUI:checkMainPop() - -- local topUI = UIManager:getTopUIObj() - -- if topUI:getUIIndex() ~= self:getUIIndex() then - -- return - -- end - - -- -- 功能解锁(todo 把所有的找出来,免得每次关闭界面都要走一遍) - -- for k,v in pairs(ModuleManager.MODULE_KEY) do - -- if ModuleManager:showPop(v) and (not DataManager.PlayerData:isShowFuncOpen(v)) and ModuleManager:getIsOpen(v, true) then - -- local params = {} - -- params.funcType = v - -- ModuleManager.MaincityManager:showFuncOpenUI(params) - -- return - -- end - -- end - - -- -- 章节解锁 - -- if ModuleManager.StageManager:showChapterUnlockUI() then - -- return - -- end - -- -- 活动弹窗 - -- if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then - -- if ModuleManager.ActivityPopManager:checkActivityPop() then - -- return - -- end - -- end - -- 引导 if self:checkTutorial() then return @@ -311,20 +274,6 @@ end -- 检查引导 function MainCityUI:checkTutorial() - -- -- 检查抽卡引导 - -- if not DataManager.TutorialData:getIsFuncTutorialFinished(DataManager.TutorialData.SUMMON_ID) then - -- self.showSummon = 4 - -- ModuleManager.TutorialManager:checkFuncTutorial(DataManager.TutorialData.SUMMON_ID) - -- return - -- end - - -- if not DataManager.TutorialData:getIsFuncTutorialFinished(DataManager.TutorialData.FIGHT_FAIL_ID) then - -- if DataManager.PlayerData:getStageFailCount() == 1 then -- 首次章节战败 - -- ModuleManager.TutorialManager:checkFuncTutorial(DataManager.TutorialData.FIGHT_FAIL_ID) - -- return - -- end - -- end - if DataManager.ChapterData:getMaxChapterId() == 1 then if ModuleManager.TutorialManager:checkFuncTutorial(GConst.TutorialConst.PASS_ONE_CHAPTER) then return From de8328b8096c999c5248a3fa715fa857ac2d932d Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 24 Apr 2023 11:32:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/userdata/battle/battle_grid_entity.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/app/userdata/battle/battle_grid_entity.lua b/lua/app/userdata/battle/battle_grid_entity.lua index 4cec2260..845f90c6 100644 --- a/lua/app/userdata/battle/battle_grid_entity.lua +++ b/lua/app/userdata/battle/battle_grid_entity.lua @@ -174,7 +174,7 @@ function BattleGridEntity:canChangeInfo() end function BattleGridEntity:canInfluenceBySkill() - if not self:isObstacleType() and not self:getSkillId() then + if self:isEmptyType() then return true end return false From 43ef1a5a8df642e4c61d514cc70489049976f4cc Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 24 Apr 2023 14:16:19 +0800 Subject: [PATCH 3/4] =?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/battle_const.lua | 8 ++++++++ lua/app/module/hero/hero_manager.lua | 15 +++++++++++---- .../ui/battle/cell/battle_select_skill_cell.lua | 17 ++++++++++++++++- lua/app/ui/hero/hero_detail_ui.lua | 12 ++++++------ 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/lua/app/module/battle/battle_const.lua b/lua/app/module/battle/battle_const.lua index 43648db3..77bf82fb 100644 --- a/lua/app/module/battle/battle_const.lua +++ b/lua/app/module/battle/battle_const.lua @@ -328,6 +328,14 @@ BattleConst.ELEMENT_TYPE = { PURPLE = 5 } +BattleConst.ELEMENT_COLOR = { + [BattleConst.ELEMENT_TYPE.RED] = "#FF9898", + [BattleConst.ELEMENT_TYPE.YELLOW] = "#FFFC28", + [BattleConst.ELEMENT_TYPE.GREEN] = "#3CFF28", + [BattleConst.ELEMENT_TYPE.BLUE] = "#28FFF7", + [BattleConst.ELEMENT_TYPE.PURPLE] = "#FFAEED" +} + BattleConst.ELEMENT_ICON = { [BattleConst.ELEMENT_TYPE.RED] = "red_1", [BattleConst.ELEMENT_TYPE.YELLOW] = "yellow_1", diff --git a/lua/app/module/hero/hero_manager.lua b/lua/app/module/hero/hero_manager.lua index c59cf968..774e4df0 100644 --- a/lua/app/module/hero/hero_manager.lua +++ b/lua/app/module/hero/hero_manager.lua @@ -49,8 +49,15 @@ function HeroManager:getMatchTypeIcon(matchType) return GConst.HeroConst.MATCH_ICON_NAME[matchType] end -function HeroManager:getMatchTypeName(matchType) - return I18N:getGlobalText("ELEMENT_NAME_" .. matchType) +function HeroManager:getMatchTypeName(matchType, needColor) + local name = I18N:getGlobalText("ELEMENT_NAME_" .. matchType) + if needColor then + local color = GConst.BattleConst.ELEMENT_COLOR[matchType] + if color then + name = string.format("%s", color, name) + end + end + return name end function HeroManager:getSkillDesc(skillId) @@ -95,8 +102,8 @@ end function HeroManager:getSkillRogueBg(skillId) local cfg = ConfigManager:getConfig("skill_rogue")[skillId] - if cfg.type == GConst.BattleConst.UNLOCK_SKILL_ROGUE_TYPE then -- 解锁技能类型 - return "frame_skill_" .. cfg.skill_position + if cfg.skill_position then -- 解锁技能类型 + return "frame_skill_0" end return cfg and "frame_" .. cfg.qlt end diff --git a/lua/app/ui/battle/cell/battle_select_skill_cell.lua b/lua/app/ui/battle/cell/battle_select_skill_cell.lua index ebdf7872..7c994a0a 100644 --- a/lua/app/ui/battle/cell/battle_select_skill_cell.lua +++ b/lua/app/ui/battle/cell/battle_select_skill_cell.lua @@ -18,7 +18,8 @@ function BattleSelectSkillCell:refresh(skillId, func) end local uiMap = self:getUIMap() - uiMap["skill_select_cell.desc"]:setText(ModuleManager.HeroManager:getSkillRogueDesc(skillId, self.value)) + local desc = uiMap["skill_select_cell.desc"] + desc:setText(ModuleManager.HeroManager:getSkillRogueDesc(skillId, self.value)) self:getBaseObject():addClickListener(function() func(self.value) end) @@ -28,6 +29,20 @@ function BattleSelectSkillCell:refresh(skillId, func) self.selectSkillCell:refresh(skillId, nil, valueStr) uiMap["skill_select_cell.img"]:setSprite(GConst.ATLAS_PATH.BATTLE, ModuleManager.HeroManager:getSkillRogueBattleBg(skillId)) + + local icon = uiMap["skill_select_cell.element_icon"] + + if cfg.skill_position then + local iconName = uiMap["skill_select_cell.element_icon.name"] + local atlas, iconSprite = ModuleManager.BattleManager:getElementIcon(cfg.skill_position) + icon:setVisible(true, 0.4) + icon:setSprite(atlas, iconSprite) + iconName:setText(ModuleManager.HeroManager:getMatchTypeName(cfg.skill_position, true)) + desc:setAnchoredPositionY(-15) + else + icon:setVisible(false, 0.4) + desc:setAnchoredPositionY(0) + end end return BattleSelectSkillCell \ No newline at end of file diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index 792d0c8c..65554468 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -2,11 +2,7 @@ local HeroDetailUI = class("HeroDetailUI", BaseUI) local DEFAULT_FACTOR = GConst.BattleConst.DEFAULT_FACTOR -local SKILL_BUFF_BG = { - [2] = "frame_1", - [3] = "frame_2", - [4] = "frame_3", -} +local BTN_ICON = {"common_btn_green_2", "common_btn_grey_2"} function HeroDetailUI:isFullScreen() return false @@ -109,7 +105,11 @@ function HeroDetailUI:_display() uiMap["hero_detail_ui.bg.atk"]:setText(atkStr) local btn = uiMap["hero_detail_ui.bg.up_btn"] - btn:setImageGray(not canLvUp) + if canLvUp then + btn:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[1]) + else + btn:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[2]) + end btn:setTouchEnable(true) btn:setActive(not self.heroEntity:isMaxLv()) end From 63f485111781f51beda27ef3d6bdd0a267ec2fae Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 24 Apr 2023 14:21:10 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/hero/hero_manager.lua | 4 ++-- lua/app/ui/hero/hero_detail_ui.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/app/module/hero/hero_manager.lua b/lua/app/module/hero/hero_manager.lua index 774e4df0..ea72ee42 100644 --- a/lua/app/module/hero/hero_manager.lua +++ b/lua/app/module/hero/hero_manager.lua @@ -100,9 +100,9 @@ function HeroManager:getSkillRogueBattleBg(skillId) return cfg and "battle_board_" .. cfg.qlt end -function HeroManager:getSkillRogueBg(skillId) +function HeroManager:getSkillRogueBg(skillId, onlyQlt) local cfg = ConfigManager:getConfig("skill_rogue")[skillId] - if cfg.skill_position then -- 解锁技能类型 + if cfg.skill_position and not onlyQlt then -- 解锁技能类型 return "frame_skill_0" end return cfg and "frame_" .. cfg.qlt diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index 65554468..dc41d5b0 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -61,7 +61,7 @@ function HeroDetailUI:_display() skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, "frame_0") else skillLv:setText(GConst.EMPTY_STRING) - skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId)) + skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId, true)) end end end