显示问题修复

This commit is contained in:
xiekaidong 2023-07-05 14:25:27 +08:00
parent 9ae7f3d8a0
commit 21365f487e
4 changed files with 21 additions and 18 deletions

View File

@ -1436,7 +1436,7 @@ function BattleBaseController:onFillBoardOver(isRoundBeginCheck)
end)
else
self:generateSkill(function()
self.battleUI:refreshSkill()
self.battleUI:refreshSkill(nil, nil, self:getCurActionSide())
if self.onFillBoardOverCallback then
local callback = self.onFillBoardOverCallback
self.onFillBoardOverCallback = nil
@ -2059,7 +2059,7 @@ function BattleBaseController:onSelectSkill(skillId, value, pos, side)
self.battleUI:gotOneSkillAni(skillId, elementType, function()
self:selectSKillNextToStep()
self.battleUI:refreshBoard()
self.battleUI:refreshSkill()
self.battleUI:refreshSkill(nil, nil, self:getCurActionSide())
end, pos)
return
end

View File

@ -435,9 +435,10 @@ local function _takeAddSkillEnergy(atkUnitComp, skillEntity, battleController)
elementType = boardSkills[math.random(1, count)]
end
local side = battleController:getCurActionSide()
elementTypeMap = {[elementType] = addEnergy}
battleController:addSkillEnergy(elementTypeMap)
battleController.battleUI:refreshSkill()
battleController:addSkillEnergy(elementTypeMap, side)
battleController.battleUI:refreshSkill(nil, nil, side)
end
local function _takeChangeElementType(atkUnitComp, skillEntity, battleController)

View File

@ -1519,7 +1519,7 @@ function BattleBaseUI:generateSkillAni(map, callback, side)
local entity = self.generateSkillGridEntities[elementType]
if entity and entity:getCell() then
count = count + 1
entity:setSkilId(info.skillId)
entity:setSkilId(info.skillId, false, side)
local cell = entity:getCell()
cell:refresh(entity)
self.generateSkillAniSeq:AppendCallback(function()
@ -1853,7 +1853,7 @@ function BattleBaseUI:doCacheAni(skillInfo, callback)
for index, info in ipairs(skillInfo) do
local entity = self.root.skillAniGridEntities[index]
if entity then
entity:setSkilId(info.skillId)
entity:setSkilId(info.skillId, false, self.battleController:getCurActionSide())
local pos = self:getPosInfo(info.posId)
local cell = entity:getCell()
if cell then
@ -1928,7 +1928,7 @@ function BattleBaseUI:doCachePopAni(skillInfo, callback)
for index, info in ipairs(skillInfo) do
local entity = self.root.skillAniGridEntities[index]
if entity then
entity:setSkilId(info.skillId)
entity:setSkilId(info.skillId, false, self.battleController:getCurActionSide())
local cell = entity:getCell()
if cell then
cell:refresh(entity)

View File

@ -91,17 +91,19 @@ function GridCell:refresh(gridEntity, curElement, skillPosId)
end
end
local ignoreElementType = skillEntity:getIgnoreElementType()
local skillBg
if ignoreElementType and not self.lastShowHlElementType then
skillBg = GConst.BattleConst.SKILL_ELEMENT_BG_2.skill
else
local mainElementType = self.lastShowHlElementType or skillEntity:getPosition()
skillBg = GConst.BattleConst.SKILL_ELEMENT_BG_2[mainElementType]
end
if self.lastSkillBg ~= skillBg then
self.lastSkillBg = skillBg
downBg:setSprite(GConst.ATLAS_PATH.BATTLE, self.lastSkillBg)
if skillEntity then
local ignoreElementType = skillEntity:getIgnoreElementType()
local skillBg
if ignoreElementType and not self.lastShowHlElementType then
skillBg = GConst.BattleConst.SKILL_ELEMENT_BG_2.skill
else
local mainElementType = self.lastShowHlElementType or skillEntity:getPosition()
skillBg = GConst.BattleConst.SKILL_ELEMENT_BG_2[mainElementType]
end
if self.lastSkillBg ~= skillBg then
self.lastSkillBg = skillBg
downBg:setSprite(GConst.ATLAS_PATH.BATTLE, self.lastSkillBg)
end
end
else
skillIcon:setVisible(false)