c1_lua/lua/app/ui/battle/cell/tiny_buff_cell.lua
2023-07-21 11:37:29 +08:00

24 lines
780 B
Lua

local TinyBuffCell = class("TinyBuffCell", BaseCell)
function TinyBuffCell:refresh(buffName, round, num, result)
if round <= 1 or round > 9 then
round = GConst.EMPTY_STRING
else
round = tostring(round)
end
local uiMap = self:getUIMap()
uiMap["tiny_buff_cell.buff_icon"]:setSprite(GConst.ATLAS_PATH.ICON_BUFF, buffName)
uiMap["tiny_buff_cell.round_text"]:setText(round)
local buffNum = uiMap["tiny_buff_cell.buff_num"]
if buffName == GConst.BattleConst.BUFF_NAME.INVINCIBLE_SHIELD then
uiMap["tiny_buff_cell.round_text"]:setText(GConst.EMPTY_STRING)
result = result or num
buffNum:setText(result or GConst.EMPTY_STRING)
else
buffNum:setText(GConst.EMPTY_STRING)
end
end
return TinyBuffCell