fix bug
This commit is contained in:
parent
7f822a3025
commit
46f972483a
@ -677,6 +677,7 @@ local LocalizationGlobalConst =
|
||||
SUMMON_DESC_5 = "SUMMON_DESC_5",
|
||||
SUMMON_DESC_6 = "SUMMON_DESC_6",
|
||||
SUMMON_DESC_7 = "SUMMON_DESC_7",
|
||||
HERO_DESC_21 = "HERO_DESC_21",
|
||||
}
|
||||
|
||||
return LocalizationGlobalConst
|
||||
@ -677,6 +677,7 @@ local localization_global =
|
||||
["SUMMON_DESC_5"] = "[普通召唤]没有保底次数",
|
||||
["SUMMON_DESC_6"] = "普通召唤",
|
||||
["SUMMON_DESC_7"] = "高级召唤",
|
||||
["HERO_DESC_21"] = "等级达到{0}可升星",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -162,11 +162,21 @@ function HeroInfoComp:refresh(checkLevel)
|
||||
-- self.imgFragment:setVisible(not canLvUp)
|
||||
|
||||
local lv = self.heroEntity:getLv()
|
||||
local str
|
||||
local hpStr
|
||||
local atkStr
|
||||
if self.heroEntity:isActived() then
|
||||
str = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4)
|
||||
if not self.heroEntity:isActived() then
|
||||
hpStr = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
||||
atkStr = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
||||
self.btnUp:setActive(false)
|
||||
self.btnUp5:setActive(false)
|
||||
self.gotoBtn:setActive(false)
|
||||
self.needStarNode:setActive(false)
|
||||
for i,v in ipairs(self.costCells) do
|
||||
v:setActive(false)
|
||||
end
|
||||
self.upgrade:setVisible(false)
|
||||
else
|
||||
self.upgrade:setVisible(not self.onlyLook)
|
||||
local curHp = self.heroEntity:getHp() // DEFAULT_FACTOR
|
||||
local curAtk = self.heroEntity:getAtk() // DEFAULT_FACTOR
|
||||
local addHp = (self.heroEntity:getCfgHp(lv + 1) - self.heroEntity:getCfgHp()) // DEFAULT_FACTOR
|
||||
@ -181,22 +191,14 @@ function HeroInfoComp:refresh(checkLevel)
|
||||
else
|
||||
atkStr = curAtk .. "<color=#A2FF29>+" .. addAtk .. "</color>"
|
||||
end
|
||||
else
|
||||
str = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_5)
|
||||
hpStr = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
||||
atkStr = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
||||
end
|
||||
-- local costId = self.heroEntity:getLvUpCostId()
|
||||
-- self.imgUpIcon:setSprite(GFunc.getIconRes(costId))
|
||||
-- self.txUpdesc:setText(str)
|
||||
-- self.txUpNum:setText(materials[2])
|
||||
self.txHp:setText(hpStr)
|
||||
self.txAtk:setText(atkStr)
|
||||
if self.heroEntity:isMaxLv() then
|
||||
self.btnUp:setActive(false)
|
||||
self.btnUp5:setActive(false)
|
||||
self.gotoBtn:setActive(false)
|
||||
self.needStarNode:setActive(false)
|
||||
for i,v in ipairs(self.costCells) do
|
||||
v:setActive(false)
|
||||
end
|
||||
elseif lv >= nextLv then
|
||||
self.btnUp:setActive(false)
|
||||
self.btnUp5:setActive(false)
|
||||
@ -251,6 +253,9 @@ function HeroInfoComp:refresh(checkLevel)
|
||||
self.btnUp5:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[3])
|
||||
end
|
||||
end
|
||||
end
|
||||
self.txHp:setText(hpStr)
|
||||
self.txAtk:setText(atkStr)
|
||||
-- self.needStarNode = uiMap["hero_info.up.need_star_node"]
|
||||
-- self.needStarNodeDescTx1 = uiMap["hero_info.up.need_star_node.desc_tx_1"]
|
||||
-- self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"]
|
||||
@ -261,8 +266,6 @@ function HeroInfoComp:refresh(checkLevel)
|
||||
self.spineObj:playAnim("idle", false, true)
|
||||
end
|
||||
|
||||
self.upgrade:setVisible(not self.onlyLook)
|
||||
|
||||
local needPop, isUnlock, skillIdx = self.heroEntity:checkSkillUnlock()
|
||||
if needPop then
|
||||
local skillInfo = skillList[skillIdx]
|
||||
|
||||
@ -10,6 +10,8 @@ function StarInfoComp:init()
|
||||
self.lvBtn = uiMap["star_info.upgrade.lv_btn"]
|
||||
self.lvBtnTx = uiMap["star_info.upgrade.lv_btn.text"]
|
||||
self.descTx = uiMap["star_info.upgrade.desc_tx"]
|
||||
self.upgrade = uiMap["star_info.upgrade"]
|
||||
self.bg = uiMap["star_info.bg"]
|
||||
self.costCells = {}
|
||||
for i = 1, 2 do
|
||||
self.costCells[i] = uiMap["star_info.upgrade.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
|
||||
@ -31,6 +33,7 @@ function StarInfoComp:init()
|
||||
self.parentUI:changePage(GConst.HeroConst.PANEL_TYPE.HERO)
|
||||
end)
|
||||
|
||||
self.scrollrect = uiMap["star_info.scrollrect"]
|
||||
self.scrollRectComp = uiMap["star_info.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
|
||||
self.scrollRectComp:addInitCallback(function()
|
||||
return STAR_CELL
|
||||
@ -89,13 +92,11 @@ end
|
||||
|
||||
function StarInfoComp:refreshStarBtn()
|
||||
if not self.heroEntity:isActived() or self.heroEntity:getIsStarMax() then
|
||||
self.upBtn:setActive(false)
|
||||
self.lvBtn:setActive(false)
|
||||
self.descTx:setActive(false)
|
||||
for i,v in ipairs(self.costCells) do
|
||||
v:setActive(false)
|
||||
end
|
||||
self.upgrade:setActive(false)
|
||||
self.scrollrect:setSizeDeltaY(378)
|
||||
self.bg:setSizeDeltaY(378)
|
||||
elseif not self.heroEntity:getIsCurLvMax() then
|
||||
self.upgrade:setActive(true)
|
||||
self.upBtn:setActive(false)
|
||||
self.lvBtn:setActive(true)
|
||||
self.descTx:setActive(true)
|
||||
@ -103,8 +104,11 @@ function StarInfoComp:refreshStarBtn()
|
||||
v:setActive(false)
|
||||
end
|
||||
local nextLv = self.heroEntity:getNextLv()
|
||||
self.descTx:setText("等级达到" .. nextLv .. "可升星")
|
||||
self.descTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_21, nextLv))
|
||||
self.scrollrect:setSizeDeltaY(268)
|
||||
self.bg:setSizeDeltaY(268)
|
||||
else
|
||||
self.upgrade:setActive(true)
|
||||
self.upBtn:setActive(true)
|
||||
self.lvBtn:setActive(false)
|
||||
self.descTx:setActive(false)
|
||||
@ -116,6 +120,8 @@ function StarInfoComp:refreshStarBtn()
|
||||
v:setActive(true)
|
||||
v:refreshByConfig(costs[i])
|
||||
end
|
||||
self.scrollrect:setSizeDeltaY(268)
|
||||
self.bg:setSizeDeltaY(268)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -45,11 +45,11 @@ end
|
||||
function ItemEntity:checkForceLockAndAddNum()
|
||||
local type = self:getItemType()
|
||||
if type == GConst.ItemConst.ITEM_TYPE.HERO_FRAGMENT then
|
||||
local isOwn = DataManager.HeroData:getHeroIsUnlock(self:getId())
|
||||
local heroEntity = DataManager.HeroData:getHeroById(self:getId())
|
||||
-- local qlt = DataManager.HeroData:getHeroQlt(self:getId())
|
||||
-- local fragmentId = DataManager.ForceData:getForceItemIdByQlt(self:getId())
|
||||
if not isOwn then
|
||||
DataManager.HeroData:onHeroUnlock(self:getId())
|
||||
if heroEntity:getLv() <= 0 then
|
||||
heroEntity:setLv(1 ,true)
|
||||
-- BIReport:postForceUnlock(self:getId())
|
||||
end
|
||||
-- 不转换万能碎片
|
||||
|
||||
@ -74,10 +74,6 @@ function HeroData:getHeroById(id)
|
||||
return self.heroes[id]
|
||||
end
|
||||
|
||||
function HeroData:onHeroUnlock(id)
|
||||
self:addHero({id = id, level = 1, skin = 0, star = 0})
|
||||
end
|
||||
|
||||
function HeroData:getAllHeroes()
|
||||
return self.heroes
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user