战斗内添加日志上报功能
parent
b54534db2f
commit
83999b75d5
|
@ -35,6 +35,7 @@ function this:InitComponent()
|
|||
this.BtnExit = Util.GetGameObject(this.DownRoot, "option/BtnExit")
|
||||
this.ButtonLock = Util.GetGameObject(this.DownRoot, "option/Button/lock")
|
||||
this.BtnGM = Util.GetGameObject(this.DownRoot, "option/Button")
|
||||
this.submit = Util.GetGameObject(this.DownRoot, "bg")
|
||||
|
||||
|
||||
this.DefResult = Util.GetGameObject(this.UpRoot, "result")
|
||||
|
@ -53,6 +54,11 @@ end
|
|||
--绑定事件(用于子类重写)
|
||||
function this:BindEvent()
|
||||
|
||||
Util.AddLongPressClick(this.submit, function()
|
||||
BattleRecordManager.SubmitBattleRecord()
|
||||
end, 0.5)
|
||||
|
||||
|
||||
Util.AddClick(this.BtnTimeScale, function ()
|
||||
if not BattleManager.IsCanOperate() then
|
||||
return
|
||||
|
|
|
@ -235,6 +235,17 @@ function this:SetData(_fightData, _seed, _battleType, _maxRound)
|
|||
|
||||
-- 设置角色展示界面数据
|
||||
-- RoleShowView.SetData(_fightData)
|
||||
|
||||
-- 加入战斗记录
|
||||
local record = {
|
||||
fightData = this.fightData,
|
||||
fightSeed = this.seed,
|
||||
fightType = this.battleType,
|
||||
maxRound = this.maxRound
|
||||
}
|
||||
this.recordId = BattleRecordManager.SetBattleRecord(record)
|
||||
BattleRecordManager.SetBattleBothNameStr(this.nameStr, this.recordId)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
@ -277,17 +288,8 @@ end
|
|||
function this.EndBattle(result)
|
||||
-- 清空数据
|
||||
this.Clear()
|
||||
-- 加入战斗记录
|
||||
local record = {
|
||||
fightData = this.fightData,
|
||||
fightSeed = this.seed,
|
||||
fightType = this.battleType,
|
||||
maxRound = this.maxRound
|
||||
}
|
||||
local battleId = BattleRecordManager.SetBattleRecord(record)
|
||||
BattleRecordManager.SetBattleBothNameStr(this.nameStr, battleId)
|
||||
|
||||
result = result or BattleRecordManager.GetBattleRecordResult(battleId)
|
||||
-- 判断结果
|
||||
result = result or BattleRecordManager.GetBattleRecordResult(this.recordId)
|
||||
|
||||
-- 战斗结束
|
||||
this.root.BattleEnd(result)
|
||||
|
|
Loading…
Reference in New Issue