diff --git a/package.json b/package.json index 5a3f7ea..9ef57d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spectra-frontend", - "version": "0.2.10", + "version": "0.2.11", "scripts": { "ng": "ng", "start": "ng serve --configuration development", @@ -45,5 +45,5 @@ "typescript": "~5.5.4", "typescript-eslint": "8.18.0" }, - "packageManager": "yarn@4.5.1" + "packageManager": "yarn@4.6.0" } diff --git a/public/assets/agent-portraits/AggrobotPortrait.webp b/public/assets/agent-portraits/AggrobotPortrait.webp new file mode 100644 index 0000000..349710c Binary files /dev/null and b/public/assets/agent-portraits/AggrobotPortrait.webp differ diff --git a/public/assets/agent-portraits/BountyHunterPortrait.webp b/public/assets/agent-portraits/BountyHunterPortrait.webp new file mode 100644 index 0000000..70eeedc Binary files /dev/null and b/public/assets/agent-portraits/BountyHunterPortrait.webp differ diff --git a/public/assets/agent-portraits/BreachPortrait.webp b/public/assets/agent-portraits/BreachPortrait.webp new file mode 100644 index 0000000..d14be8e Binary files /dev/null and b/public/assets/agent-portraits/BreachPortrait.webp differ diff --git a/public/assets/agent-portraits/CablePortrait.webp b/public/assets/agent-portraits/CablePortrait.webp new file mode 100644 index 0000000..3712a4d Binary files /dev/null and b/public/assets/agent-portraits/CablePortrait.webp differ diff --git a/public/assets/agent-portraits/CashewPortrait.webp b/public/assets/agent-portraits/CashewPortrait.webp new file mode 100644 index 0000000..75000b1 Binary files /dev/null and b/public/assets/agent-portraits/CashewPortrait.webp differ diff --git a/public/assets/agent-portraits/ClayPortrait.webp b/public/assets/agent-portraits/ClayPortrait.webp new file mode 100644 index 0000000..ebcf8e9 Binary files /dev/null and b/public/assets/agent-portraits/ClayPortrait.webp differ diff --git a/public/assets/agent-portraits/DeadeyePortrait.webp b/public/assets/agent-portraits/DeadeyePortrait.webp new file mode 100644 index 0000000..940eaa0 Binary files /dev/null and b/public/assets/agent-portraits/DeadeyePortrait.webp differ diff --git a/public/assets/agent-portraits/GrenadierPortrait.webp b/public/assets/agent-portraits/GrenadierPortrait.webp new file mode 100644 index 0000000..ab39346 Binary files /dev/null and b/public/assets/agent-portraits/GrenadierPortrait.webp differ diff --git a/public/assets/agent-portraits/GuidePortrait.webp b/public/assets/agent-portraits/GuidePortrait.webp new file mode 100644 index 0000000..b1d4699 Binary files /dev/null and b/public/assets/agent-portraits/GuidePortrait.webp differ diff --git a/public/assets/agent-portraits/GumshoePortrait.webp b/public/assets/agent-portraits/GumshoePortrait.webp new file mode 100644 index 0000000..be102c9 Binary files /dev/null and b/public/assets/agent-portraits/GumshoePortrait.webp differ diff --git a/public/assets/agent-portraits/HunterPortrait.webp b/public/assets/agent-portraits/HunterPortrait.webp new file mode 100644 index 0000000..4f1e348 Binary files /dev/null and b/public/assets/agent-portraits/HunterPortrait.webp differ diff --git a/public/assets/agent-portraits/KilljoyPortrait.webp b/public/assets/agent-portraits/KilljoyPortrait.webp new file mode 100644 index 0000000..a668638 Binary files /dev/null and b/public/assets/agent-portraits/KilljoyPortrait.webp differ diff --git a/public/assets/agent-portraits/MagePortrait.webp b/public/assets/agent-portraits/MagePortrait.webp new file mode 100644 index 0000000..34271d1 Binary files /dev/null and b/public/assets/agent-portraits/MagePortrait.webp differ diff --git a/public/assets/agent-portraits/NoxPortrait.webp b/public/assets/agent-portraits/NoxPortrait.webp new file mode 100644 index 0000000..cc7cb09 Binary files /dev/null and b/public/assets/agent-portraits/NoxPortrait.webp differ diff --git a/public/assets/agent-portraits/PandemicPortrait.webp b/public/assets/agent-portraits/PandemicPortrait.webp new file mode 100644 index 0000000..dcf283d Binary files /dev/null and b/public/assets/agent-portraits/PandemicPortrait.webp differ diff --git a/public/assets/agent-portraits/PhoenixPortrait.webp b/public/assets/agent-portraits/PhoenixPortrait.webp new file mode 100644 index 0000000..258c2ee Binary files /dev/null and b/public/assets/agent-portraits/PhoenixPortrait.webp differ diff --git a/public/assets/agent-portraits/Portrait.webp b/public/assets/agent-portraits/Portrait.webp new file mode 100644 index 0000000..bd1ab82 Binary files /dev/null and b/public/assets/agent-portraits/Portrait.webp differ diff --git a/public/assets/agent-portraits/RiftPortrait.webp b/public/assets/agent-portraits/RiftPortrait.webp new file mode 100644 index 0000000..da2690a Binary files /dev/null and b/public/assets/agent-portraits/RiftPortrait.webp differ diff --git a/public/assets/agent-portraits/SargePortrait.webp b/public/assets/agent-portraits/SargePortrait.webp new file mode 100644 index 0000000..82e8d89 Binary files /dev/null and b/public/assets/agent-portraits/SargePortrait.webp differ diff --git a/public/assets/agent-portraits/SequoiaPortrait.webp b/public/assets/agent-portraits/SequoiaPortrait.webp new file mode 100644 index 0000000..36cc8c2 Binary files /dev/null and b/public/assets/agent-portraits/SequoiaPortrait.webp differ diff --git a/public/assets/agent-portraits/SmonkPortrait.webp b/public/assets/agent-portraits/SmonkPortrait.webp new file mode 100644 index 0000000..35bb74f Binary files /dev/null and b/public/assets/agent-portraits/SmonkPortrait.webp differ diff --git a/public/assets/agent-portraits/SprinterPortrait.webp b/public/assets/agent-portraits/SprinterPortrait.webp new file mode 100644 index 0000000..37fe977 Binary files /dev/null and b/public/assets/agent-portraits/SprinterPortrait.webp differ diff --git a/public/assets/agent-portraits/StealthPortrait.webp b/public/assets/agent-portraits/StealthPortrait.webp new file mode 100644 index 0000000..0733755 Binary files /dev/null and b/public/assets/agent-portraits/StealthPortrait.webp differ diff --git a/public/assets/agent-portraits/ThornePortrait.webp b/public/assets/agent-portraits/ThornePortrait.webp new file mode 100644 index 0000000..7fcd02e Binary files /dev/null and b/public/assets/agent-portraits/ThornePortrait.webp differ diff --git a/public/assets/agent-portraits/VampirePortrait.webp b/public/assets/agent-portraits/VampirePortrait.webp new file mode 100644 index 0000000..9ebc560 Binary files /dev/null and b/public/assets/agent-portraits/VampirePortrait.webp differ diff --git a/public/assets/agent-portraits/WraithPortrait.webp b/public/assets/agent-portraits/WraithPortrait.webp new file mode 100644 index 0000000..9a2bb82 Binary files /dev/null and b/public/assets/agent-portraits/WraithPortrait.webp differ diff --git a/public/assets/agent-portraits/WushuPortrait.webp b/public/assets/agent-portraits/WushuPortrait.webp new file mode 100644 index 0000000..712afd6 Binary files /dev/null and b/public/assets/agent-portraits/WushuPortrait.webp differ diff --git a/public/assets/roles/Controller.webp b/public/assets/roles/Controller.webp new file mode 100644 index 0000000..db7f1f0 Binary files /dev/null and b/public/assets/roles/Controller.webp differ diff --git a/public/assets/roles/Duelist.webp b/public/assets/roles/Duelist.webp new file mode 100644 index 0000000..75c0352 Binary files /dev/null and b/public/assets/roles/Duelist.webp differ diff --git a/public/assets/roles/Initiator.webp b/public/assets/roles/Initiator.webp new file mode 100644 index 0000000..cacc3d6 Binary files /dev/null and b/public/assets/roles/Initiator.webp differ diff --git a/public/assets/roles/Sentinel.webp b/public/assets/roles/Sentinel.webp new file mode 100644 index 0000000..dcab70e Binary files /dev/null and b/public/assets/roles/Sentinel.webp differ diff --git a/src/app/agent-select/agent-select.component.html b/src/app/agent-select/agent-select.component.html new file mode 100644 index 0000000..ee631a5 --- /dev/null +++ b/src/app/agent-select/agent-select.component.html @@ -0,0 +1,34 @@ +
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
diff --git a/src/app/agent-select/agent-select.component.scss b/src/app/agent-select/agent-select.component.scss new file mode 100644 index 0000000..35773ff --- /dev/null +++ b/src/app/agent-select/agent-select.component.scss @@ -0,0 +1,79 @@ +.body { + position: absolute; + width: 98%; + height: 40%; + bottom: 1%; + left: 1%; + background-color: #0f1923cc; + border-radius: 25px; + overflow: hidden; +} + +.left-team { + position: absolute; + left: 0; + width: 45%; + height: 100%; +} + +.right-team { + position: absolute; + right: 0; + width: 45%; + height: 100%; +} + +.team-info { + position: absolute; + left: 45%; + width: 10%; + height: 100%; + background: linear-gradient( + 180deg, + rgba(15, 25, 35, 0.65) 0%, + rgba(15, 25, 35, 0.53) 53%, + rgba(15, 25, 35, 0) 75%, + rgba(15, 25, 35, 0) 100% + ); +} + +.defender-team { + position: absolute; + width: 100%; + height: 50%; + top: 0; + background: linear-gradient( + 180deg, + rgba(var(--defender-color-rgb), 0.9) 0%, + rgba(var(--defender-color-secondary-rgb), 0) 90% + ); +} + +.attacker-team { + position: absolute; + width: 100%; + height: 50%; + bottom: 0; + background: linear-gradient( + 0deg, + rgba(var(--attacker-color-rgb), 0.9) 0%, + rgba(var(--attacker-color-secondary-rgb), 0) 90% + ); +} + +.team-wrapper { + display: flex; + flex-direction: row; + &-left { + @extend .team-wrapper; + } + + &-right { + @extend .team-wrapper; + } +} + +app-select-player-info { + width: 20%; + height: 100%; +} diff --git a/src/app/agent-select/agent-select.component.ts b/src/app/agent-select/agent-select.component.ts new file mode 100644 index 0000000..5e297be --- /dev/null +++ b/src/app/agent-select/agent-select.component.ts @@ -0,0 +1,100 @@ +import { AfterViewInit, Component, OnInit, ViewChild } from "@angular/core"; +import { TrackerComponent } from "../tracker/tracker.component"; +import { ActivatedRoute } from "@angular/router"; +import { SocketService } from "../services/SocketService"; +import { Config } from "../shared/config"; +import { trigger, transition, style, animate } from "@angular/animations"; +import { AutoswitchComponent } from "../autoswitch/autoswitch.component"; + +@Component({ + selector: "app-agent-select", + templateUrl: "./agent-select.component.html", + styleUrls: ["./agent-select.component.scss"], + animations: [ + trigger("fade", [ + transition(":enter", [style({ opacity: "0" }), animate("0.5s", style({ opacity: "1" }))]), + + transition(":leave", animate("0.5s", style({ opacity: "0" }))), + ]), + ], +}) +export class AgentSelectComponent implements OnInit, AfterViewInit { + @ViewChild(TrackerComponent) trackerComponent!: TrackerComponent; + groupCode = "UNKNOWN"; + socketService!: SocketService; + + match: any; + teamLeft: any; + teamRight: any; + + constructor( + private route: ActivatedRoute, + private config: Config, + ) { + this.route.queryParams.subscribe((params) => { + this.groupCode = params["groupCode"]?.toUpperCase() || "UNKNOWN"; + console.log(`Requested group code is ${this.groupCode}`); + }); + } + + ngOnInit(): void { + this.match = { + groupCode: "A", + isRanked: false, + isRunning: true, + roundNumber: 0, + roundPhase: "combat", + teams: [{ players: [] }, { players: [] }], + spikeState: { planted: false }, + map: "Ascent", + tools: { + seriesInfo: { + needed: 1, + wonLeft: 0, + wonRight: 0, + mapInfo: [], + }, + }, + }; + + this.teamLeft = this.match.teams[0]; + this.teamRight = this.match.teams[1]; + + this.socketService = SocketService.getInstance(this.config.serverEndpoint, this.groupCode); + } + + ngAfterViewInit(): void { + this.socketService.subscribe((data: any) => { + this.updateMatch(data); + }); + } + + isAutoswitch(): boolean { + return this.route.component === AutoswitchComponent; + } + + shouldDisplay(): boolean { + if (this.isAutoswitch()) { + if (this.match.roundPhase === "LOBBY") { + return true; + } else { + return false; + } + } else { + return true; + } + } + + public updateMatch(data: any) { + delete data.eventNumber; + delete data.replayLog; + this.match = data; + + this.teamLeft = this.match.teams[0]; + this.teamRight = this.match.teams[1]; + } + + trackByPlayerId(index: number, player: any) { + return player.playerId; + } +} diff --git a/src/app/agent-select/select-player-info/select-player-info.component.html b/src/app/agent-select/select-player-info/select-player-info.component.html new file mode 100644 index 0000000..6e5afc6 --- /dev/null +++ b/src/app/agent-select/select-player-info/select-player-info.component.html @@ -0,0 +1,24 @@ +
+
+ +
+ +
+
+ {{ player.name }} +
+
+
+
diff --git a/src/app/agent-select/select-player-info/select-player-info.component.scss b/src/app/agent-select/select-player-info/select-player-info.component.scss new file mode 100644 index 0000000..662fc32 --- /dev/null +++ b/src/app/agent-select/select-player-info/select-player-info.component.scss @@ -0,0 +1,76 @@ +@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap"); +@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@200..900&display=swap"); + +.container { + height: 100%; + width: 100%; + overflow: hidden; +} + +.player-gradient { + position: absolute; + width: 20%; + height: 100%; + top: 0; + z-index: -200; + + &.attacker { + @extend .player-gradient; + background: linear-gradient( + 0deg, + rgba(var(--attacker-color-rgb), 1) 0%, + rgba(var(--attacker-color-rgb), 0.4) 75%, + rgba(var(--attacker-color-secondary-rgb), 0) 100% + ); + } + &.defender { + @extend .player-gradient; + background: linear-gradient( + 180deg, + rgba(var(--defender-color-rgb), 1) 0%, + rgba(var(--defender-color-rgb), 0.4) 75%, + rgba(var(--defender-color-secondary-rgb), 0) 100% + ); + } +} + +.agent-image { + display: block; + margin-top: -35%; + margin-left: -150%; + max-width: 400%; + z-index: 200; + filter: grayscale(1); + + &.locked { + filter: grayscale(0); + } +} + +.player-name { + position: absolute; + width: 20%; + bottom: 15%; + text-align: center; + font-size: 1.25rem; + font-weight: 800; + color: white; + font-family: "Montserrat", Helvetica; + text-shadow: 2px 2px 5px black; + line-break: auto; + overflow: hidden; + line-height: 90%; +} + +.player-role { + position: absolute; + width: 20%; + bottom: 3%; + z-index: 100; +} + +.role-image { + display: block; + margin: auto; + max-width: 25%; +} diff --git a/src/app/agent-select/select-player-info/select-player-info.component.ts b/src/app/agent-select/select-player-info/select-player-info.component.ts new file mode 100644 index 0000000..3d46349 --- /dev/null +++ b/src/app/agent-select/select-player-info/select-player-info.component.ts @@ -0,0 +1,28 @@ +import { Component, Input } from "@angular/core"; +import { AgentRoleService } from "../../services/agentRole.service"; +import { trigger, transition, style, animate } from "@angular/animations"; + +@Component({ + selector: "app-select-player-info", + templateUrl: "./select-player-info.component.html", + styleUrl: "./select-player-info.component.scss", + animations: [ + trigger("lockAnimation", [ + transition("false => true, void => true", [ + style({ filter: "grayscale(1) brightness(200%)" }), + animate("350ms", style({ filter: "grayscale(0) brightness(100%)" })), + ]), + ]), + trigger("characterSwitch", [ + transition("* <=> *", [style({ opacity: "0" }), animate("100ms", style({ opacity: "1" }))]), + ]), + ], +}) +export class SelectPlayerInfoComponent { + @Input() player: any; + @Input() color: "attacker" | "defender" = "attacker"; + + getAgentRole(agent: string) { + return AgentRoleService.getAgentRole(agent); + } +} diff --git a/src/app/agent-select/select-team-info/select-team-info.component.html b/src/app/agent-select/select-team-info/select-team-info.component.html new file mode 100644 index 0000000..543feff --- /dev/null +++ b/src/app/agent-select/select-team-info/select-team-info.component.html @@ -0,0 +1,9 @@ +
+
+
{{ team.teamTricode }}
+ +
{{ team.teamTricode }}
+
+
diff --git a/src/app/agent-select/select-team-info/select-team-info.component.scss b/src/app/agent-select/select-team-info/select-team-info.component.scss new file mode 100644 index 0000000..6b027e6 --- /dev/null +++ b/src/app/agent-select/select-team-info/select-team-info.component.scss @@ -0,0 +1,46 @@ +@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap"); +@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@200..900&display=swap"); + +.container { + height: 100%; + width: 100%; +} + +.team-tricode { + width: 100%; + height: 20%; + font-size: 2em; + font-weight: 800; + color: white; + font-family: "Unbounded", Helvetica; + text-align: center; +} + +.team-logo { + width: 100%; + height: 80%; + display: flex; + justify-content: center; + align-items: center; +} + +.logo { + max-width: 90%; + max-height: 90%; + display: block; + padding: 5% 5%; +} + +.defender-gradient { + position: absolute; + width: 100%; + height: 100%; + top: 0; +} + +.attacker-gradient { + position: absolute; + bottom: 0; + width: 100%; + height: 100%; +} diff --git a/src/app/agent-select/select-team-info/select-team-info.component.ts b/src/app/agent-select/select-team-info/select-team-info.component.ts new file mode 100644 index 0000000..9b02063 --- /dev/null +++ b/src/app/agent-select/select-team-info/select-team-info.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from "@angular/core"; + +@Component({ + selector: "app-select-team-info", + templateUrl: "./select-team-info.component.html", + styleUrl: "./select-team-info.component.scss", +}) +export class SelectTeamInfoComponent { + @Input() team: any; + @Input() isAttack = false; +} diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index c4e5a2e..8f63a7f 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -2,6 +2,8 @@ import { NgModule } from "@angular/core"; import { RouterModule, Routes } from "@angular/router"; import { TestingComponent } from "./testing/testing.component"; import { OverlayComponent } from "./overlay/overlay.component"; +import { AgentSelectComponent } from "./agent-select/agent-select.component"; +import { AutoswitchComponent } from "./autoswitch/autoswitch.component"; const routes: Routes = [ { @@ -12,6 +14,14 @@ const routes: Routes = [ path: "testing", component: TestingComponent, }, + { + path: "agent-select", + component: AgentSelectComponent, + }, + { + path: "autoswitch", + component: AutoswitchComponent, + }, ]; @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index cff59d3..08a5ba5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -20,6 +20,11 @@ import { PlayerControllerComponent } from "./testing/player-controller/player-co import { TeamControllerComponent } from "./testing/team-controller/team-controller.component"; import { ShieldIconComponent } from "./combat/playercard/shield-icon/shield-icon.component"; import { MapinfoComponent } from "./topscore/topinfo/mapinfo/mapinfo.component"; +import { JsonPipe } from "@angular/common"; +import { AgentSelectComponent } from "./agent-select/agent-select.component"; +import { SelectTeamInfoComponent } from "./agent-select/select-team-info/select-team-info.component"; +import { SelectPlayerInfoComponent } from "./agent-select/select-player-info/select-player-info.component"; +import { AutoswitchComponent } from "./autoswitch/autoswitch.component"; @NgModule({ declarations: [ @@ -38,10 +43,14 @@ import { MapinfoComponent } from "./topscore/topinfo/mapinfo/mapinfo.component"; TeamControllerComponent, ShieldIconComponent, MapinfoComponent, + AgentSelectComponent, + SelectTeamInfoComponent, + SelectPlayerInfoComponent, + AutoswitchComponent, ], exports: [], bootstrap: [AppComponent], - imports: [BrowserModule, AppRoutingModule, FormsModule, BrowserAnimationsModule], + imports: [BrowserModule, AppRoutingModule, FormsModule, BrowserAnimationsModule, JsonPipe], providers: [provideHttpClient(withInterceptorsFromDi())], }) export class AppModule {} diff --git a/src/app/autoswitch/autoswitch.component.html b/src/app/autoswitch/autoswitch.component.html new file mode 100644 index 0000000..050f215 --- /dev/null +++ b/src/app/autoswitch/autoswitch.component.html @@ -0,0 +1,4 @@ +
+ + +
diff --git a/src/app/autoswitch/autoswitch.component.scss b/src/app/autoswitch/autoswitch.component.scss new file mode 100644 index 0000000..5d4e87f --- /dev/null +++ b/src/app/autoswitch/autoswitch.component.scss @@ -0,0 +1,3 @@ +:host { + display: block; +} diff --git a/src/app/autoswitch/autoswitch.component.ts b/src/app/autoswitch/autoswitch.component.ts new file mode 100644 index 0000000..84a1694 --- /dev/null +++ b/src/app/autoswitch/autoswitch.component.ts @@ -0,0 +1,8 @@ +import { Component } from "@angular/core"; + +@Component({ + selector: "app-autoswitch", + templateUrl: "./autoswitch.component.html", + styleUrl: "./autoswitch.component.scss", +}) +export class AutoswitchComponent {} diff --git a/src/app/overlay/overlay.component.ts b/src/app/overlay/overlay.component.ts index 0150f34..972bf50 100644 --- a/src/app/overlay/overlay.component.ts +++ b/src/app/overlay/overlay.component.ts @@ -25,7 +25,7 @@ export class OverlayComponent implements OnInit, AfterViewInit { } ngOnInit(): void { - this.socketService = new SocketService(this.config.serverEndpoint, this.groupCode); + this.socketService = SocketService.getInstance(this.config.serverEndpoint, this.groupCode); } ngAfterViewInit(): void { diff --git a/src/app/services/SocketService.ts b/src/app/services/SocketService.ts index dab058e..74c33df 100644 --- a/src/app/services/SocketService.ts +++ b/src/app/services/SocketService.ts @@ -7,6 +7,14 @@ export class SocketService { groupCode = "UNKNOWN"; subscribers: Function[] = []; + private static instance: SocketService; + + public static getInstance(socketEndpoint: string, groupCode: string): SocketService { + if (SocketService.instance == null) + SocketService.instance = new SocketService(socketEndpoint, groupCode); + return SocketService.instance; + } + constructor(socketEndpoint: string, groupCode: string) { this.groupCode = groupCode; this.socketEndpoint = socketEndpoint; diff --git a/src/app/services/agentRole.service.ts b/src/app/services/agentRole.service.ts new file mode 100644 index 0000000..c1ce6af --- /dev/null +++ b/src/app/services/agentRole.service.ts @@ -0,0 +1,40 @@ +/* eslint-disable @typescript-eslint/no-duplicate-enum-values */ +import { Injectable } from "@angular/core"; + +@Injectable({ + providedIn: "root", +}) +export class AgentRoleService { + static getAgentRole(agent: string) { + return AgentRole[agent as keyof typeof AgentRole]; + } +} + +enum AgentRole { + "Aggrobot" = "Initiator", + "BountyHunter" = "Initiator", + "Breach" = "Initiator", + "Cable" = "Sentinel", + "Cashew" = "Initiator", + "Clay" = "Duelist", + "Deadeye" = "Sentinel", + "Grenadier" = "Initiator", + "Guide" = "Initiator", + "Gumshoe" = "Sentinel", + "Hunter" = "Initiator", + "Killjoy" = "Sentinel", + "Mage" = "Controller", + "Nox" = "Sentinel", + "Pandemic" = "Controller", + "Phoenix" = "Duelist", + "Rift" = "Controller", + "Sarge" = "Controller", + "Sequoia" = "Duelist", + "Smonk" = "Controller", + "Sprinter" = "Duelist", + "Stealth" = "Duelist", + "Thorne" = "Sentinel", + "Vampire" = "Duelist", + "Wraith" = "Controller", + "Wushu" = "Duelist", +} diff --git a/src/app/tracker/tracker.component.html b/src/app/tracker/tracker.component.html index 998369c..f1efa29 100644 --- a/src/app/tracker/tracker.component.html +++ b/src/app/tracker/tracker.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/app/tracker/tracker.component.ts b/src/app/tracker/tracker.component.ts index fd96ea6..bab1382 100644 --- a/src/app/tracker/tracker.component.ts +++ b/src/app/tracker/tracker.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit } from "@angular/core"; import { trigger, transition, style, animate } from "@angular/animations"; +import { ActivatedRoute } from "@angular/router"; +import { AutoswitchComponent } from "../autoswitch/autoswitch.component"; @Component({ selector: "app-tracker", @@ -23,6 +25,8 @@ export class TrackerComponent implements OnInit { ranksEnabled = false; ranksByName: any = {}; + constructor(private route: ActivatedRoute) {} + async ngOnInit(): Promise { //setting up with empty match state so certain ui parts dont complain this.match = { @@ -30,7 +34,7 @@ export class TrackerComponent implements OnInit { isRanked: false, isRunning: true, roundNumber: 0, - roundPhase: "combat", + roundPhase: "LOBBY", teams: [{ players: [] }, { players: [] }], spikeState: { planted: false }, map: "Ascent", @@ -49,6 +53,24 @@ export class TrackerComponent implements OnInit { } } + isAutoswitch(): boolean { + return this.route.component === AutoswitchComponent; + } + + autoDisplayPhases = ["shopping", "combat", "end", "game_start", "game_end"]; + + shouldDisplay(): boolean { + if (this.isAutoswitch()) { + if (this.autoDisplayPhases.includes(this.match.roundPhase)) { + return true; + } else { + return false; + } + } else { + return true; + } + } + public updateMatch(data: any) { delete data.eventNumber; delete data.replayLog;