英雄
This commit is contained in:
parent
797de2db15
commit
e9d0fe30c9
@ -469,13 +469,13 @@ GConst.HERO_FRAME_GRAY_QLT = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GConst.HERO_DEC_QLT = {
|
GConst.HERO_DEC_QLT = {
|
||||||
[1] = "hero_frame_1_1",
|
[1] = "frame_dec_1",
|
||||||
[2] = "hero_frame_2_2",
|
[2] = "frame_dec_2",
|
||||||
[3] = "hero_frame_1_1",
|
[3] = "frame_dec_3",
|
||||||
[4] = "hero_frame_1_1",
|
[4] = "frame_dec_4",
|
||||||
[5] = "hero_frame_1_1",
|
[5] = "frame_dec_5",
|
||||||
[6] = "hero_frame_1_1",
|
[6] = "frame_dec_6",
|
||||||
[7] = "hero_frame_1_1",
|
[7] = "frame_dec_7",
|
||||||
}
|
}
|
||||||
|
|
||||||
GConst.HERO_FRAME_QLT = {
|
GConst.HERO_FRAME_QLT = {
|
||||||
|
|||||||
@ -92,11 +92,11 @@ end
|
|||||||
|
|
||||||
-- 刷新英雄icon
|
-- 刷新英雄icon
|
||||||
function HeroCell:refreshHeroIcon(iconName)
|
function HeroCell:refreshHeroIcon(iconName)
|
||||||
if self.heroEntity ~= nil then
|
-- if self.heroEntity ~= nil then
|
||||||
self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO_2, DataManager.SkinData:getIcon(self.heroEntity:getSkinId()))
|
-- self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO_2, DataManager.SkinData:getIcon(self.heroEntity:getSkinId()))
|
||||||
elseif iconName then
|
-- elseif iconName then
|
||||||
self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO_2, tostring(iconName))
|
self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO_2, tostring(iconName))
|
||||||
end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 刷新红点
|
-- 刷新红点
|
||||||
@ -169,8 +169,8 @@ end
|
|||||||
function HeroCell:_refresh(heroInfo, isGray)
|
function HeroCell:_refresh(heroInfo, isGray)
|
||||||
self.clickCallback = nil
|
self.clickCallback = nil
|
||||||
self.maskImg2:setActive(isGray)
|
self.maskImg2:setActive(isGray)
|
||||||
self.heroBg:setSprite(GConst.ATLAS_PATH.HERO, GConst.HERO_FRAME_QLT[heroInfo.qlt])
|
self.heroBg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.FRAME_QLT[heroInfo.qlt])
|
||||||
self.heroDec:setSprite(GConst.ATLAS_PATH.HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
|
self.heroDec:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
|
||||||
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
|
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
|
||||||
self.check:setVisible(false)
|
self.check:setVisible(false)
|
||||||
self:refreshHeroIcon(heroInfo.icon)
|
self:refreshHeroIcon(heroInfo.icon)
|
||||||
|
|||||||
@ -11,7 +11,6 @@ function LargeHeroCell:init()
|
|||||||
self.matchImg = uiMap["large_hero_cell.hero_bg.match_img"]
|
self.matchImg = uiMap["large_hero_cell.hero_bg.match_img"]
|
||||||
self.infoBtnDesc = uiMap["large_hero_cell.hero_bg.info_btn.desc"]
|
self.infoBtnDesc = uiMap["large_hero_cell.hero_bg.info_btn.desc"]
|
||||||
self.useBtnDesc = uiMap["large_hero_cell.hero_bg.use_btn.desc"]
|
self.useBtnDesc = uiMap["large_hero_cell.hero_bg.use_btn.desc"]
|
||||||
self.sImg = uiMap["large_hero_cell.hero_bg.s"]
|
|
||||||
self.isGray = false
|
self.isGray = false
|
||||||
|
|
||||||
self.useBtnDesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_8))
|
self.useBtnDesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_8))
|
||||||
@ -62,11 +61,10 @@ function LargeHeroCell:_refresh(heroInfo, isGray)
|
|||||||
-- else
|
-- else
|
||||||
-- self.heroBg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.FRAME_QLT[heroInfo.qlt])
|
-- self.heroBg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.FRAME_QLT[heroInfo.qlt])
|
||||||
-- end
|
-- end
|
||||||
self.heroBg:setSprite(GConst.ATLAS_PATH.HERO, GConst.FRAME_QLT[heroInfo.qlt])
|
self.heroBg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.FRAME_QLT[heroInfo.qlt])
|
||||||
self.heroDec:setSprite(GConst.ATLAS_PATH.HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
|
self.heroDec:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
|
||||||
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
|
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
|
||||||
self.check:setVisible(false)
|
self.check:setVisible(false)
|
||||||
self.sImg:setVisible(heroInfo.qlt >= 4)
|
|
||||||
self:setGray(isGray)
|
self:setGray(isGray)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ local HeroListCell = class("HeroListCell", BaseCell)
|
|||||||
|
|
||||||
local H = {
|
local H = {
|
||||||
NORMAL = 260,
|
NORMAL = 260,
|
||||||
HAS_TITLE = 380
|
HAS_TITLE = 360
|
||||||
}
|
}
|
||||||
|
|
||||||
function HeroListCell:init()
|
function HeroListCell:init()
|
||||||
|
|||||||
@ -240,11 +240,15 @@ function HeroInfoComp:refresh(checkLevel)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if canLvUp then
|
if canLvUp then
|
||||||
|
self.btnUp:setTouchEnable(true)
|
||||||
|
self.btnUp5:setTouchEnable(true)
|
||||||
self.btnUp:addRedPoint(70, 30, 0.6)
|
self.btnUp:addRedPoint(70, 30, 0.6)
|
||||||
self.btnUp5:addRedPoint(70, 30, 0.6)
|
self.btnUp5:addRedPoint(70, 30, 0.6)
|
||||||
self.btnUp:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[1])
|
self.btnUp:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[1])
|
||||||
self.btnUp5:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[2])
|
self.btnUp5:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[2])
|
||||||
else
|
else
|
||||||
|
self.btnUp:setTouchEnable(false)
|
||||||
|
self.btnUp5:setTouchEnable(false)
|
||||||
self.btnUp:removeRedPoint()
|
self.btnUp:removeRedPoint()
|
||||||
self.btnUp5:removeRedPoint()
|
self.btnUp5:removeRedPoint()
|
||||||
self.btnUp:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[3])
|
self.btnUp:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[3])
|
||||||
|
|||||||
@ -88,7 +88,7 @@ function StarInfoComp:refreshInfo()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function StarInfoComp:refreshStarBtn()
|
function StarInfoComp:refreshStarBtn()
|
||||||
if self.heroEntity:getIsStarMax() then
|
if not self.heroEntity:isActived() or self.heroEntity:getIsStarMax() then
|
||||||
self.upBtn:setActive(false)
|
self.upBtn:setActive(false)
|
||||||
self.lvBtn:setActive(false)
|
self.lvBtn:setActive(false)
|
||||||
self.descTx:setActive(false)
|
self.descTx:setActive(false)
|
||||||
|
|||||||
@ -314,6 +314,9 @@ end
|
|||||||
function HeroEntity:getCurrMaxLv()
|
function HeroEntity:getCurrMaxLv()
|
||||||
local cfg = ConfigManager:getConfig("hero_level")
|
local cfg = ConfigManager:getConfig("hero_level")
|
||||||
local lv = self.data.lv
|
local lv = self.data.lv
|
||||||
|
if lv <= 0 then
|
||||||
|
return 1
|
||||||
|
end
|
||||||
for i = self.data.lv, #cfg do
|
for i = self.data.lv, #cfg do
|
||||||
if cfg[i].star > self.data.star then
|
if cfg[i].star > self.data.star then
|
||||||
break
|
break
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user