From b8ba97cb2e8f10e2a0111e1e81f191afcbb9994a Mon Sep 17 00:00:00 2001 From: MrSandMan Date: Thu, 12 Jan 2023 20:50:35 +0300 Subject: [PATCH] Integrated launch button on main "Play" button --- .../main/sections/game-page/game-page.component.html | 2 +- .../main/sections/game-page/game-page.component.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/components/main/sections/game-page/game-page.component.html b/src/app/components/main/sections/game-page/game-page.component.html index 2edbe48..c4eafda 100644 --- a/src/app/components/main/sections/game-page/game-page.component.html +++ b/src/app/components/main/sections/game-page/game-page.component.html @@ -47,7 +47,7 @@ - + Play diff --git a/src/app/components/main/sections/game-page/game-page.component.ts b/src/app/components/main/sections/game-page/game-page.component.ts index b9bec65..c1d80c7 100644 --- a/src/app/components/main/sections/game-page/game-page.component.ts +++ b/src/app/components/main/sections/game-page/game-page.component.ts @@ -5,6 +5,7 @@ import { PopupService } from 'projects/ui/src/lib/popup/popup.service' import { Subscription } from 'rxjs' import { Game } from 'src/app/interfaces/game.interface' import { UiService } from 'src/app/services/ui.service' +import { LauncherService } from 'src/app/services/launcher.service'; @Component({ selector: 'app-game-page', @@ -43,10 +44,17 @@ export class GamePageComponent implements OnInit, OnDestroy { constructor( private router: Router, + private launcher: LauncherService, + // 4. Импортировать сервис для попап окон private popup: PopupService ) {} + run(game: Game) { + //console.log('Game to run ' + game.title) + this.launcher.RunGame(game) + } + ngOnInit(): void { this.observeNavigation() }