Merge branch 'dev_hero' into dev_equip
This commit is contained in:
commit
45506b2638
@ -100,9 +100,11 @@ function HeroComp:init()
|
|||||||
local powerImg = self.uiMap["hero_ui.power_img"]
|
local powerImg = self.uiMap["hero_ui.power_img"]
|
||||||
local formationBg = self.uiMap["hero_ui.formation"]
|
local formationBg = self.uiMap["hero_ui.formation"]
|
||||||
local bottomBg = self.uiMap["hero_ui.bottom_bg"]
|
local bottomBg = self.uiMap["hero_ui.bottom_bg"]
|
||||||
|
local viewport = self.uiMap["hero_ui.bottom_bg.scrollrect.viewport"]
|
||||||
local rect = self.baseObject:getRectSize()
|
local rect = self.baseObject:getRectSize()
|
||||||
local bgHeight = rect.height * 0.66
|
local bgHeight = rect.height * 0.66
|
||||||
bottomBg:setSizeDeltaY(bgHeight)
|
bottomBg:setSizeDeltaY(bgHeight)
|
||||||
|
viewport:setSizeDeltaY(bgHeight - 230)
|
||||||
formationBg:setAnchoredPositionY(bgHeight)
|
formationBg:setAnchoredPositionY(bgHeight)
|
||||||
powerImg:setAnchoredPositionY(bgHeight + 20)
|
powerImg:setAnchoredPositionY(bgHeight + 20)
|
||||||
end
|
end
|
||||||
@ -110,9 +112,6 @@ end
|
|||||||
function HeroComp:refresh(battleType)
|
function HeroComp:refresh(battleType)
|
||||||
self.battleType = battleType or self.battleType
|
self.battleType = battleType or self.battleType
|
||||||
|
|
||||||
self:clearAdapt()
|
|
||||||
self:adapt()
|
|
||||||
-- self:refreshCollectEntrance()
|
|
||||||
self:updateFilter()
|
self:updateFilter()
|
||||||
if self.battleType == GConst.BattleConst.FORMATION_TYPE.STAGE then
|
if self.battleType == GConst.BattleConst.FORMATION_TYPE.STAGE then
|
||||||
self:refreshStageFormation()
|
self:refreshStageFormation()
|
||||||
@ -317,35 +316,6 @@ function HeroComp:onClickHero(cell, heroId)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function HeroComp:adapt()
|
|
||||||
local addH = GFunc.calculateFitSizeY()
|
|
||||||
local uiMap = self:getBaseObject():genAllChildren()
|
|
||||||
local scrollRect = uiMap["hero_ui.bottom_bg.scrollrect"]
|
|
||||||
local viewport = uiMap["hero_ui.bottom_bg.scrollrect.viewport"]
|
|
||||||
if not self.rectDefaultSize then
|
|
||||||
self.rectDefaultSize = scrollRect:getSizeDelta()
|
|
||||||
end
|
|
||||||
if not self.viewDefaultSize then
|
|
||||||
self.viewDefaultSize = viewport:getSizeDelta()
|
|
||||||
end
|
|
||||||
scrollRect:setSizeDelta(self.rectDefaultSize.x, self.rectDefaultSize.y + addH)
|
|
||||||
viewport:setSizeDelta(self.viewDefaultSize.x, self.viewDefaultSize.y + addH)
|
|
||||||
end
|
|
||||||
|
|
||||||
function HeroComp:clearAdapt()
|
|
||||||
local uiMap = self:getBaseObject():genAllChildren()
|
|
||||||
local scrollRect = uiMap["hero_ui.bottom_bg.scrollrect"]
|
|
||||||
local viewport = uiMap["hero_ui.bottom_bg.scrollrect.viewport"]
|
|
||||||
if not self.rectDefaultSize then
|
|
||||||
self.rectDefaultSize = scrollRect:getSizeDelta()
|
|
||||||
end
|
|
||||||
if not self.viewDefaultSize then
|
|
||||||
self.viewDefaultSize = viewport:getSizeDelta()
|
|
||||||
end
|
|
||||||
scrollRect:setSizeDelta(self.rectDefaultSize.x, self.rectDefaultSize.y)
|
|
||||||
viewport:setSizeDelta(self.viewDefaultSize.x, self.viewDefaultSize.y)
|
|
||||||
end
|
|
||||||
|
|
||||||
function HeroComp:getHeroCell(heroId)
|
function HeroComp:getHeroCell(heroId)
|
||||||
if not self.scrollRect then
|
if not self.scrollRect then
|
||||||
return
|
return
|
||||||
|
|||||||
@ -355,7 +355,7 @@ function SummonMainUI:onSummon(count, isAd)
|
|||||||
return
|
return
|
||||||
else
|
else
|
||||||
for i, cost in ipairs(costs) do
|
for i, cost in ipairs(costs) do
|
||||||
if not GFunc.checkCost(cost.id, GFunc.getRewardNum(cost) * count, true) then
|
if not GFunc.checkCost(cost.id, GFunc.getRewardNum(cost), true) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -10,6 +10,7 @@ function HeroEntity:ctor(cfgId, lv, skin, star)
|
|||||||
self.config = ConfigManager:getConfig("hero")[self.cfgId]
|
self.config = ConfigManager:getConfig("hero")[self.cfgId]
|
||||||
self.beginLv = 1 -- 激活等级
|
self.beginLv = 1 -- 激活等级
|
||||||
self.isNew = false
|
self.isNew = false
|
||||||
|
-- self.data.star = 2
|
||||||
|
|
||||||
self.baseAttrOriginal = {}
|
self.baseAttrOriginal = {}
|
||||||
self.starAttr = {}
|
self.starAttr = {}
|
||||||
@ -185,7 +186,7 @@ function HeroEntity:_updateStarAttr()
|
|||||||
self.starAttr = {}
|
self.starAttr = {}
|
||||||
for i = 1, self.data.star do
|
for i = 1, self.data.star do
|
||||||
local attr = self:getStarAttrCfg()[i]
|
local attr = self:getStarAttrCfg()[i]
|
||||||
self.starAttr[attr.type] = attr.num
|
self.starAttr[attr.type] = (self.starAttr[attr.type] or 0) + attr.num
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -115,7 +115,7 @@ function TalentData:_updateAllAttr()
|
|||||||
local lv = self:getLevels(id)
|
local lv = self:getLevels(id)
|
||||||
if lv and lv > 0 and cfg.attr then
|
if lv and lv > 0 and cfg.attr then
|
||||||
for _, v in ipairs(cfg.attr) do
|
for _, v in ipairs(cfg.attr) do
|
||||||
self.allAttr[v.type] = (self.allAttr[v.type] or 0) + v.num
|
self.allAttr[v.type] = (self.allAttr[v.type] or 0) + v.num * lv
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user