fix bug
This commit is contained in:
parent
8c370ef327
commit
2e15e45ae0
@ -1,6 +1,8 @@
|
|||||||
-- 竞技场:匹配
|
-- 竞技场:匹配
|
||||||
local ArenaMatchUI = class("ArenaMatchUI", BaseUI)
|
local ArenaMatchUI = class("ArenaMatchUI", BaseUI)
|
||||||
|
|
||||||
|
local HERO_FORMATION_COMP = "app/ui/arena/comp/hero_formation_comp"
|
||||||
|
|
||||||
function ArenaMatchUI:isFullScreen()
|
function ArenaMatchUI:isFullScreen()
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -75,18 +77,21 @@ function ArenaMatchUI:onLoadRootComplete()
|
|||||||
self.matchResult = uiMap["arena_match_ui.match_result"]
|
self.matchResult = uiMap["arena_match_ui.match_result"]
|
||||||
self.btnClose = uiMap["arena_match_ui.match_result.btn_close"]
|
self.btnClose = uiMap["arena_match_ui.match_result.btn_close"]
|
||||||
self.matchAnimator = self.matchResult:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
|
self.matchAnimator = self.matchResult:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
|
||||||
|
self.matchAnimator.enabled = false
|
||||||
-- 对手信息
|
-- 对手信息
|
||||||
self.matchAvatar = CellManager:addCellComp(uiMap["arena_match_ui.match_result.left_node.match.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
|
self.matchAvatar = CellManager:addCellComp(uiMap["arena_match_ui.match_result.left_node.match.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
|
||||||
self.matchTxName = uiMap["arena_match_ui.match_result.left_node.match.info.tx_name"]
|
self.matchTxName = uiMap["arena_match_ui.match_result.left_node.match.info.tx_name"]
|
||||||
self.matchTxLevel = uiMap["arena_match_ui.match_result.left_node.match.info.tx_level"]
|
self.matchTxLevel = uiMap["arena_match_ui.match_result.left_node.match.info.tx_level"]
|
||||||
self.matchGrading = uiMap["arena_match_ui.match_result.left_node.match.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL)
|
self.matchGrading = uiMap["arena_match_ui.match_result.left_node.match.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL)
|
||||||
self.matchHeroFormationComp = uiMap["arena_match_ui.match_result.left_node.match.formation.hero_formation_comp"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_FORMATION_COMP)
|
self.matchHeroFormationComp = uiMap["arena_match_ui.match_result.left_node.match.formation.hero_formation_comp"]:addLuaComponent(HERO_FORMATION_COMP)
|
||||||
|
self.matchHeroFormationComp:setCellActive(false)
|
||||||
-- 自己信息
|
-- 自己信息
|
||||||
self.selfAvatar = CellManager:addCellComp(uiMap["arena_match_ui.match_result.right_node.self.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
|
self.selfAvatar = CellManager:addCellComp(uiMap["arena_match_ui.match_result.right_node.self.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
|
||||||
self.selfTxName = uiMap["arena_match_ui.match_result.right_node.self.info.tx_name"]
|
self.selfTxName = uiMap["arena_match_ui.match_result.right_node.self.info.tx_name"]
|
||||||
self.selfTxLevel = uiMap["arena_match_ui.match_result.right_node.self.info.tx_level"]
|
self.selfTxLevel = uiMap["arena_match_ui.match_result.right_node.self.info.tx_level"]
|
||||||
self.selfGrading = uiMap["arena_match_ui.match_result.right_node.self.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL)
|
self.selfGrading = uiMap["arena_match_ui.match_result.right_node.self.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL)
|
||||||
self.selfHeroFormationComp = uiMap["arena_match_ui.match_result.right_node.self.formation.hero_formation_comp"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_FORMATION_COMP)
|
self.selfHeroFormationComp = uiMap["arena_match_ui.match_result.right_node.self.formation.hero_formation_comp"]:addLuaComponent(HERO_FORMATION_COMP)
|
||||||
|
self.selfHeroFormationComp:setCellActive(false)
|
||||||
-- 功能按钮
|
-- 功能按钮
|
||||||
self.btnStart = uiMap["arena_match_ui.match_result.btn_start"]
|
self.btnStart = uiMap["arena_match_ui.match_result.btn_start"]
|
||||||
self.imgCost = uiMap["arena_match_ui.match_result.btn_start.cost.img_cost"]
|
self.imgCost = uiMap["arena_match_ui.match_result.btn_start.cost.img_cost"]
|
||||||
@ -130,9 +135,11 @@ function ArenaMatchUI:onRefresh()
|
|||||||
ModuleManager.ArenaManager:reqMatch()
|
ModuleManager.ArenaManager:reqMatch()
|
||||||
self:showMatchLoading()
|
self:showMatchLoading()
|
||||||
else
|
else
|
||||||
|
self:showMatchResult()
|
||||||
self.matchSpine:setActive(true)
|
self.matchSpine:setActive(true)
|
||||||
self.matchSpine:playAnimComplete("die", false, true, function()
|
self.matchSpine:playAnimComplete("die", false, true, function()
|
||||||
self:showMatchResult()
|
self:showMatchResultBtn()
|
||||||
|
self.matchAnimator.enabled = true
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -157,9 +164,11 @@ function ArenaMatchUI:showMatchLoading()
|
|||||||
self:unscheduleGlobal(self.waitSid)
|
self:unscheduleGlobal(self.waitSid)
|
||||||
end
|
end
|
||||||
self.waitSid = self:performWithDelayGlobal(function()
|
self.waitSid = self:performWithDelayGlobal(function()
|
||||||
|
self:showMatchResult()
|
||||||
self.matchSpine:setActive(true)
|
self.matchSpine:setActive(true)
|
||||||
self.matchSpine:playAnimComplete("die", false, true, function()
|
self.matchSpine:playAnimComplete("die", false, true, function()
|
||||||
self:showMatchResult()
|
self:showMatchResultBtn()
|
||||||
|
self.matchAnimator.enabled = true
|
||||||
end)
|
end)
|
||||||
end, 1.5)
|
end, 1.5)
|
||||||
end
|
end
|
||||||
@ -173,9 +182,11 @@ function ArenaMatchUI:showMatchResult()
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.matchLoading:setActive(false)
|
self.matchLoading:setActive(false)
|
||||||
self.matchResult:setActive(true)
|
self.matchResult:setActive(false)
|
||||||
|
self.btnStart:setActive(false)
|
||||||
|
self.btnRematch:setActive(false)
|
||||||
|
self.btnFormation:setActive(false)
|
||||||
UIManager:setBarsVisible(self, true)
|
UIManager:setBarsVisible(self, true)
|
||||||
self.vsVfx:setActive(true)
|
|
||||||
|
|
||||||
-- self.spineVS:playAnimComplete("born", false, true, function()
|
-- self.spineVS:playAnimComplete("born", false, true, function()
|
||||||
-- self.spineVS:playAnim("idle", true, true)
|
-- self.spineVS:playAnim("idle", true, true)
|
||||||
@ -241,6 +252,16 @@ function ArenaMatchUI:showMatchResult()
|
|||||||
self:refreshCountdown()
|
self:refreshCountdown()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ArenaMatchUI:showMatchResultBtn()
|
||||||
|
self.matchResult:setActive(true)
|
||||||
|
self.vsVfx:setActive(true)
|
||||||
|
self:performWithDelayGlobal(function()
|
||||||
|
self.btnStart:setActive(true)
|
||||||
|
self.btnRematch:setActive(true)
|
||||||
|
self.btnFormation:setActive(true)
|
||||||
|
end, 0.4)
|
||||||
|
end
|
||||||
|
|
||||||
function ArenaMatchUI:refreshCountdown()
|
function ArenaMatchUI:refreshCountdown()
|
||||||
self.freeRematchCD = self.freeRematchCD - 1
|
self.freeRematchCD = self.freeRematchCD - 1
|
||||||
if self.freeRematchCD <= 0 then
|
if self.freeRematchCD <= 0 then
|
||||||
|
|||||||
31
lua/app/ui/arena/cell/hero_cell.lua
Normal file
31
lua/app/ui/arena/cell/hero_cell.lua
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
local HeroCell = class("HeroCell", BaseCell)
|
||||||
|
|
||||||
|
function HeroCell:init()
|
||||||
|
local uiMap = self.baseObject:genAllChildren()
|
||||||
|
-- 通用
|
||||||
|
self.icon = uiMap["hero_cell.hero_bg.icon"]
|
||||||
|
self.matchImg = uiMap["hero_cell.hero_bg.match_img"]
|
||||||
|
self.lvTx = uiMap["hero_cell.hero_bg.lv_tx"]
|
||||||
|
self.nameTx = uiMap["hero_cell.hero_bg.tx_name"]
|
||||||
|
self.starComp = uiMap["hero_cell.hero_bg.star_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.STAR_CELL)
|
||||||
|
end
|
||||||
|
|
||||||
|
function HeroCell:refreshBriefInfo(heroEntity)
|
||||||
|
local id = heroEntity:getCfgId()
|
||||||
|
local level = heroEntity:getLv()
|
||||||
|
local star = heroEntity:getStar()
|
||||||
|
self.starComp:refresh(star)
|
||||||
|
|
||||||
|
local matchType = heroEntity:getMatchType()
|
||||||
|
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[matchType])
|
||||||
|
local avatarName = DataManager.PlayerData:getAvatarIconId(id)
|
||||||
|
self.icon:setSprite(GConst.ATLAS_PATH.ICON_AVATAR, avatarName)
|
||||||
|
self.nameTx:setText(ModuleManager.HeroManager:getHeroName(id))
|
||||||
|
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.RUNES_DESC_26, level))
|
||||||
|
end
|
||||||
|
|
||||||
|
function HeroCell:setActive(active)
|
||||||
|
self.baseObject:setActive(active)
|
||||||
|
end
|
||||||
|
|
||||||
|
return HeroCell
|
||||||
10
lua/app/ui/arena/cell/hero_cell.lua.meta
Normal file
10
lua/app/ui/arena/cell/hero_cell.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 17c15ae08807840d5a89e68712fcd103
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
8
lua/app/ui/arena/comp.meta
Normal file
8
lua/app/ui/arena/comp.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 61e7efec58d324899a6cbee9f2267e45
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
88
lua/app/ui/arena/comp/hero_formation_comp.lua
Normal file
88
lua/app/ui/arena/comp/hero_formation_comp.lua
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
-- 英雄编队
|
||||||
|
local HeroFormationComp = class("HeroFormationComp", LuaComponent)
|
||||||
|
|
||||||
|
local HERO_CELL = "app/ui/arena/cell/hero_cell"
|
||||||
|
|
||||||
|
function HeroFormationComp:init()
|
||||||
|
local uiMap = self.baseObject:genAllChildren()
|
||||||
|
|
||||||
|
self.heroCells = {
|
||||||
|
uiMap["hero_formation_comp.hero_cell_1"]:addLuaComponent(HERO_CELL),
|
||||||
|
uiMap["hero_formation_comp.hero_cell_2"]:addLuaComponent(HERO_CELL),
|
||||||
|
uiMap["hero_formation_comp.hero_cell_3"]:addLuaComponent(HERO_CELL),
|
||||||
|
uiMap["hero_formation_comp.hero_cell_4"]:addLuaComponent(HERO_CELL),
|
||||||
|
uiMap["hero_formation_comp.hero_cell_5"]:addLuaComponent(HERO_CELL),
|
||||||
|
}
|
||||||
|
-- self:setFormationActive(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 显示英雄升级/使用等等信息
|
||||||
|
-- function HeroFormationComp:refresh()
|
||||||
|
-- local formation = DataManager.FormationData:getStageFormation()
|
||||||
|
-- for i, heroCell in ipairs(self.heroCells) do
|
||||||
|
-- if formation[i] then
|
||||||
|
-- local heroEntity = DataManager.HeroData:getHeroById(formation[i])
|
||||||
|
-- if heroEntity then
|
||||||
|
-- heroCell:setVisible(true, 0.6)
|
||||||
|
-- heroCell:refresh(heroEntity)
|
||||||
|
-- heroCell:addClickListener(function()
|
||||||
|
-- ModuleManager.HeroManager:showHeroDetailUI(heroEntity:getCfgId())
|
||||||
|
-- end)
|
||||||
|
-- else
|
||||||
|
-- heroCell:setVisible(false)
|
||||||
|
-- end
|
||||||
|
-- else
|
||||||
|
-- heroCell:setVisible(false)
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- function HeroFormationComp:refreshByFormation(formation)
|
||||||
|
-- for i, heroCell in ipairs(self.heroCells) do
|
||||||
|
-- if formation[i] then
|
||||||
|
-- local heroEntity = DataManager.HeroData:getHeroById(formation[i])
|
||||||
|
-- if heroEntity then
|
||||||
|
-- heroCell:setVisible(true, 0.6)
|
||||||
|
-- heroCell:refresh(heroEntity)
|
||||||
|
-- heroCell:addClickListener(function()
|
||||||
|
-- ModuleManager.HeroManager:showHeroDetailUI(heroEntity:getCfgId())
|
||||||
|
-- end)
|
||||||
|
-- else
|
||||||
|
-- heroCell:setVisible(false)
|
||||||
|
-- end
|
||||||
|
-- else
|
||||||
|
-- heroCell:setVisible(false)
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
|
||||||
|
function HeroFormationComp:refreshByEntitys(formation)
|
||||||
|
for i, heroCell in ipairs(self.heroCells) do
|
||||||
|
local heroEntity = formation[i]
|
||||||
|
if heroEntity then
|
||||||
|
heroCell:setActive(true)
|
||||||
|
heroCell:refreshBriefInfo(heroEntity)
|
||||||
|
heroCell:addClickListener(function()
|
||||||
|
ModuleManager.HeroManager:showHeroDetailUI(heroEntity:getCfgId(), true, heroEntity)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
heroCell:setActive(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function HeroFormationComp:setCellActive(active)
|
||||||
|
for i, heroCell in ipairs(self.heroCells) do
|
||||||
|
heroCell:setActive(active)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- function HeroFormationComp:setFormationActive(active)
|
||||||
|
-- self.baseObject:setActive(active)
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- function HeroFormationComp:getFormationPosY()
|
||||||
|
-- return self.baseObject:fastGetAnchoredPositionY()
|
||||||
|
-- end
|
||||||
|
|
||||||
|
return HeroFormationComp
|
||||||
10
lua/app/ui/arena/comp/hero_formation_comp.lua.meta
Normal file
10
lua/app/ui/arena/comp/hero_formation_comp.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7b608aa45c1604b518e7f1e39e3169f9
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
@ -179,8 +179,8 @@ function BattleResultUI:onRefresh()
|
|||||||
self:refreshUnitInfo()
|
self:refreshUnitInfo()
|
||||||
self:refreshRewards()
|
self:refreshRewards()
|
||||||
self:refreshArenaNode()
|
self:refreshArenaNode()
|
||||||
self:refreshArenaBoxNode()
|
|
||||||
self:refreshDoubleNode()
|
self:refreshDoubleNode()
|
||||||
|
self:refreshArenaBoxNode()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleResultUI:refreshVictoryNode()
|
function BattleResultUI:refreshVictoryNode()
|
||||||
@ -316,9 +316,14 @@ end
|
|||||||
|
|
||||||
function BattleResultUI:refreshArenaBoxNode()
|
function BattleResultUI:refreshArenaBoxNode()
|
||||||
self.arenaBoxNode:setActive(false)
|
self.arenaBoxNode:setActive(false)
|
||||||
|
if self.battleType ~= GConst.BattleConst.BATTLE_TYPE.ARENA then
|
||||||
|
return
|
||||||
|
end
|
||||||
if not self:hasArenaBoxNode() then
|
if not self:hasArenaBoxNode() then
|
||||||
|
self.okBtn:setActive(true)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
self.okBtn:setActive(false)
|
||||||
self.arenaBoxNode:setActive(true)
|
self.arenaBoxNode:setActive(true)
|
||||||
self.arenaBoxBtnGet:setActive(not self.getedArenaAdBox)
|
self.arenaBoxBtnGet:setActive(not self.getedArenaAdBox)
|
||||||
self.arenaBoxTxGet:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM))
|
self.arenaBoxTxGet:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM))
|
||||||
|
|||||||
@ -1,15 +1,17 @@
|
|||||||
-- 英雄编队
|
-- 英雄编队
|
||||||
local HeroFormationComp = class("HeroFormationComp", LuaComponent)
|
local HeroFormationComp = class("HeroFormationComp", LuaComponent)
|
||||||
|
|
||||||
|
local HERO_CELL = "app/ui/arena/cell/hero_cell"
|
||||||
|
|
||||||
function HeroFormationComp:init()
|
function HeroFormationComp:init()
|
||||||
local uiMap = self.baseObject:genAllChildren()
|
local uiMap = self.baseObject:genAllChildren()
|
||||||
|
|
||||||
self.heroCells = {
|
self.heroCells = {
|
||||||
uiMap["hero_formation_comp.hero_cell_1"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_CELL),
|
uiMap["hero_formation_comp.hero_cell_1"]:addLuaComponent(HERO_CELL),
|
||||||
uiMap["hero_formation_comp.hero_cell_2"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_CELL),
|
uiMap["hero_formation_comp.hero_cell_2"]:addLuaComponent(HERO_CELL),
|
||||||
uiMap["hero_formation_comp.hero_cell_3"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_CELL),
|
uiMap["hero_formation_comp.hero_cell_3"]:addLuaComponent(HERO_CELL),
|
||||||
uiMap["hero_formation_comp.hero_cell_4"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_CELL),
|
uiMap["hero_formation_comp.hero_cell_4"]:addLuaComponent(HERO_CELL),
|
||||||
uiMap["hero_formation_comp.hero_cell_5"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_CELL),
|
uiMap["hero_formation_comp.hero_cell_5"]:addLuaComponent(HERO_CELL),
|
||||||
}
|
}
|
||||||
self:setFormationActive(true)
|
self:setFormationActive(true)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user