结算界面的表现

This commit is contained in:
xiekaidong 2023-09-16 20:07:15 +08:00
parent 68575924be
commit b60db0e3ef
4 changed files with 88 additions and 13 deletions

View File

@ -285,6 +285,7 @@ end
function ActPvpManager:rspFightEnd(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local herolv = DataManager.ActPvpData:getHeroLv()
DataManager.ActPvpData:recordLastBountyLevel()
DataManager.ActPvpData:updateData(result.activity_pvp)
DataManager.ActPvpData:setLastTurnWin(nil) -- 默认不给状态
DataManager.ActPvpData:setHeroLevelUp(false)

View File

@ -172,7 +172,7 @@ function ActPvpBountyUI:refreshLevelInfo()
uiMap["act_pvp_bounty_ui.bg.bg.point_bg.desc_lv_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_DESC_12))
uiMap["act_pvp_bounty_ui.bg.bg.point_bg.desc_lv"]:setText(lv)
uiMap["act_pvp_bounty_ui.bg.bg.point_bg.desc_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_15))
local needExp = DataManager.ActPvpData:getBountyLevelExp(lv + 1)
local needExp = DataManager.ActPvpData:getBountyLevelExp(lv)
local txSlider = uiMap["act_pvp_bounty_ui.bg.bg.point_bg.desc_slider"]
local slider = uiMap["act_pvp_bounty_ui.bg.bg.point_bg.slider_bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
if needExp <= 0 then -- 满级了

View File

@ -1,3 +1,4 @@
local ProgressBar = require "app/tools/progress_bar"
local BattleActPvpResultUI = class("BattleActPvpResultUI", BaseUI)
local UNIT_RESULT_RERPORT_CELL = "app/ui/battle/cell/unit_result_report_cell"
@ -157,21 +158,85 @@ end
function BattleActPvpResultUI:refreshBountyNode()
local uiMap = self.root:genAllChildren()
local lv = DataManager.ActPvpData:getBountyLevel()
local txLv = uiMap["battle_actpvp_result_ui.reward_node.point_bg.desc_lv"]
uiMap["battle_actpvp_result_ui.reward_node.point_bg.desc_lv_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_DESC_12))
uiMap["battle_actpvp_result_ui.reward_node.point_bg.desc_lv"]:setText(lv)
uiMap["battle_actpvp_result_ui.reward_node.point_bg.desc_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_15))
local needExp = DataManager.ActPvpData:getBountyLevelExp(lv + 1)
local txSlider = uiMap["battle_actpvp_result_ui.reward_node.point_bg.desc_slider"]
local slider = uiMap["battle_actpvp_result_ui.reward_node.point_bg.slider_bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
if needExp <= 0 then -- 满级了
txSlider:setText(I18N:getGlobalText(I18N.GlobalConst.STR_MAX))
slider.value = 1
else
local addExp = 0
local lastLevel, lastExp = DataManager.ActPvpData:getLastBountyLevel()
local curLevel = DataManager.ActPvpData:getBountyLevel()
local exp = DataManager.ActPvpData:getBountyExp()
txSlider:setText(exp .. "/" .. needExp)
slider.value = exp / needExp
if not lastLevel then
lastLevel = curLevel
end
if not lastExp then
lastExp = exp
end
local calExp = lastExp
for i = lastLevel, curLevel - 1 do
local need = DataManager.ActPvpData:getBountyLevelExp(i)
if need > 0 then
addExp = addExp + need - calExp
calExp = 0
end
end
addExp = addExp + exp
local lastNeedExp = DataManager.ActPvpData:getBountyLevelExp(lastLevel)
local oldSliderValue = 0
if lastNeedExp <= 0 then
local need = DataManager.ActPvpData:getBountyLevelExp(lastLevel - 1)
if need <= 0 then
need = 1
end
oldSliderValue = lastExp / need
else
oldSliderValue = lastExp / lastNeedExp
end
local needExp = DataManager.ActPvpData:getBountyLevelExp(curLevel)
local newSliderValue = 0
if needExp <= 0 then
local need = DataManager.ActPvpData:getBountyLevelExp(curLevel - 1)
if need <= 0 then
need = 1
end
newSliderValue = needExp / need
else
newSliderValue = exp / needExp
end
local params = {}
params.ui = self
params.oldLv = lastLevel
params.newLv = curLevel
params.beginPer = oldSliderValue
params.endPer = newSliderValue
params.time = 0.01
params.perStep = 0.01
params.callback = function (curLv, curPer)
slider.value = curPer
local nextCount = DataManager.ActPvpData:getBountyLevelExp(curLv)
local ss = nextCount
if nextCount then
ss = math.floor(curPer * nextCount + 0.0000001)
end
txSlider:setText(ss .. "/" .. nextCount)
txLv:setText(curLv)
end
params.endCallback = function()
txSlider:setText(exp .. "/" .. needExp)
if needExp <= 0 then
txSlider:setText(I18N:getGlobalText(I18N.GlobalConst.STR_MAX))
end
txLv:setText(curLevel)
end
local progressBar = ProgressBar:create()
progressBar:runBar(params)
uiMap["battle_actpvp_result_ui.reward_node.point_bg.desc_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_15) .. "+" .. addExp)
end
function BattleActPvpResultUI:refreshUnitInfo()

View File

@ -405,6 +405,15 @@ function ActPvpData:setHeroLevelUp(up)
self.heroLevelUp = up
end
function ActPvpData:recordLastBountyLevel()
self.lastBountyLevel = self.level
self.lastBountyExp = self.exp
end
function ActPvpData:getLastBountyLevel()
return self.lastBountyLevel, self.lastBountyExp
end
---- 排行榜
function ActPvpData:updateRankInfo(ranks, selfRank)
@ -523,7 +532,7 @@ function ActPvpData:getBountyLevelExp(level)
if not info then
return 0
end
return info.exp
return info.exp or 0
end
function ActPvpData:getBountyList()