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