Skip to content

Commit

Permalink
Get mapWinInfo from client, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkView committed Jan 10, 2025
1 parent 9242665 commit 8cf786b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 38 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spectra-frontend",
"version": "0.2.8",
"version": "0.2.9",
"scripts": {
"ng": "ng",
"start": "ng serve --configuration development",
Expand Down
18 changes: 12 additions & 6 deletions src/app/topscore/topscore.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
<div class="score-text">{{ match.teams[0].roundsWon }}</div>
</div>
</div>
<div class="mapwin-line-left" *ngIf="mapsNeeded > 1">
<div class="mapwin-pip-full" *ngFor="let i of numSequence(mapsWonLeft)"></div>
<div class="mapwin-pip" *ngFor="let i of numSequence(mapsNeeded - mapsWonLeft)"></div>
<div class="mapwin-line-left" *ngIf="match.mapsNeeded > 1">
<div class="mapwin-pip-full" *ngFor="let i of numSequence(match.mapsWonLeft)"></div>
<div
class="mapwin-pip"
*ngFor="let i of numSequence(match.mapsNeeded - match.mapsWonLeft)"
></div>
</div>
</div>

Expand All @@ -35,9 +38,12 @@
<img class="team-image" src="{{ match.teams[1].teamUrl }}" />
</div>
</div>
<div class="mapwin-line-right" *ngIf="mapsNeeded > 1">
<div class="mapwin-pip-full" *ngFor="let i of numSequence(mapsWonRight)"></div>
<div class="mapwin-pip" *ngFor="let i of numSequence(mapsNeeded - mapsWonRight)"></div>
<div class="mapwin-line-right" *ngIf="match.mapsNeeded > 1">
<div class="mapwin-pip-full" *ngFor="let i of numSequence(match.mapsWonRight)"></div>
<div
class="mapwin-pip"
*ngFor="let i of numSequence(match.mapsNeeded - match.mapsWonRight)"
></div>
</div>
</div>
</div>
Expand Down
26 changes: 2 additions & 24 deletions src/app/topscore/topscore.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { animate, style, transition, trigger } from "@angular/animations";
import { Component, Input, SimpleChanges, OnChanges, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { Component, Input, SimpleChanges, OnChanges } from "@angular/core";

@Component({
selector: "app-topscore",
Expand All @@ -14,7 +13,7 @@ import { ActivatedRoute } from "@angular/router";
]),
],
})
export class TopscoreComponent implements OnInit, OnChanges {
export class TopscoreComponent implements OnChanges {
@Input() match!: any;

spikePlanted = false;
Expand All @@ -24,32 +23,11 @@ export class TopscoreComponent implements OnInit, OnChanges {
lastActedTime = 9999;
blinkInterval: any = undefined;

mapsNeeded = 1;
mapsWonLeft = 0;
mapsWonRight = 0;

constructor(private route: ActivatedRoute) {}

ngOnInit(): void {
this.route.queryParams.subscribe((params) => {
if (params["mapsNeeded"]) {
this.mapsNeeded = parseInt(params["mapsNeeded"]);
}
if (params["mapsWonLeft"]) {
this.mapsWonLeft = parseInt(params["mapsWonLeft"]);
}
if (params["mapsWonRight"]) {
this.mapsWonRight = parseInt(params["mapsWonRight"]);
}
});
}

ngOnChanges(changes: SimpleChanges) {
if (changes["match"]) {
const match = changes["match"].currentValue;
if (match["spikeState"]["planted"] != this.spikePlanted) {
this.spikePlanted = match["spikeState"]["planted"];

if (this.spikePlanted) {
this.detonationTime = match["spikeDetonationTime"];
this.blinkState = false;
Expand Down
7 changes: 0 additions & 7 deletions src/app/tracker/tracker.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { Component, OnInit } from "@angular/core";
import { trigger, transition, style, animate } from "@angular/animations";

// enum Colors {
// ATTACKER_REG = 'rgba(232, 130, 125, 0.75)',
// ATTACKER_FEINT = 'rgba(232, 130, 125, 0.35)',
// DEFENDER_REG = 'rgba(125, 232, 187, 0.75)',
// DEFENDER_FEINT = 'rgba(125, 232, 187, 0.35)',
// }

@Component({
selector: "app-tracker",
templateUrl: "./tracker.component.html",
Expand Down

0 comments on commit 8cf786b

Please sign in to comment.