Integrated launch button on main "Play" button

This commit is contained in:
MrSandMan 2023-01-12 20:50:35 +03:00
parent 0c672e90ce
commit b8ba97cb2e
2 changed files with 9 additions and 1 deletions

View File

@ -47,7 +47,7 @@
<!-- 6. Вызываем в нужном месте (в html компонента) открытие попап окна и передаем в метод из ts шаблон
(название переменной popupContent должно совпадать с аттрибутом
у описанного шаблона из пункта 2 (<ng-template #popupContent>)) -->
<skirda-button size="large" appearance="primary" (click)="openPopup(popupContent)">
<skirda-button size="large" appearance="primary" (click)="run(game)">
<skirda-icon name="play" size="32"></skirda-icon>
<skirda-heading size="1">Play</skirda-heading>
</skirda-button>

View File

@ -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()
}