Merge branch 'dev_20230829' of http://git.juzugame.com/b6-client/b6-lua into dev_20230829
This commit is contained in:
commit
652b75c637
@ -60,10 +60,11 @@ function ArenaGradingRewardCell:refresh(id)
|
|||||||
end)
|
end)
|
||||||
self.txGrading:setText(DataManager.ArenaData:getGradingName(gradingId))
|
self.txGrading:setText(DataManager.ArenaData:getGradingName(gradingId))
|
||||||
|
|
||||||
|
self.baseObject:setSizeDeltaY(DataManager.ArenaData:getGradingRewardItemHeight(self.id))
|
||||||
if cfg.unlock_hero and #cfg.unlock_hero > 0 then
|
if cfg.unlock_hero and #cfg.unlock_hero > 0 then
|
||||||
-- 解锁英雄
|
-- 解锁英雄
|
||||||
|
self.gradingNode:setActive(true)
|
||||||
self.gradingNode:setAnchoredPositionY(UNLOCK_GRADING_POSY)
|
self.gradingNode:setAnchoredPositionY(UNLOCK_GRADING_POSY)
|
||||||
self.baseObject:setSizeDeltaY(DataManager.ArenaData:getGradingRewardItemHeight(true))
|
|
||||||
self.heroUnlock:setActive(true)
|
self.heroUnlock:setActive(true)
|
||||||
|
|
||||||
if maxPoint >= cfg.score then
|
if maxPoint >= cfg.score then
|
||||||
@ -88,8 +89,12 @@ function ArenaGradingRewardCell:refresh(id)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.gradingNode:setAnchoredPositionY(COMMON_GRADING_POSY)
|
if DataManager.ArenaData:isGradingMin(self.id) then
|
||||||
self.baseObject:setSizeDeltaY(DataManager.ArenaData:getGradingRewardItemHeight(false))
|
self.gradingNode:setActive(true)
|
||||||
|
self.gradingNode:setAnchoredPositionY(COMMON_GRADING_POSY)
|
||||||
|
else
|
||||||
|
self.gradingNode:setActive(false)
|
||||||
|
end
|
||||||
self.heroUnlock:setActive(false)
|
self.heroUnlock:setActive(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -105,13 +110,14 @@ function ArenaGradingRewardCell:refresh(id)
|
|||||||
local posY = rootHeight * curProg
|
local posY = rootHeight * curProg
|
||||||
|
|
||||||
-- 高度超框处理
|
-- 高度超框处理
|
||||||
if self.id == 1 or self.id == #table.keys(cfg) then
|
if self.id == 1 or self.id == #DataManager.ArenaData:getGradingRewardCfg() then
|
||||||
local tagHeight = self.tagProg:fastGetSizeDeltaY()
|
local tagHeight = self.tagProg:fastGetSizeDeltaY()
|
||||||
if posY < tagHeight / 2 then
|
if posY < tagHeight / 2 then
|
||||||
posY = tagHeight / 2
|
posY = tagHeight / 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.tagProg:setAnchoredPositionY(posY)
|
self.tagProg:setAnchoredPositionY(posY)
|
||||||
|
self.baseObject:getTransform():SetAsLastSibling()
|
||||||
else
|
else
|
||||||
self.tagProg:setVisible(false)
|
self.tagProg:setVisible(false)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -568,11 +568,8 @@ function ArenaData:getGradingRewardProgressByScore(id, score)
|
|||||||
|
|
||||||
if id == 1 then
|
if id == 1 then
|
||||||
-- 第一个档位特殊处理
|
-- 第一个档位特殊处理
|
||||||
local minScore = self:getSeasonGradingMinScore()
|
local prog = 0.5
|
||||||
local prog = (score - minScore) / (point - minScore)
|
|
||||||
if prog > 0.5 then
|
|
||||||
prog = 0.5
|
|
||||||
end
|
|
||||||
if score > point then
|
if score > point then
|
||||||
prog = prog + ((score - point) / (rangeMax - point))
|
prog = prog + ((score - point) / (rangeMax - point))
|
||||||
end
|
end
|
||||||
@ -606,12 +603,35 @@ function ArenaData:hasGradingRewardRedDot()
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local GRADING_REWARD_COMMON_SIZE = 460
|
-- 奖励段位是否是段位分界线
|
||||||
|
function ArenaData:isGradingMin(id)
|
||||||
|
local score = self:getGradingRewardCfg()[id].score
|
||||||
|
|
||||||
|
for id, data in pairs(self.cfgRank) do
|
||||||
|
if score == data.score then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local GRADING_REWARD_COMMON_SIZE = 220
|
||||||
|
local GRADING_REWARD_GRADING_SIZE = 460
|
||||||
local GRADING_REWARD_UNLOCK_SIZE = 570
|
local GRADING_REWARD_UNLOCK_SIZE = 570
|
||||||
|
|
||||||
-- 获取段位奖励项的高
|
-- 获取段位奖励项的高
|
||||||
function ArenaData:getGradingRewardItemHeight(hasUnlockHero)
|
function ArenaData:getGradingRewardItemHeight(id)
|
||||||
return hasUnlockHero and GRADING_REWARD_UNLOCK_SIZE or GRADING_REWARD_COMMON_SIZE
|
if self:getGradingRewardCfg()[id].unlock_hero ~= nil then
|
||||||
|
-- 有解锁的英雄
|
||||||
|
return GRADING_REWARD_UNLOCK_SIZE
|
||||||
|
elseif self:isGradingMin(id) then
|
||||||
|
-- 是段位分界线
|
||||||
|
return GRADING_REWARD_GRADING_SIZE
|
||||||
|
else
|
||||||
|
-- 普通奖励
|
||||||
|
return GRADING_REWARD_COMMON_SIZE
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取当前列表定位所在档位的高度
|
-- 获取当前列表定位所在档位的高度
|
||||||
@ -624,7 +644,7 @@ function ArenaData:getCurTargetPosY()
|
|||||||
return totalHeight
|
return totalHeight
|
||||||
end
|
end
|
||||||
|
|
||||||
totalHeight = totalHeight + (data.unlock_hero ~= nil and GRADING_REWARD_UNLOCK_SIZE or GRADING_REWARD_COMMON_SIZE)
|
totalHeight = totalHeight + self:getGradingRewardItemHeight(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 判断当前档位
|
-- 判断当前档位
|
||||||
@ -636,7 +656,7 @@ function ArenaData:getCurTargetPosY()
|
|||||||
return totalHeight
|
return totalHeight
|
||||||
end
|
end
|
||||||
|
|
||||||
totalHeight = totalHeight + (data.unlock_hero ~= nil and GRADING_REWARD_UNLOCK_SIZE or GRADING_REWARD_COMMON_SIZE)
|
totalHeight = totalHeight + self:getGradingRewardItemHeight(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user