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..ea72ee42 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) @@ -93,10 +100,10 @@ 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.type == GConst.BattleConst.UNLOCK_SKILL_ROGUE_TYPE then -- 解锁技能类型 - return "frame_skill_" .. cfg.skill_position + if cfg.skill_position and not onlyQlt 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..dc41d5b0 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 @@ -65,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 @@ -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 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 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