Skip to content

Commit

Permalink
v3.18.2 (#182)
Browse files Browse the repository at this point in the history
* Fixed a bug that made it impossible to add manual team bonuses if the team hadn't finished any challenges.

* Clarify advanced score tooltip on new scoreboard.

* Add hub connection info to overview
  • Loading branch information
sei-bstein committed Apr 9, 2024
1 parent ed83bf0 commit 894d1d7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ <h4>Live Stats</h4>

<h4>Send Announcement to All Players</h4>
<app-announce></app-announce>

<h4 class="mt-4">Your connections</h4>
<ul>
<li>Game Hub: {{ gameHubState$ | async }}</li>
<li>Support Hub: {{ supportHubState$ | async }} </li>
</ul>
</div>
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import { GameHubService } from '@/services/signalR/game-hub.service';
import { SupportHubService } from '@/services/signalR/support-hub.service';
import { Component } from '@angular/core';
import { HubConnectionState } from '@microsoft/signalr';
import { Observable } from 'rxjs';

@Component({
selector: 'app-admin-overview',
templateUrl: './admin-overview.component.html',
styleUrls: ['./admin-overview.component.scss']
})
export class AdminOverviewComponent {
protected gameHubState$: Observable<HubConnectionState>;
protected supportHubState$: Observable<HubConnectionState>;

constructor(
private gameHubService: GameHubService,
supportHub: SupportHubService) {
this.gameHubState$ = gameHubService.hubState$;
this.supportHubState$ = supportHub.hubState$;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ export class ScoreToTooltipPipe implements PipeTransform {
if (!value || value.scoreOverall === 0 || value.scoreOverall === value.scoreChallenge)
return "";

return `${value.scoreChallenge} + ${(value.scoreAdvanced || 0) + value.scoreAutoBonus + value.scoreManualBonus} bonus (click for details)`;
let previousGameClause = "";
if (value.scoreAdvanced || 0) {
previousGameClause = ` + ${value.scoreAdvanced || 0} previous`;
}

let bonusClause = "";
const bonusPoints = (value.scoreAutoBonus || 0) || (value.scoreManualBonus || 0);
if (bonusPoints)
bonusClause = ` + ${bonusPoints} bonus `;

return `${value.scoreChallenge}${previousGameClause}${bonusClause} (click for details)`;
}
}

0 comments on commit 894d1d7

Please sign in to comment.