Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
chenxi 2023-04-24 14:56:05 +08:00
commit c02e769d4a
6 changed files with 53 additions and 74 deletions

View File

@ -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",

View File

@ -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("<color=%s>%s</color>", 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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