Compare commits
No commits in common. "f3bd721e86a471e64b04c232b82dc1a264ec4ab8" and "2796479ac03fd0994af21c2752c8619204df3c48" have entirely different histories.
f3bd721e86
...
2796479ac0
@ -1,6 +1,5 @@
|
|||||||
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]',
|
||||||
@ -10,14 +9,12 @@ import { LauncherService } from 'src/app/services/launcher.service';
|
|||||||
export class GameComponent implements OnInit {
|
export class GameComponent implements OnInit {
|
||||||
@Input() game!: Game
|
@Input() game!: Game
|
||||||
|
|
||||||
constructor(private launcher: LauncherService) { }
|
constructor() { }
|
||||||
|
|
||||||
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-games></app-menu-games>
|
|
||||||
<app-menu-sessions></app-menu-sessions>
|
<app-menu-sessions></app-menu-sessions>
|
||||||
|
<app-menu-games></app-menu-games>
|
||||||
</menu>
|
</menu>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
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',
|
||||||
@ -8,34 +7,23 @@ import { GetGames } from 'src/app/services/go';
|
|||||||
styleUrls: ['./menu-games.component.scss']
|
styleUrls: ['./menu-games.component.scss']
|
||||||
})
|
})
|
||||||
export class MenuGamesComponent implements OnInit {
|
export class MenuGamesComponent implements OnInit {
|
||||||
fakeGames: Game[] = [{
|
games: Game[] = [{
|
||||||
gameId: 'minecraft',
|
gameId: 'id:minecraft',
|
||||||
title: 'Minecraft',
|
title: 'Minecraft',
|
||||||
image: '/assets/games/minecraft/icon.png',
|
image: '/assets/games/minecraft/icon.png',
|
||||||
}, {
|
}, {
|
||||||
gameId: 'garrysmod',
|
gameId: 'id:garrysmod',
|
||||||
title: 'Garry\'s mod',
|
title: 'Garry\'s mod',
|
||||||
image: '/assets/games/garrysmod/icon.png',
|
image: '/assets/games/garrysmod/icon.png',
|
||||||
}, {
|
}, {
|
||||||
gameId: 'openarena',
|
gameId: 'id: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: 'playground',
|
path: '',
|
||||||
component: PlaygroundComponent,
|
component: PlaygroundComponent,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: 'main',
|
||||||
loadChildren: () => MainRoutingModule
|
loadChildren: () => MainRoutingModule
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user