Skip to content

feat: add Download Replay button to score screen (bounty #1779)#2929

Open
sungdark wants to merge 1 commit into
FreezingMoon:masterfrom
sungdark:bounty/1779-download-replay
Open

feat: add Download Replay button to score screen (bounty #1779)#2929
sungdark wants to merge 1 commit into
FreezingMoon:masterfrom
sungdark:bounty/1779-download-replay

Conversation

@sungdark
Copy link
Copy Markdown

Description

Implements the 'Download Replay' feature as described in issue #1779.

Changes

  • Download Replay Button: Added a button to the score screen (visible after match ends) that triggers game.gamelog.save() to download the match log as a .ab file
  • Icon: Added assets/icons/save-arrow.svg (from game-icons.net, CC BY 3.0, Delapouite)
  • Button Placement: Located in the scoreboardActions area alongside the existing Exit Match button
  • Visibility: Button is hidden during gameplay and only appears after a match ends
  • Hotkey: R (shown in button tooltip)

Technical Details

  • Added btnReplay Button instance in src/ui/interface.ts
  • Added button HTML in src/index.ejs (inside scoreboardActions div)
  • Added CSS .button#replay in src/style/styles.less with the save-arrow background image
  • Button visibility is controlled in toggleScoreboard(gameOver): hidden when gameOver=false, shown when gameOver=true
  • endGame() now also shows the replay button
  • Initial state is hidden in the UI initialization

How it works

The game's GameLog class already has a save() method that serializes the match log and triggers a file download. This PR simply adds a UI button to trigger that method from the score screen.


Bounty: 7 XTR
Payment Address: eB51DWp1uECrLZRLsE2cnyZUzfRWvzUzaJzkatTpQV9

…#1779)

- Added 'Download Replay' button to the score screen (shown after match ends)
- Button triggers game.gamelog.save() which downloads the match log as .ab file
- Added save-arrow.svg icon (game-icons.net, CC BY 3.0, Delapouite)
- Button is hidden during gameplay, only visible after match is over
- Hotkey: R (shown in button tooltip)

Bounty: FreezingMoon#1779 - download match replay | 7 XTR
Payment address: eB51DWp1uECrLZRLsE2cnyZUzfRWvzUzaJzkatTpQV9
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 27, 2026

Someone is attempting to deploy a commit to the FreezingMoon Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant