Create a NewgroundsMedal and add it to the list of medals
id numberThe unique identifier of the medal
name stringName of the medal
description string optionalDescription of the medal
icon string optionalIcon for the medal
src string optionalImage location for the medal
Difficulty from the server once ready, 1 easy to 5 brutal
Point value from the server once ready
Whether the local save holds this medal, false while logged in when Newgrounds holds it
Unlocks a medal if not already unlocked, once Newgrounds confirms it when logged in
- The promise is optional, for when a game wants to know the outcome
- A request that did not reach the server is sent again after the session check every minute, and calling
unlock again while the medal is pending returns the same promise
- One the server refused is not sent again this visit, calling unlock again resolves false without a request
- An answer that the session is gone makes the game play as not logged in, and the pending medals, this one too,
unlock locally unless unlocks are prevented; a refused one only unlocks if it is earned again
- Returns
- Whether the medal is unlocked, once the server has answered when logged in