Compare commits
3 Commits
2796479ac0
...
f3bd721e86
Author | SHA1 | Date | |
---|---|---|---|
f3bd721e86 | |||
b2a2bbc363 | |||
5b960ed297 |
@ -1,5 +1,6 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { Game } from 'src/app/interfaces/game.interface'
|
import { Game } from 'src/app/interfaces/game.interface'
|
||||||
|
import { LauncherService } from 'src/app/services/launcher.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'skirda-game[game]',
|
selector: 'skirda-game[game]',
|
||||||
@ -9,12 +10,14 @@ import { Game } from 'src/app/interfaces/game.interface'
|
|||||||
export class GameComponent implements OnInit {
|
export class GameComponent implements OnInit {
|
||||||
@Input() game!: Game
|
@Input() game!: Game
|
||||||
|
|
||||||
constructor() { }
|
constructor(private launcher: LauncherService) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.game.image = "assets/games/" + this.game.gameId + "/icon.png"
|
||||||
}
|
}
|
||||||
|
|
||||||
run(game: Game) {
|
run(game: Game) {
|
||||||
console.log('Game to run ' + game.title)
|
//console.log('Game to run ' + game.title)
|
||||||
|
this.launcher.RunGame(game)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,6 @@
|
|||||||
<skirda-heading size="6">Friends</skirda-heading>
|
<skirda-heading size="6">Friends</skirda-heading>
|
||||||
</skirda-section>
|
</skirda-section>
|
||||||
</div>
|
</div>
|
||||||
<app-menu-sessions></app-menu-sessions>
|
|
||||||
<app-menu-games></app-menu-games>
|
<app-menu-games></app-menu-games>
|
||||||
|
<app-menu-sessions></app-menu-sessions>
|
||||||
</menu>
|
</menu>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Game } from 'src/app/interfaces/game.interface'
|
import { Game } from 'src/app/interfaces/game.interface'
|
||||||
|
import { GetGames } from 'src/app/services/go';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-menu-games',
|
selector: 'app-menu-games',
|
||||||
@ -7,23 +8,34 @@ import { Game } from 'src/app/interfaces/game.interface'
|
|||||||
styleUrls: ['./menu-games.component.scss']
|
styleUrls: ['./menu-games.component.scss']
|
||||||
})
|
})
|
||||||
export class MenuGamesComponent implements OnInit {
|
export class MenuGamesComponent implements OnInit {
|
||||||
games: Game[] = [{
|
fakeGames: Game[] = [{
|
||||||
gameId: 'id:minecraft',
|
gameId: 'minecraft',
|
||||||
title: 'Minecraft',
|
title: 'Minecraft',
|
||||||
image: '/assets/games/minecraft/icon.png',
|
image: '/assets/games/minecraft/icon.png',
|
||||||
}, {
|
}, {
|
||||||
gameId: 'id:garrysmod',
|
gameId: 'garrysmod',
|
||||||
title: 'Garry\'s mod',
|
title: 'Garry\'s mod',
|
||||||
image: '/assets/games/garrysmod/icon.png',
|
image: '/assets/games/garrysmod/icon.png',
|
||||||
}, {
|
}, {
|
||||||
gameId: 'id:openarena',
|
gameId: 'openarena',
|
||||||
title: 'OpenArena',
|
title: 'OpenArena',
|
||||||
image: '/assets/games/openarena/icon.png',
|
image: '/assets/games/openarena/icon.png',
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
games: Game[] = []
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
if (GetGames == undefined){
|
||||||
|
this.games = this.fakeGames
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
GetGames().then((value) => {
|
||||||
|
console.log(value);
|
||||||
|
this.games = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,11 @@ import { SignInComponent } from '../components/sign-in/sign-in.component';
|
|||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: 'playground',
|
||||||
component: PlaygroundComponent,
|
component: PlaygroundComponent,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'main',
|
path: '',
|
||||||
loadChildren: () => MainRoutingModule
|
loadChildren: () => MainRoutingModule
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user