Skip to content

Commit

Permalink
Add the current round # to /collectables
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellLVP committed Jun 5, 2020
1 parent 76a974d commit 1be483b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions javascript/features/collectables/collectable_commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class CollectableCommands {
server.commandManager.buildCommand('achievements')
.parameters([{ name: 'player', type: CommandBuilder.PLAYER_PARAMETER, optional: true }])
.build(CollectableCommands.prototype.onAchievementsCommand.bind(this));

// /collectables
server.commandManager.buildCommand('collectables')
.build(CollectableCommands.prototype.onCollectablesCommand.bind(this));
Expand Down Expand Up @@ -114,7 +114,9 @@ export class CollectableCommands {

for (const [ label, { delegate, instructions } ] of series) {
const total = delegate.getCollectableCount();
const collected = delegate.countCollectablesForPlayer(player).round;
const statistics = delegate.getPlayerStatistics(player);

const collected = statistics.collectedRound.size;

let progress = '';
if (!collected)
Expand All @@ -124,7 +126,8 @@ export class CollectableCommands {
else
progress = `${collected} / ${total}`;

// TODO: Display the |player|'s collection round if it's >1
if (statistics.round > 1)
progress += ` {80ff00}(round ${statistics.round})`;

let listener = null;
if (label.includes('Achievements')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('CollectableCommands', (it, beforeEach) => {
],
[
'{B2FF59}Spray Tags',
'2 / 100',
'2 / 100 {80ff00}(round 2)',
],
]
});
Expand Down

0 comments on commit 1be483b

Please sign in to comment.