Compare commits

..

3 Commits

Author SHA1 Message Date
f3bd721e86 swap games and sessions sections places 2022-10-25 13:41:30 +03:00
b2a2bbc363 fix game launch 2022-10-25 13:41:03 +03:00
5b960ed297 enable new design loading by default 2022-10-25 13:40:40 +03:00
4 changed files with 24 additions and 9 deletions

View File

@ -1,5 +1,6 @@
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]',
@ -9,12 +10,14 @@ import { Game } from 'src/app/interfaces/game.interface'
export class GameComponent implements OnInit {
@Input() game!: Game
constructor() { }
constructor(private launcher: LauncherService) { }
ngOnInit(): void {
this.game.image = "assets/games/" + this.game.gameId + "/icon.png"
}
run(game: Game) {
console.log('Game to run ' + game.title)
//console.log('Game to run ' + game.title)
this.launcher.RunGame(game)
}
}

View File

@ -23,6 +23,6 @@
<skirda-heading size="6">Friends</skirda-heading>
</skirda-section>
</div>
<app-menu-sessions></app-menu-sessions>
<app-menu-games></app-menu-games>
<app-menu-sessions></app-menu-sessions>
</menu>

View File

@ -1,5 +1,6 @@
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',
@ -7,23 +8,34 @@ import { Game } from 'src/app/interfaces/game.interface'
styleUrls: ['./menu-games.component.scss']
})
export class MenuGamesComponent implements OnInit {
games: Game[] = [{
gameId: 'id:minecraft',
fakeGames: Game[] = [{
gameId: 'minecraft',
title: 'Minecraft',
image: '/assets/games/minecraft/icon.png',
}, {
gameId: 'id:garrysmod',
gameId: 'garrysmod',
title: 'Garry\'s mod',
image: '/assets/games/garrysmod/icon.png',
}, {
gameId: 'id:openarena',
gameId: '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;
});
}
}
}

View File

@ -8,11 +8,11 @@ import { SignInComponent } from '../components/sign-in/sign-in.component';
const routes: Routes = [
{
path: '',
path: 'playground',
component: PlaygroundComponent,
},
{
path: 'main',
path: '',
loadChildren: () => MainRoutingModule
},
{