完善细节
This commit is contained in:
parent
77b5452d00
commit
c2843e5a88
@ -171,6 +171,7 @@ GConst.TYPEOF_LUA_CLASS = {
|
||||
-- cell
|
||||
ITEM_CELL = "app/ui/common/cell/item_cell",
|
||||
HERO_CELL = "app/ui/common/cell/hero_cell",
|
||||
PLAYER_INFO_CELL = "app/ui/common/cell/player_info_cell",
|
||||
PLAYER_HEAD_CELL = "app/ui/common/cell/player_head_cell",
|
||||
REWARD_CELL = "app/ui/common/cell/reward_cell",
|
||||
LARGE_HERO_CELL = "app/ui/common/cell/large_hero_cell",
|
||||
|
||||
@ -94,6 +94,14 @@ end
|
||||
|
||||
function ArenaManager:rspSettlement(result)
|
||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||
|
||||
-- 异常数据判断处理
|
||||
local curScore = DataManager.ArenaData:getScore()
|
||||
local minScore = DataManager.ArenaData:getGradingMinScore()
|
||||
if curScore + result.settlement.incr_score < minScore then
|
||||
result.settlement.incr_score = minScore - curScore
|
||||
end
|
||||
|
||||
DataManager.ArenaData:onBattleResultReceived(result.settlement)
|
||||
local checkCount = 0
|
||||
if result.settlement.win then
|
||||
|
||||
@ -17,19 +17,19 @@ function ArenaFormationUI:onPressBackspace()
|
||||
self:closeUI()
|
||||
end
|
||||
|
||||
-- function ArenaFormationUI:getCurrencyParams()
|
||||
-- if self.currencyParams == nil then
|
||||
-- self.currencyParams = {
|
||||
-- itemIds = {
|
||||
-- GConst.ItemConst.ITEM_ID_GEM,
|
||||
-- GConst.ItemConst.ITEM_ID_ARENA_TICKET
|
||||
-- },
|
||||
-- showType = GConst.CURRENCY_TYPE.HORIZONTAL
|
||||
-- }
|
||||
-- end
|
||||
function ArenaFormationUI:getCurrencyParams()
|
||||
if self.currencyParams == nil then
|
||||
self.currencyParams = {
|
||||
itemIds = {
|
||||
GConst.ItemConst.ITEM_ID_GEM,
|
||||
GConst.ItemConst.ITEM_ID_ARENA_TICKET
|
||||
},
|
||||
showType = GConst.CURRENCY_TYPE.HORIZONTAL
|
||||
}
|
||||
end
|
||||
|
||||
-- return self.currencyParams
|
||||
-- end
|
||||
return self.currencyParams
|
||||
end
|
||||
|
||||
function ArenaFormationUI:ctor(params)
|
||||
self.formationType = params
|
||||
@ -61,6 +61,8 @@ function ArenaFormationUI:onLoadRootComplete()
|
||||
heroUI:genAllChildren()
|
||||
self.heroComp = heroUI:addLuaComponent("app/ui/hero/hero_comp")
|
||||
|
||||
CellManager:addCellComp(uiMap["arena_formation_ui.player_info_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_INFO_CELL):refresh()
|
||||
|
||||
self:bind(DataManager.HeroData, "isDirty", function()
|
||||
self:onRefresh()
|
||||
end)
|
||||
|
||||
@ -98,7 +98,11 @@ function ArenaRecentBattleUI:refreshRecord(obj, info)
|
||||
end
|
||||
else
|
||||
obj:setSprite(GConst.ATLAS_PATH.ARENA,"arena_bg_4")
|
||||
uiMap["tx_score"]:setText("<color=#FF5454>"..info.incr_score.."</color>")
|
||||
if info.incr_score == 0 then
|
||||
uiMap["tx_score"]:setText("<color=#FF5454>-"..info.incr_score.."</color>")
|
||||
else
|
||||
uiMap["tx_score"]:setText("<color=#FF5454>"..info.incr_score.."</color>")
|
||||
end
|
||||
uiMap["img_result"]:setSprite(GConst.ATLAS_PATH.ARENA, "arena_dec_3")
|
||||
if info.attacker then
|
||||
uiMap["tx_result"]:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_20))
|
||||
|
||||
@ -63,6 +63,9 @@ function ArenaSeasonRewardUI:onLoadRootComplete()
|
||||
self:bind(DataManager.ArenaData, "isDirty", function()
|
||||
self:closeUI()
|
||||
end)
|
||||
self:addEventListener(EventManager.CUSTOM_EVENT.ARENA_SEASON_END, function()
|
||||
self:closeUI()
|
||||
end)
|
||||
end
|
||||
|
||||
function ArenaSeasonRewardUI:onRefresh()
|
||||
|
||||
@ -253,6 +253,8 @@ function BattleResultUI:refreshArenaNode()
|
||||
|
||||
if self.incrScore > 0 then
|
||||
self.arenaTxScore:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_27, "+"..self.incrScore))
|
||||
elseif self.incrScore == 0 then
|
||||
self.arenaTxScore:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_27, "-"..self.incrScore))
|
||||
else
|
||||
self.arenaTxScore:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_27, self.incrScore))
|
||||
end
|
||||
|
||||
23
lua/app/ui/common/cell/player_info_cell.lua
Normal file
23
lua/app/ui/common/cell/player_info_cell.lua
Normal file
@ -0,0 +1,23 @@
|
||||
local PlayerInfoCell = class("PlayerInfoCell", BaseCell)
|
||||
|
||||
function PlayerInfoCell:init()
|
||||
local uiMap = self.baseObject:genAllChildren()
|
||||
|
||||
self.txName = uiMap["player_info_cell.info.tx_name"]
|
||||
self.txLv = uiMap["player_info_cell.info.slider.tx_lv"]
|
||||
self.imgProgExp = uiMap["player_info_cell.info.slider.img_prog_exp"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
|
||||
self.playerHeadCell = CellManager:addCellComp(uiMap["player_info_cell.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
|
||||
|
||||
self:getBaseObject():addClickListener(function ()
|
||||
UIManager:showUI("app/ui/player_info/player_info_ui")
|
||||
end)
|
||||
end
|
||||
|
||||
function PlayerInfoCell:refresh()
|
||||
self.txName:setText(DataManager.PlayerData:getNickname())
|
||||
self.txLv:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, DataManager.PlayerData:getLv()))
|
||||
self.imgProgExp.value = DataManager.PlayerData:getExpPercent()
|
||||
self.playerHeadCell:refresh()
|
||||
end
|
||||
|
||||
return PlayerInfoCell
|
||||
10
lua/app/ui/common/cell/player_info_cell.lua.meta
Normal file
10
lua/app/ui/common/cell/player_info_cell.lua.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1f7dea870d8216645b673b7bc99a68f6
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
@ -130,7 +130,6 @@ function MainCityUI:_display()
|
||||
self:initBottomUI()
|
||||
self:initComp()
|
||||
self:initLeftRightBtns()
|
||||
self:initPlayerInfo()
|
||||
self:initTopNode()
|
||||
self:refreshBottom()
|
||||
end
|
||||
@ -609,25 +608,11 @@ function MainCityUI:setSideBarVisible(visible)
|
||||
self.rightNode:setVisible(visible)
|
||||
end
|
||||
|
||||
function MainCityUI:initPlayerInfo()
|
||||
self.playerSlider = self.uiMap["main_ui.player_node.info.slider.img_prog"]
|
||||
self.playerLvTx = self.uiMap["main_ui.player_node.info.slider.tx_lv"]
|
||||
self.playerNameTx = self.uiMap["main_ui.player_node.info.tx_name"]
|
||||
self.headCell = CellManager:addCellComp(self.uiMap["main_ui.player_node.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
|
||||
self.uiMap["main_ui.player_node"]:addClickListener(function ()
|
||||
UIManager:showUI("app/ui/player_info/player_info_ui")
|
||||
end)
|
||||
self.headCell:refresh()
|
||||
end
|
||||
|
||||
function MainCityUI:refreshPlayerInfo()
|
||||
local lv = DataManager.PlayerData:getLv()
|
||||
self.playerLvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, lv))
|
||||
self.playerSlider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = DataManager.PlayerData:getExpPercent()
|
||||
self.playerNameTx:setText(DataManager.PlayerData:getNickname())
|
||||
if self.headCell then
|
||||
self.headCell:refresh()
|
||||
if not self.playerInfoCell then
|
||||
self.playerInfoCell = CellManager:addCellComp(self.uiMap["main_ui.player_info_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_INFO_CELL)
|
||||
end
|
||||
self.playerInfoCell:refresh()
|
||||
end
|
||||
|
||||
function MainCityUI:initTopNode()
|
||||
|
||||
@ -145,6 +145,9 @@ end
|
||||
-- 获取所在段位的最低积分
|
||||
function ArenaData:getGradingMinScore(score)
|
||||
local id = self:getGradingIdFromScore(score)
|
||||
if not self.cfgRank[id] then
|
||||
id = table.sort(table.keys(self.cfgRank))
|
||||
end
|
||||
return self.cfgRank[id].score
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user