Files
WT-Offline/patches/gui/battle/open-replay-from-battle-log/replace-row-link.nut
T
N0VAN0M4LY 6c55c64222 feat(replays): open local replays from battle reports
Store the offline session ID in native replay metadata. Match the battle report to its recording and reuse the native player, queue check, and return flow.

Verified TypeScript, GUI and executable patch checks on 2.61.0.37 and 2.61.0.43, and a temporary 2.61.0.43 build. In-game verification is pending.
2026-12-01 11:10:05 +08:00

23 lines
899 B
Plaintext

function addLocalReplayLink(logObj, rowData) {
let sessionId = logObj?.wtoSessionId
if (logObj.type != EULT_SESSION_RESULT || sessionId == null)
return
if (this.localBattleReplays == null) {
let replayScreen = require("%scripts/replays/replayScreen.nut")
this.localBattleReplays = replayScreen?.getLocalBattleReplays?() ?? {}
}
if (!(sessionId in this.localBattleReplays))
return
let link = format("button { talign:t='left'; text:t='#mainmenu/btnViewReplay'; logIdx:t='%d'; "
+ "on_click:t='onViewLocalBattleReplay'; underline{} }", logObj.idx)
rowData.descriptionBlk <- link + (rowData?.descriptionBlk ?? "")
}
function fillLog(logObj) {
let rowName =$"row{logObj.idx}"
let rowObj = this.listObj.findObject(rowName)
let rowData = getUserlogViewData(logObj, this.ugcAllowed)
this.addLocalReplayLink(logObj, rowData)