diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 90ef574c..989248d3 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -114,7 +114,7 @@ const routes: Routes = [ path: "toast", loadComponent: () => import("./overlays/toast-overlay/toast-component").then((m) => m.LiveToastComponent), - } + }, ]; @NgModule({ diff --git a/src/app/components/breakdown/mvp-player/mvp-player.html b/src/app/components/breakdown/mvp-player/mvp-player.html index 83711779..a959e3d4 100644 --- a/src/app/components/breakdown/mvp-player/mvp-player.html +++ b/src/app/components/breakdown/mvp-player/mvp-player.html @@ -1,38 +1,52 @@ -
+
-
+
{{TranslateKeys.Breakdown_MVP | translate}}
-
- {{player.agent.name}} - {{player.name}} + {{player.agent.name}} + {{player.name}}
-
- +
+
- {{player.stats.kills}}/{{player.stats.deaths}}/{{player.stats.assists}} - {{player.stats.kills}}/{{player.stats.deaths}}/{{player.stats.assists}} + {{player.stats.acs}} - {{player.stats.acs}} + {{player.stats.firstKills}} + >{{player.stats.firstKills}}
diff --git a/src/app/components/breakdown/regular-player/regular-player.html b/src/app/components/breakdown/regular-player/regular-player.html index 5bbd8c18..253db2ec 100644 --- a/src/app/components/breakdown/regular-player/regular-player.html +++ b/src/app/components/breakdown/regular-player/regular-player.html @@ -2,13 +2,19 @@
- {{player.agent.name}} - {{player.name}} + {{player.agent.name}} + {{player.name}}
@@ -17,12 +23,11 @@ [class]="isRight ? 'text-left items-start' : 'text-right items-end'" [style.direction]="'ltr'" > - {{player.stats.kills}}/{{player.stats.deaths}}/{{player.stats.assists}} - {{player.stats.acs}} + > + {{player.stats.acs}}
diff --git a/src/app/components/combat/endround-banner/endround-banner.component.html b/src/app/components/combat/endround-banner/endround-banner.component.html index 2fe5fd26..044330cd 100644 --- a/src/app/components/combat/endround-banner/endround-banner.component.html +++ b/src/app/components/combat/endround-banner/endround-banner.component.html @@ -1,4 +1,4 @@ -@if (dataModel.tournamentInfo().enabled) { +@if (dataModel.roundWinBox().type !== "disabled") {
- @if (tournamentBackgroundUrl()) { - + @if (bannerBackgroundUrl()) { + } @else {
} @@ -221,7 +221,7 @@
diff --git a/src/app/components/combat/endround-banner/endround-banner.component.ts b/src/app/components/combat/endround-banner/endround-banner.component.ts index 9b0ef060..a39c9439 100644 --- a/src/app/components/combat/endround-banner/endround-banner.component.ts +++ b/src/app/components/combat/endround-banner/endround-banner.component.ts @@ -1,7 +1,8 @@ -import { Component, computed, effect, inject, signal, WritableSignal } from "@angular/core"; +import { Component, computed, effect, inject, Signal, signal, WritableSignal } from "@angular/core"; import { TranslatePipe } from "@ngx-translate/core"; import { TranslateKeys } from "../../../services/i18nHelper"; import { DataModelService } from "../../../services/dataModel.service"; +import { IRoundWinBox, IRoundWinBoxSponsors } from "../../../services/Types"; @Component({ selector: "app-endround-new", @@ -29,6 +30,9 @@ export class EndroundBannerComponent { clutch: number[] = [-1, -1]; + roundWinBox: Signal = computed(() => this.dataModel.roundWinBox()); + roundWonSponsor: Signal = computed(() => this.calculateSponsor()); + private calculateClutch(): void { const teamOne = this.dataModel.match().teams[0]; const teamTwo = this.dataModel.match().teams[1]; @@ -62,12 +66,15 @@ export class EndroundBannerComponent { }); for (const player of wonTeam.players) { - const killsFromLostTeam = player.killedPlayerNames.filter((playerName) => - lostTeamPlayerNames.has(playerName), - ); - if (new Set(killsFromLostTeam).size >= 5) { - ace = true; - break; + if (player.killedPlayerNames) { + const killsFromLostTeam = player.killedPlayerNames.filter((playerName) => + lostTeamPlayerNames.has(playerName), + ); + + if (new Set(killsFromLostTeam).size >= 5) { + ace = true; + break; + } } if (player.deathsThisRound >= 1) flawless = false; if (!(player.killsThisRound >= 1)) teamAce = false; @@ -81,15 +88,70 @@ export class EndroundBannerComponent { else return TranslateKeys.Endround_RoundWin; } - tournamentBackgroundUrl = computed(() => { - const backdrop = this.dataModel.tournamentInfo().backdropUrl; - if (backdrop && backdrop !== "") return backdrop; - else return "assets/misc/backdrop.png"; + private calculateSponsor(): IRoundWinBoxSponsors { + const teamwon = this.teamWon(); + const roundWonType = this.roundWonType(); + + const initialSponsor: IRoundWinBoxSponsors = { + wonTeam: "all", + roundCeremonie: ["all"], + iconUrl: "", + backdropUrl: "", + }; + + if (this.roundWinBox().sponsors.length == 0) return initialSponsor; + + const sponsor: IRoundWinBoxSponsors = this.roundWinBox().sponsors[0]; + + for (const spons of this.roundWinBox().sponsors) { + if ( + spons.wonTeam == "all" || + (spons.wonTeam == "left" && teamwon == 0) || + (spons.wonTeam == "right" && teamwon == 1) + ) { + if ( + spons.roundCeremonie.includes("all") || + (spons.roundCeremonie.includes("normal") && + roundWonType == TranslateKeys.Endround_RoundWin) || + (spons.roundCeremonie.includes("ace") && + roundWonType == TranslateKeys.Endround_RoundAce) || + (spons.roundCeremonie.includes("clutch") && + roundWonType == TranslateKeys.Endround_RoundClutch) || + (spons.roundCeremonie.includes("teamAce") && + roundWonType == TranslateKeys.Endround_RoundTeamAce) || + (spons.roundCeremonie.includes("flawless") && + roundWonType == TranslateKeys.Endround_RoundFlawless) || + (spons.roundCeremonie.includes("thrifty") && + roundWonType == TranslateKeys.Endround_RoundThrifty) + ) { + return spons; + } + } + } + return sponsor; + } + + bannerBackgroundUrl = computed(() => { + const backdropSponsor = this.roundWonSponsor().backdropUrl; + const backdropTournament = this.dataModel.tournamentInfo().backdropUrl; + if (this.roundWinBox().type == "sponsors" && backdropSponsor && backdropSponsor !== "") + return backdropSponsor; + if ( + this.roundWinBox().type == "tournamentInfo" && + backdropTournament && + backdropTournament !== "" + ) + return backdropTournament; + else return false; }); - tournamentIconUrl = computed(() => { - const logo = this.dataModel.tournamentInfo().logoUrl; - if (logo && logo !== "") return logo; + bannerTopIconUrl = computed(() => { + const logoSponsor = this.roundWonSponsor().iconUrl; + const logoTournament = this.dataModel.tournamentInfo().logoUrl; + if (this.roundWinBox().type == "sponsors" && logoSponsor && logoSponsor !== "") + return logoSponsor; + if (this.roundWinBox().type == "tournamentInfo" && logoTournament && logoTournament !== "") + return logoTournament; else return "assets/misc/logo.webp"; }); @@ -116,8 +178,7 @@ export class EndroundBannerComponent { }); readonly waitingBackgroundClass = computed(() => { - const test = `gradient-head-to-head-${this.dataModel.teams()[0].isAttacking ? "attacker" : "defender"}`; - return test; + return `gradient-head-to-head-${this.dataModel.teams()[0].isAttacking ? "attacker" : "defender"}`; }); readonly winningTeamBackgroundClass = computed(() => { @@ -142,7 +203,7 @@ export class EndroundBannerComponent { this.preload = false; } - ref = effect(() => { + _ref = effect(() => { const roundPhase = this.dataModel.match().roundPhase; const roundNumber = this.dataModel.match().roundNumber; diff --git a/src/app/overlays/map-breakdown/map-breakdown.html b/src/app/overlays/map-breakdown/map-breakdown.html index 0ee2e417..d03c8efe 100644 --- a/src/app/overlays/map-breakdown/map-breakdown.html +++ b/src/app/overlays/map-breakdown/map-breakdown.html @@ -1,70 +1,131 @@ @if (leftTeam?.tricode && rightTeam?.tricode) { -
+
-
+
{{leftTeam?.tricode}} - {{ (leftTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | translate }} + {{ (leftTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | + translate }}
-
+
{{leftTeam?.rounds?.won}}
-
- +
+
-
+
-
+
{{rightTeam?.rounds?.won}}
{{rightTeam?.tricode}} - {{ (rightTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | translate }} + {{ (rightTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | + translate }}
-
+
-
- {{statsData?.metadata?.map?.name}} +
+ {{statsData?.metadata?.map?.name}}
-
- +
+ - + - - + + - - - + + + +
-
+
-
+
{{leftFirstKills}}
{{leftThrifties}}
@@ -72,41 +133,114 @@
{{leftClutches}}
-
+
-
- - +
+ + {{TranslateKeys.Breakdown_FirstKills | translate}}
-
- - +
+ + {{TranslateKeys.Breakdown_Thrifties | translate}}
-
- +
+ - - - - + + + + {{TranslateKeys.Breakdown_PostPlants | translate}}
-
- - +
+ + {{TranslateKeys.Breakdown_Clutches | translate}} -
+
-
-
+
+
{{rightFirstKills}}
{{rightThrifties}}
{{rightWonPostPlants}}/{{leftWonPostPlants + rightWonPostPlants}}
@@ -116,62 +250,153 @@
-
- +
+ - + - - + + - - - + + + +
-
+
-
+
@for (round of roundReasonValues(); track $index) { -
{{$index + 1}}
+
{{$index + 1}}
} -
WIN
+
WIN
@for (round of roundReasonValues(); track $index) { - - @switch (round.reason) { - @case ('defused') { - - - - } - @case ('detonated') { - - - - } - @case ('kills') { - - - - - - - - - } - @default { - - - - } - } + + @switch (round.reason) { @case ('defused') { + + + + } @case ('detonated') { + + + + } @case ('kills') { + + + + + + + + + } @default { + + + + } } } @@ -179,16 +404,17 @@
-
- @if(dataModel.sponsorInfo().enabled) { - @for (sponsor of dataModel.sponsorInfo().sponsors; track $index) { - - } - } +
+ @if(dataModel.sponsorInfo().enabled) { @for (sponsor of dataModel.sponsorInfo().sponsors; track + $index) { + + } }
-} \ No newline at end of file +} diff --git a/src/app/overlays/map-breakdown/map-breakdown.ts b/src/app/overlays/map-breakdown/map-breakdown.ts index 3e286f3c..61750169 100644 --- a/src/app/overlays/map-breakdown/map-breakdown.ts +++ b/src/app/overlays/map-breakdown/map-breakdown.ts @@ -96,9 +96,12 @@ export class MapBreakdown implements OnInit, OnDestroy { this.currentSponsorIndex.set(0); if (sponsorInfo.enabled && sponsorInfo.sponsors.length > 1) { - const duration = sponsorInfo.duration > 100 ? sponsorInfo.duration : sponsorInfo.duration * 1000; + const duration = + sponsorInfo.duration > 100 ? sponsorInfo.duration : sponsorInfo.duration * 1000; this.sponsorIntervalId = window.setInterval(() => { - this.currentSponsorIndex.update((i) => (i + 1) % this.dataModel.sponsorInfo().sponsors.length); + this.currentSponsorIndex.update( + (i) => (i + 1) % this.dataModel.sponsorInfo().sponsors.length, + ); }, duration); } }); @@ -118,7 +121,6 @@ export class MapBreakdown implements OnInit, OnDestroy { this.stopPolling(); } }); - } ngOnDestroy() { @@ -167,12 +169,15 @@ export class MapBreakdown implements OnInit, OnDestroy { this.roundsPlayed = this.statsData.rounds.length; this.http - .get<{ leftTeam: AuthTeam; rightTeam: AuthTeam; higherScore: 0 | 1; tournamentInfo?: ITournamentInfo; sponsorInfo?: ISponsorInfo }>( - `${this.config.extrasEndpoint}/getTeamInfoForCode`, - { - params: { groupCode }, - }, - ) + .get<{ + leftTeam: AuthTeam; + rightTeam: AuthTeam; + higherScore: 0 | 1; + tournamentInfo?: ITournamentInfo; + sponsorInfo?: ISponsorInfo; + }>(`${this.config.extrasEndpoint}/getTeamInfoForCode`, { + params: { groupCode }, + }) .subscribe((data) => { if (data.tournamentInfo) this.dataModel.setTournamentInfo(data.tournamentInfo); if (data.sponsorInfo) this.dataModel.setSponsorInfo(data.sponsorInfo); diff --git a/src/app/overlays/team-breakdown/team-breakdown.html b/src/app/overlays/team-breakdown/team-breakdown.html index 1be02e53..f4ea0689 100644 --- a/src/app/overlays/team-breakdown/team-breakdown.html +++ b/src/app/overlays/team-breakdown/team-breakdown.html @@ -1,47 +1,93 @@ @if (leftTeam?.tricode && rightTeam?.tricode) { -
+
@if (!hideBg) { } -
+
-
+
{{leftTeam?.tricode}} - {{ (leftTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | translate }} + {{ (leftTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | + translate }}
-
+
{{leftTeam?.rounds?.won}}
- + - + - - + + - - - + + + +
-
- + - + - - + + - - - + + +
-
+
-
- -
- {{statsData?.metadata?.map?.name}} +
+ +
+ {{statsData?.metadata?.map?.name}}
-
+
@for (i of numSequence(leftPlayers?.length || 0); track $index) { @if ($index > 0) { } } -
-
-
-
+
+
+
+
-
-
- +
+
+
-
-
+
+
KDA ACS First Kills
-
+
@for (i of numSequence(5); track $index) { @if ($index > 0) { -
+
KDA ACS
@@ -110,18 +211,27 @@
-
+
-
+
-
+
{{rightTeam?.rounds?.won}}
- {{rightTeam?.tricode}} - {{ (rightTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | translate }} + {{rightTeam?.tricode}} + {{ (rightTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | + translate }}
@@ -129,8 +239,9 @@
-
-
+
-
+
@for (i of numSequence(rightPlayers?.length || 0); track $index) { @if ($index > 0) { } }
-
- @if(dataModel.sponsorInfo().enabled) { - @for (sponsor of dataModel.sponsorInfo().sponsors; track $index) { - - } - } +
+ @if(dataModel.sponsorInfo().enabled) { @for (sponsor of dataModel.sponsorInfo().sponsors; + track $index) { + + } }
-} \ No newline at end of file +} diff --git a/src/app/overlays/team-breakdown/team-breakdown.ts b/src/app/overlays/team-breakdown/team-breakdown.ts index 7424ef5a..95abebb5 100644 --- a/src/app/overlays/team-breakdown/team-breakdown.ts +++ b/src/app/overlays/team-breakdown/team-breakdown.ts @@ -61,15 +61,17 @@ export class TeamBreakdown implements OnInit, OnDestroy { this.currentSponsorIndex.set(0); if (sponsorInfo.enabled && sponsorInfo.sponsors.length > 1) { - const duration = sponsorInfo.duration > 100 ? sponsorInfo.duration : sponsorInfo.duration * 1000; + const duration = + sponsorInfo.duration > 100 ? sponsorInfo.duration : sponsorInfo.duration * 1000; this.sponsorIntervalId = window.setInterval(() => { - this.currentSponsorIndex.update((i) => (i + 1) % this.dataModel.sponsorInfo().sponsors.length); + this.currentSponsorIndex.update( + (i) => (i + 1) % this.dataModel.sponsorInfo().sponsors.length, + ); }, duration); } }); } - ngOnInit() { this.routeSubscription = this.route.queryParams.subscribe((params) => { this.hideBg = params["hideBg"] === "true" || params["hideBg"] === "1"; @@ -129,12 +131,15 @@ export class TeamBreakdown implements OnInit, OnDestroy { this.roundsPlayed = this.statsData.rounds.length; this.http - .get<{ leftTeam: AuthTeam; rightTeam: AuthTeam; higherScore: 0 | 1; tournamentInfo?: ITournamentInfo; sponsorInfo?: ISponsorInfo }>( - `${this.config.extrasEndpoint}/getTeamInfoForCode`, - { - params: { groupCode }, - }, - ) + .get<{ + leftTeam: AuthTeam; + rightTeam: AuthTeam; + higherScore: 0 | 1; + tournamentInfo?: ITournamentInfo; + sponsorInfo?: ISponsorInfo; + }>(`${this.config.extrasEndpoint}/getTeamInfoForCode`, { + params: { groupCode }, + }) .subscribe((data) => { if (data.tournamentInfo) this.dataModel.setTournamentInfo(data.tournamentInfo); if (data.sponsorInfo) this.dataModel.setSponsorInfo(data.sponsorInfo); diff --git a/src/app/overlays/testing-agent-select/testing-agent-select.component.ts b/src/app/overlays/testing-agent-select/testing-agent-select.component.ts index d4e67cda..6db796a5 100644 --- a/src/app/overlays/testing-agent-select/testing-agent-select.component.ts +++ b/src/app/overlays/testing-agent-select/testing-agent-select.component.ts @@ -59,7 +59,6 @@ export class TestingAgentSelectComponent implements OnInit { right: "Group B", }, tournamentInfo: { - enabled: true, name: "", logoUrl: "", backdropUrl: "", @@ -87,12 +86,16 @@ export class TestingAgentSelectComponent implements OnInit { nameOverrides: { overrides: [], }, - }, - toastInfo: { - active: false, - duration: 10000, - message: "", - eventLogoEnabled: true, + roundWinBox: { + type: "tournamentInfo", + sponsors: [], + }, + toastInfo: { + active: false, + duration: 10000, + message: "", + eventLogoEnabled: true, + }, }, timeoutState: { techPause: false, diff --git a/src/app/overlays/testing-map-breakdown/testing-map-breakdown.html b/src/app/overlays/testing-map-breakdown/testing-map-breakdown.html index 20f6f843..5dad70ca 100644 --- a/src/app/overlays/testing-map-breakdown/testing-map-breakdown.html +++ b/src/app/overlays/testing-map-breakdown/testing-map-breakdown.html @@ -1,70 +1,131 @@ @if (leftTeam?.tricode && rightTeam?.tricode) { -
+
-
+
{{leftTeam?.tricode}} - {{ (leftTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | translate }} + {{ (leftTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | + translate }}
-
+
{{leftTeam?.rounds?.won}}
-
- +
+
-
+
-
+
{{rightTeam?.rounds?.won}}
{{rightTeam?.tricode}} - {{ (rightTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | translate }} + {{ (rightTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | + translate }}
-
+
-
- {{statsData?.metadata?.map?.name}} +
+ {{statsData?.metadata?.map?.name}}
-
- +
+ - + - - + + - - - + + + +
-
+
-
+
{{leftFirstKills}}
{{leftThrifties}}
@@ -72,41 +133,114 @@
{{leftClutches}}
-
+
-
- - +
+ + {{TranslateKeys.Breakdown_FirstKills | translate}}
-
- - +
+ + {{TranslateKeys.Breakdown_Thrifties | translate}}
-
- +
+ - - - - + + + + {{TranslateKeys.Breakdown_PostPlants | translate}}
-
- - +
+ + {{TranslateKeys.Breakdown_Clutches | translate}} -
+
-
-
+
+
{{rightFirstKills}}
{{rightThrifties}}
{{rightWonPostPlants}}/{{leftWonPostPlants + rightWonPostPlants}}
@@ -116,62 +250,153 @@
-
- +
+ - + - - + + - - - + + + +
-
+
-
+
@for (round of roundReasonValues(); track $index) { -
{{$index + 1}}
+
{{$index + 1}}
} -
WIN
+
WIN
@for (round of roundReasonValues(); track $index) { - - @switch (round.reason) { - @case ('defused') { - - - - } - @case ('detonated') { - - - - } - @case ('kills') { - - - - - - - - - } - @default { - - - - } - } + + @switch (round.reason) { @case ('defused') { + + + + } @case ('detonated') { + + + + } @case ('kills') { + + + + + + + + + } @default { + + + + } } } @@ -179,16 +404,17 @@
-
- @if(dataModel.sponsorInfo().sponsors.length > 0 && dataModel.sponsorInfo().enabled) { - @for (sponsor of dataModel.sponsorInfo().sponsors; track $index) { - - } - } +
+ @if(dataModel.sponsorInfo().sponsors.length > 0 && dataModel.sponsorInfo().enabled) { @for + (sponsor of dataModel.sponsorInfo().sponsors; track $index) { + + } }
} diff --git a/src/app/overlays/testing-map-breakdown/testing-map-breakdown.ts b/src/app/overlays/testing-map-breakdown/testing-map-breakdown.ts index 5bbdd08f..4bd97e4d 100644 --- a/src/app/overlays/testing-map-breakdown/testing-map-breakdown.ts +++ b/src/app/overlays/testing-map-breakdown/testing-map-breakdown.ts @@ -137,18 +137,19 @@ export class TestingMapBreakdown implements OnInit, OnDestroy { sponsorInfo: { enabled: true, duration: 5000, - sponsors: [ - "assets/misc/logo.webp", - ], + sponsors: ["assets/misc/logo.webp"], }, }, })); const sponsorInfo = this.dataModel.sponsorInfo(); if (sponsorInfo.enabled && sponsorInfo.sponsors.length > 1) { - const duration = sponsorInfo.duration > 100 ? sponsorInfo.duration : sponsorInfo.duration * 1000; + const duration = + sponsorInfo.duration > 100 ? sponsorInfo.duration : sponsorInfo.duration * 1000; this.sponsorIntervalId = window.setInterval(() => { - this.currentSponsorIndex.update((i) => (i + 1) % this.dataModel.sponsorInfo().sponsors.length); + this.currentSponsorIndex.update( + (i) => (i + 1) % this.dataModel.sponsorInfo().sponsors.length, + ); }, duration); } } @@ -309,7 +310,18 @@ export class TestingMapBreakdown implements OnInit, OnDestroy { } private createMockPlayers(): StatsApiMatchPlayer[] { - const agents = ["Jett", "Phoenix", "Omen", "Sage", "Sova", "Reyna", "Killjoy", "Cypher", "Viper", "Raze"]; + const agents = [ + "Jett", + "Phoenix", + "Omen", + "Sage", + "Sova", + "Reyna", + "Killjoy", + "Cypher", + "Viper", + "Raze", + ]; const players: StatsApiMatchPlayer[] = []; for (let i = 0; i < 10; i++) { @@ -346,7 +358,11 @@ export class TestingMapBreakdown implements OnInit, OnDestroy { prefered_level_border: null, account_level: 250, session_playtime_in_ms: 2400000, - behavior: { afk_rounds: 0, friendly_fire: { incoming: 0, outgoing: 0 }, rounds_in_spawn: 0 }, + behavior: { + afk_rounds: 0, + friendly_fire: { incoming: 0, outgoing: 0 }, + rounds_in_spawn: 0, + }, economy: { spent: { overall: 45000, average: 2045 }, loadout_value: { overall: 52000, average: 2364 }, @@ -381,13 +397,15 @@ export class TestingMapBreakdown implements OnInit, OnDestroy { result: results[Math.floor(Math.random() * results.length)], ceremony: ceremonies[Math.floor(Math.random() * ceremonies.length)], winning_team: winningTeam, - plant: hasPlant ? { - round_time_in_ms: 45000, - site: "A", - location: { x: 100, y: 200 }, - player: { puuid: "player-5", name: "Enemy1", tag: "1005", team: "Red" }, - player_locations: [], - } : null, + plant: hasPlant + ? { + round_time_in_ms: 45000, + site: "A", + location: { x: 100, y: 200 }, + player: { puuid: "player-5", name: "Enemy1", tag: "1005", team: "Red" }, + player_locations: [], + } + : null, defuse: null, stats: [], }); diff --git a/src/app/overlays/testing-team-breakdown/testing-team-breakdown.html b/src/app/overlays/testing-team-breakdown/testing-team-breakdown.html index 95b962cd..5d780f8f 100644 --- a/src/app/overlays/testing-team-breakdown/testing-team-breakdown.html +++ b/src/app/overlays/testing-team-breakdown/testing-team-breakdown.html @@ -1,47 +1,93 @@ @if (leftTeam?.tricode && rightTeam?.tricode) { -
+
@if (!hideBg) { } -
+
-
+
{{leftTeam?.tricode}} - {{ (leftTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | translate }} + {{ (leftTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | + translate }}
-
+
{{leftTeam?.rounds?.won}}
- + - + - - + + - - - + + + +
-
- + - + - - + + - - - + + +
-
+
-
- -
- {{statsData?.metadata?.map?.name}} +
+ +
+ {{statsData?.metadata?.map?.name}}
-
+
@for (i of numSequence(leftPlayers?.length || 0); track $index) { @if ($index > 0) { } } -
-
-
-
+
+
+
+
-
-
- +
+
+
-
-
+
+
KDA ACS First Kills
-
+
@for (i of numSequence(5); track $index) { @if ($index > 0) { -
+
KDA ACS
@@ -110,18 +211,27 @@
-
+
-
+
-
+
{{rightTeam?.rounds?.won}}
- {{rightTeam?.tricode}} - {{ (rightTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | translate }} + {{rightTeam?.tricode}} + {{ (rightTeam?.won ? TranslateKeys.Breakdown_Win : TranslateKeys.Breakdown_Loss) | + translate }}
@@ -129,8 +239,9 @@
-
-
+
-
+
@for (i of numSequence(rightPlayers?.length || 0); track $index) { @if ($index > 0) { } }
-
- @if(dataModel.sponsorInfo().sponsors.length > 0 && dataModel.sponsorInfo().enabled) { - @for (sponsor of dataModel.sponsorInfo().sponsors; track $index) { - - } - } +
+ @if(dataModel.sponsorInfo().sponsors.length > 0 && dataModel.sponsorInfo().enabled) { @for + (sponsor of dataModel.sponsorInfo().sponsors; track $index) { + + } }
-} \ No newline at end of file +} diff --git a/src/app/overlays/testing-team-breakdown/testing-team-breakdown.ts b/src/app/overlays/testing-team-breakdown/testing-team-breakdown.ts index fd453d96..4fca5a43 100644 --- a/src/app/overlays/testing-team-breakdown/testing-team-breakdown.ts +++ b/src/app/overlays/testing-team-breakdown/testing-team-breakdown.ts @@ -16,14 +16,14 @@ import { DataModelService } from "../../services/dataModel.service"; templateUrl: "./testing-team-breakdown.html", styleUrl: "./testing-team-breakdown.css", }) -export class TestingTeamBreakdown implements OnInit { +export class TestingTeamBreakdown implements OnInit, OnDestroy { dataModel = inject(DataModelService); TranslateKeys = TranslateKeys; protected hideBg = false; protected statsData?: StatsApiMatch; - + protected currentSponsorIndex = signal(0); private sponsorIntervalId?: number; protected roundsPlayed = 0; @@ -37,7 +37,7 @@ export class TestingTeamBreakdown implements OnInit { ngOnInit() { this.initializeMockData(); } - + ngOnDestroy() { if (this.sponsorIntervalId) { clearInterval(this.sponsorIntervalId); @@ -89,7 +89,7 @@ export class TestingTeamBreakdown implements OnInit { rounds: this.createMockRounds(), kills: this.createMockKills(mockPlayers), }; - + // Inject mock sponsor data for testing, then start rotation this.dataModel.match.update((data) => ({ ...data, @@ -98,18 +98,19 @@ export class TestingTeamBreakdown implements OnInit { sponsorInfo: { enabled: true, duration: 5000, - sponsors: [ - "assets/misc/logo.webp", - ], + sponsors: ["assets/misc/logo.webp"], }, }, })); const sponsorInfo = this.dataModel.sponsorInfo(); if (sponsorInfo.enabled && sponsorInfo.sponsors.length > 1) { - const duration = sponsorInfo.duration > 100 ? sponsorInfo.duration : sponsorInfo.duration * 1000; + const duration = + sponsorInfo.duration > 100 ? sponsorInfo.duration : sponsorInfo.duration * 1000; this.sponsorIntervalId = window.setInterval(() => { - this.currentSponsorIndex.update((i) => (i + 1) % this.dataModel.sponsorInfo().sponsors.length); + this.currentSponsorIndex.update( + (i) => (i + 1) % this.dataModel.sponsorInfo().sponsors.length, + ); }, duration); } @@ -134,9 +135,19 @@ export class TestingTeamBreakdown implements OnInit { this.rightPlayers.sort((a, b) => (b.stats.acs || 0) - (a.stats.acs || 0)); } - private createMockPlayers(): StatsApiMatchPlayer[] { - const agents = ["Jett", "Phoenix", "Omen", "Sage", "Sova", "Reyna", "Killjoy", "Cypher", "Viper", "Raze"]; + const agents = [ + "Jett", + "Phoenix", + "Omen", + "Sage", + "Sova", + "Reyna", + "Killjoy", + "Cypher", + "Viper", + "Raze", + ]; const players: StatsApiMatchPlayer[] = []; for (let i = 0; i < 10; i++) { @@ -173,7 +184,11 @@ export class TestingTeamBreakdown implements OnInit { prefered_level_border: null, account_level: 250, session_playtime_in_ms: 2400000, - behavior: { afk_rounds: 0, friendly_fire: { incoming: 0, outgoing: 0 }, rounds_in_spawn: 0 }, + behavior: { + afk_rounds: 0, + friendly_fire: { incoming: 0, outgoing: 0 }, + rounds_in_spawn: 0, + }, economy: { spent: { overall: 45000, average: 2045 }, loadout_value: { overall: 52000, average: 2364 }, diff --git a/src/app/overlays/testing/testing.component.html b/src/app/overlays/testing/testing.component.html index d04b08e7..d678e1b2 100644 --- a/src/app/overlays/testing/testing.component.html +++ b/src/app/overlays/testing/testing.component.html @@ -1,5 +1,5 @@ - +
diff --git a/src/app/overlays/testing/testing.component.ts b/src/app/overlays/testing/testing.component.ts index 34e921ed..8872f332 100644 --- a/src/app/overlays/testing/testing.component.ts +++ b/src/app/overlays/testing/testing.component.ts @@ -62,7 +62,6 @@ export class TestingComponent implements OnInit { right: "Group B", }, tournamentInfo: { - enabled: true, name: "", logoUrl: "", backdropUrl: "", @@ -90,13 +89,17 @@ export class TestingComponent implements OnInit { removeTricodes: false, }, nameOverrides: { overrides: [] }, - }, - toastInfo: { - active: false, - duration: 10000, - message: "", - selectedTeam: "left", - eventLogoEnabled: true, + roundWinBox: { + type: "tournamentInfo", + sponsors: [], + }, + toastInfo: { + active: false, + duration: 10000, + message: "", + selectedTeam: "left", + eventLogoEnabled: true, + }, }, timeoutState: { techPause: false, diff --git a/src/app/overlays/toast-overlay/toast-component.html b/src/app/overlays/toast-overlay/toast-component.html index 4a750d02..fcc1d301 100644 --- a/src/app/overlays/toast-overlay/toast-component.html +++ b/src/app/overlays/toast-overlay/toast-component.html @@ -1,47 +1,79 @@ @if(dataModel.match().roundPhase === "shopping") { +
-
-
- - - - - - -
-
-
- +
+ + + + + + +
+
+
+
- {{ toastInfo().message }}
@if (toastInfo().eventLogoEnabled) { -
- -
+
+ +
}
-
-} \ No newline at end of file +
+} diff --git a/src/app/services/Types.ts b/src/app/services/Types.ts index ae6d3da4..7cfbf0bd 100644 --- a/src/app/services/Types.ts +++ b/src/app/services/Types.ts @@ -113,6 +113,7 @@ export interface IToolsData { watermarkInfo: IWatermarkInfo; playercamsInfo: IPlayercamsInfo; nameOverrides: INameOverrides; + roundWinBox: IRoundWinBox; } export interface ISeriesInfo { @@ -131,7 +132,6 @@ export interface ITournamentInfo { name: string; logoUrl: string; backdropUrl: string; - enabled: boolean; } export interface ISponsorInfo { @@ -159,6 +159,18 @@ export interface INameOverrides { overrides: string[]; } +export interface IRoundWinBox { + type: "disabled" | "tournamentInfo" | "sponsors"; + sponsors: IRoundWinBoxSponsors[]; +} + +export interface IRoundWinBoxSponsors { + wonTeam: "all" | "left" | "right"; + roundCeremonie: ("all" | "normal" | "ace" | "clutch" | "teamAce" | "flawless" | "thrifty")[]; + iconUrl: string; + backdropUrl: string; +} + export interface IOverridesPlayercamsData { nameOverrides: string[]; enabledPlayers: string[]; diff --git a/src/app/services/dataModel.service.ts b/src/app/services/dataModel.service.ts index 02b47987..65f3737d 100644 --- a/src/app/services/dataModel.service.ts +++ b/src/app/services/dataModel.service.ts @@ -127,13 +127,18 @@ export class DataModelService { }); public seriesInfo = computed(() => this.match().tools.seriesInfo); public seedingInfo = computed(() => this.match().tools.seedingInfo); - public sponsorInfo = computed(() => this._sponsorInfoOverride() ?? this.match().tools.sponsorInfo); + public sponsorInfo = computed( + () => this._sponsorInfoOverride() ?? this.match().tools.sponsorInfo, + ); public watermarkInfo = computed(() => this.match().tools.watermarkInfo); - public tournamentInfo = computed(() => this._tournamentInfoOverride() ?? this.match().tools.tournamentInfo); + public tournamentInfo = computed( + () => this._tournamentInfoOverride() ?? this.match().tools.tournamentInfo, + ); public toastInfo = computed(() => this.match().toastInfo, { equal: () => false }); public playercamsInfo = computed(() => this.match().tools.playercamsInfo, { equal: () => false, }); + public readonly roundWinBox = computed(() => this.match().tools.roundWinBox); public mapban = signal(initialMapbanData, { equal: () => false }); } @@ -179,7 +184,6 @@ export const initialMatchData: IMatchData = { right: "", }, tournamentInfo: { - enabled: false, name: "", logoUrl: "", backdropUrl: "", @@ -204,6 +208,10 @@ export const initialMatchData: IMatchData = { }, playercamsInfo: { enable: false }, nameOverrides: { overrides: [] }, + roundWinBox: { + type: "disabled", + sponsors: [], + }, }, toastInfo: { active: false, diff --git a/src/styles.css b/src/styles.css index 699c0102..8c02048c 100644 --- a/src/styles.css +++ b/src/styles.css @@ -63,8 +63,8 @@ --color-attacker-scoreboard: #ff1e31; --color-attacker-roundReasons: #1d1414; - --color-postmatch-primary: #AE2A2A; - --color-postmatch-secondary: #FFD075; + --color-postmatch-primary: #ae2a2a; + --color-postmatch-secondary: #ffd075; } @utility font-montserrat {