Compare commits
No commits in common. "66650a79da456da289f1e76df36cc500370326f2" and "38089045eae67785ca35f9a884eb3bec0b640ead" have entirely different histories.
66650a79da
...
38089045ea
@ -0,0 +1,8 @@
|
||||
export interface Session {
|
||||
id: string;
|
||||
icon: string;
|
||||
title: string;
|
||||
status?: string;
|
||||
version: string;
|
||||
expires: Date;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Session } from 'src/app/interfaces/session.interface';
|
||||
import { Session } from '../interfaces/session';
|
||||
|
||||
@Component({
|
||||
selector: 'skirda-session[session]',
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { Game } from 'src/app/interfaces/game.interface';
|
||||
import { GoGetGames } from 'src/app/services/go';
|
||||
import { GetGames } from 'src/app/services/go';
|
||||
|
||||
@Component({
|
||||
selector: 'app-games-bar',
|
||||
@ -19,7 +19,7 @@ export class GamesBarComponent implements OnInit {
|
||||
}
|
||||
|
||||
getGames() {
|
||||
if (GoGetGames == undefined){
|
||||
if (GetGames == undefined){
|
||||
var fakeGame: Game = {
|
||||
gameId: "Fake Game",
|
||||
title: "Fake game",
|
||||
@ -30,7 +30,7 @@ export class GamesBarComponent implements OnInit {
|
||||
this.activeGame = this.games[0]
|
||||
}
|
||||
else{
|
||||
GoGetGames().then((value) => {
|
||||
GetGames().then((value) => {
|
||||
console.log(value);
|
||||
this.games = value;
|
||||
if (this.games.length > 0){
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Game } from 'src/app/interfaces/game.interface'
|
||||
import { GoGetGames } from 'src/app/services/go';
|
||||
import { GetGames } from 'src/app/services/go';
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu-games',
|
||||
@ -27,11 +27,11 @@ export class MenuGamesComponent implements OnInit {
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
if (GoGetGames == undefined){
|
||||
if (GetGames == undefined){
|
||||
this.games = this.fakeGames
|
||||
}
|
||||
else{
|
||||
GoGetGames().then((value) => {
|
||||
GetGames().then((value) => {
|
||||
console.log(value);
|
||||
this.games = value;
|
||||
});
|
||||
|
@ -3,7 +3,7 @@
|
||||
</skirda-section-label>
|
||||
<div class="sessions">
|
||||
<skirda-session
|
||||
[routerLink]="['/session/' + session.gameId]" routerLinkActive="active"
|
||||
[routerLink]="['/session/' + session.id]" routerLinkActive="active"
|
||||
*ngFor="let session of sessions; index as i"
|
||||
[session]="session"
|
||||
></skirda-session>
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Session } from 'src/app/interfaces/session.interface';
|
||||
import { GoGetSessions } from 'src/app/services/go';
|
||||
import { Session } from 'projects/ui/src/lib/interfaces/session';
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu-sessions',
|
||||
@ -8,9 +7,9 @@ import { GoGetSessions } from 'src/app/services/go';
|
||||
styleUrls: ['./menu-sessions.component.scss'],
|
||||
})
|
||||
export class MenuSessionsComponent implements OnInit {
|
||||
fakeSessions: Session[] = [
|
||||
sessions: Session[] = [
|
||||
{
|
||||
gameId: 'minecraft-001',
|
||||
id: 'minecraft-001',
|
||||
icon: '/assets/games/minecraft/icon.png',
|
||||
title: 'Minecraft',
|
||||
version: '1.19.2',
|
||||
@ -18,32 +17,22 @@ export class MenuSessionsComponent implements OnInit {
|
||||
expires: new Date('2022-10-30'),
|
||||
},
|
||||
{
|
||||
gameId: 'minecraft-002',
|
||||
id: 'minecraft-002',
|
||||
icon: '/assets/games/garrysmod/icon.png',
|
||||
title: 'Minecraft 2',
|
||||
version: '1.12-dev',
|
||||
expires: new Date('2022-10-27T20:00:00'),
|
||||
},
|
||||
{
|
||||
gameId: 'minecraft-003',
|
||||
id: 'minecraft-003',
|
||||
icon: '/assets/games/minecraft/icon.png',
|
||||
title: 'Minecraft 3',
|
||||
version: '1.7.10',
|
||||
expires: new Date('2022-10-30T20:00:00'),
|
||||
},
|
||||
];
|
||||
sessions: Session[] = [];
|
||||
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {
|
||||
if(GoGetSessions == undefined){
|
||||
this.sessions = this.fakeSessions
|
||||
}
|
||||
else {
|
||||
GoGetSessions().then((value) => {
|
||||
this.sessions = value
|
||||
})
|
||||
}
|
||||
}
|
||||
ngOnInit(): void {}
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
export interface Session {
|
||||
gameId: string;
|
||||
icon: string;
|
||||
title: string;
|
||||
status?: string;
|
||||
version: string;
|
||||
expires: Date;
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { Game } from '../interfaces/game.interface';
|
||||
import { Session } from '../interfaces/session.interface';
|
||||
|
||||
export interface Go extends Window {
|
||||
GoGetGames: () => Promise<Game[]>;
|
||||
GoGetSessions: () => Promise<Session[]>
|
||||
GetGames: () => Promise<Game[]>;
|
||||
GoRunGame: (gameId: string) => void;
|
||||
}
|
||||
|
||||
@ -11,7 +9,7 @@ export interface GoCallback extends Window {
|
||||
SetVersion: (value: string) => void;
|
||||
}
|
||||
|
||||
let { GoGetGames, GoRunGame, GoGetSessions } = window as unknown as Go;
|
||||
let { GetGames, GoRunGame } = window as unknown as Go;
|
||||
let { SetVersion } = window as unknown as GoCallback;
|
||||
|
||||
let w = window as unknown as GoCallback;
|
||||
@ -32,4 +30,4 @@ let w = window as unknown as GoCallback;
|
||||
// document.dispatchEvent(event);
|
||||
// };
|
||||
|
||||
export { GoGetGames, GoGetSessions, SetVersion, GoRunGame };
|
||||
export { GetGames, SetVersion, GoRunGame };
|
||||
|
Loading…
Reference in New Issue
Block a user