战报阵容

This commit is contained in:
xiekaidong 2023-07-17 15:52:04 +08:00
parent 85f016086d
commit e2d08a7ffa
4 changed files with 16 additions and 3 deletions

View File

@ -14,7 +14,8 @@ TipsManager.ALIGN_TYPE = {
LEFT_BOTTOM = 10,
RIGHT_TOP = 11,
RIGHT_CENTER = 12,
RIGHT_BOTTOM = 13
RIGHT_BOTTOM = 13,
CUSTOM = 14,
}
TipsManager.REWARDS_TIPS_TYPE = {
@ -110,6 +111,7 @@ end
-- formation = {{id = 000, level = 000}, {id = 000, level = 000}, ...}
function TipsManager:showHeroFormation(targetObj, formation)
local tarCornerScreenPos, location = self:getCornerScreenPosition(targetObj, TipsManager.ALIGN_TYPE.BOTTOM_CENTER)
location = TipsManager.ALIGN_TYPE.CUSTOM
local params = {
tarCornerScreenPos = tarCornerScreenPos,
location = location,
@ -242,7 +244,11 @@ function TipsManager:getCornerScreenPosition(tarPrefabObj, alignType)
screenPoint = uiCamera:WorldToScreenPoint(tarCorner)
end
end
return BF.Vector2(screenPoint.x, screenPoint.y), location
if screenPoint then
return BF.Vector2(screenPoint.x, screenPoint.y), location
else
return BF.Vector2(0, 0), location
end
end
return TipsManager

View File

@ -82,6 +82,9 @@ function ArenaRecentBattleUI:refreshRecord(obj, info)
local playerHeadCell = CellManager:addCellComp(uiMap["player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
playerHeadCell:refresh(info.match_info.avatar, info.match_info.avatar_frame)
uiMap["player_head_cell"]:addClickListener(function()
ModuleManager.TipsManager:showHeroFormation(uiMap["player_head_cell"], info.match_info.array_heroes)
end)
local name = info.match_info.name
if name == nil or #name == 0 then
name = I18N:getGlobalText(I18N.GlobalConst.NEW_PLAYER)

View File

@ -87,6 +87,10 @@ function BaseTips:locate(location, originSizeDelta, node, tarCornerScreenPos)
local posy = node:getTransform().sizeDelta.y/2 - originSizeDelta.y*(0.5 - self:getPosPercentY())
node:addLocalPosition(tarCornerLp.x + self:getOffsetX(), tarCornerLp.y + posy, 0)
self:adaptWhenOverScreen(node, 0, 0.5)
elseif location == ModuleManager.TipsManager.ALIGN_TYPE.CUSTOM then
local pivot = node:getTransform().pivot
node:addLocalPosition(tarCornerLp.x, tarCornerLp.y, 0)
self:adaptWhenOverScreen(node, pivot.x, pivot.y)
end
self:finalSetPos(node)

View File

@ -17,7 +17,7 @@ end
function FormationTips:init()
local uiMap = self.root:genAllChildren()
self.bg = uiMap["formation_tips.bg"]
self.bg = uiMap["formation_tips.bg.bg"]
self.heroFormation = uiMap["formation_tips.bg.hero_formation_comp"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_FORMATION_COMP)
end