Merge remote-tracking branch 'origin/main'
# Conflicts: # package-lock.json # package.json # src/app/app.component.html # src/app/app.component.ts # src/app/app.module.ts # src/app/services/go.ts
This commit is contained in:
commit
3076900a07
10
angular.json
10
angular.json
@ -26,9 +26,17 @@
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
"src/assets",
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/@taiga-ui/icons/src",
|
||||
"output": "assets/taiga-ui/icons"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"node_modules/@taiga-ui/core/styles/taiga-ui-theme.less",
|
||||
"node_modules/@taiga-ui/core/styles/taiga-ui-fonts.less",
|
||||
"node_modules/@taiga-ui/styles/taiga-ui-global.less",
|
||||
"src/styles.scss"
|
||||
],
|
||||
"scripts": []
|
||||
|
790
package-lock.json
generated
790
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -19,6 +19,13 @@
|
||||
"@angular/platform-browser": "^14.1.0",
|
||||
"@angular/platform-browser-dynamic": "^14.1.0",
|
||||
"@angular/router": "^14.1.0",
|
||||
"@taiga-ui/cdk": "^3.6.0",
|
||||
"@taiga-ui/core": "^3.6.0",
|
||||
"@taiga-ui/icons": "^3.6.0",
|
||||
"@taiga-ui/kit": "^3.6.0",
|
||||
"@taiga-ui/styles": "^3.6.0",
|
||||
"@tinkoff/ng-dompurify": "3.0.0",
|
||||
"dompurify": "2.2.9",
|
||||
"rxjs": "~7.5.0",
|
||||
"tslib": "^2.3.0",
|
||||
"zone.js": "~0.11.4"
|
||||
|
@ -1 +1,9 @@
|
||||
<tui-root>
|
||||
Test (version: {{version}})
|
||||
|
||||
<button (click)="getVersion()">Get version</button>
|
||||
<app-games-bar></app-games-bar>
|
||||
<!-- <button (click)="RunGame()">Launch Open Arena</button> -->
|
||||
<!-- <button (click)="launchGame2()">Launch Garry's Mod</button> -->
|
||||
|
||||
</tui-root>
|
@ -1,4 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { GetVersion, GetVersionCallbackDetail, RunGame } from './services/go';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@ -9,28 +10,17 @@ export class AppComponent {
|
||||
title = 'go-web';
|
||||
version: string | null = null;
|
||||
|
||||
games: { id: string; name: string }[] = [
|
||||
{
|
||||
id: 'game-1',
|
||||
name: 'Game one',
|
||||
},
|
||||
{
|
||||
id: 'game-2',
|
||||
name: 'Game two',
|
||||
},
|
||||
{
|
||||
id: 'game-3',
|
||||
name: 'Game three',
|
||||
},
|
||||
];
|
||||
|
||||
constructor() {}
|
||||
|
||||
getVersion() {
|
||||
// document.addEventListener('GetVersion_Callback', (event: Event): void => {
|
||||
// if (!(event instanceof CustomEvent<string>)) return;
|
||||
// this.version = event.detail;
|
||||
// });
|
||||
// GetVersion();
|
||||
document.addEventListener('GetVersion_Callback', (event: Event): void => {
|
||||
if (!(event instanceof CustomEvent<string>)) return;
|
||||
this.version = event.detail;
|
||||
});
|
||||
GetVersion();
|
||||
}
|
||||
|
||||
RunGame() {
|
||||
RunGame();
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
import { NgDompurifySanitizer } from "@tinkoff/ng-dompurify";
|
||||
import { TuiRootModule, TuiDialogModule, TuiAlertModule, TUI_SANITIZER } from "@taiga-ui/core";
|
||||
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
||||
import {TuiButtonModule} from '@taiga-ui/core';
|
||||
import {
|
||||
APP_BASE_HREF,
|
||||
LocationStrategy,
|
||||
@ -6,17 +10,21 @@ import {
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
|
||||
import { AppRoutingModule } from './modules/app-routing.module';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
import { GamesBarModule } from './components/games-bar/games-bar.module';
|
||||
import { GamesBarComponent } from './games-bar/games-bar.component';
|
||||
import { GameButtonComponent } from './games-bar/game-button/game-button.component';
|
||||
import { TuiAvatarModule } from "@taiga-ui/kit";
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent],
|
||||
imports: [BrowserModule, AppRoutingModule, GamesBarModule],
|
||||
declarations: [AppComponent, GamesBarComponent, GameButtonComponent],
|
||||
imports: [BrowserModule, AppRoutingModule, BrowserAnimationsModule, TuiRootModule, TuiDialogModule, TuiAlertModule, TuiButtonModule, TuiAvatarModule],
|
||||
providers: [
|
||||
{ provide: APP_BASE_HREF, useValue: '/' },
|
||||
{ provide: LocationStrategy, useClass: HashLocationStrategy },
|
||||
],
|
||||
{provide: TUI_SANITIZER, useClass: NgDompurifySanitizer}
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
17
src/app/games-bar/game-button/game-button.component.html
Normal file
17
src/app/games-bar/game-button/game-button.component.html
Normal file
@ -0,0 +1,17 @@
|
||||
<ng-template #icon>
|
||||
<tui-avatar
|
||||
size="xs"
|
||||
[rounded]="true"
|
||||
[avatarUrl]="'http://jpg.jpg'"
|
||||
></tui-avatar>
|
||||
</ng-template>
|
||||
|
||||
<button
|
||||
tuiButton
|
||||
type="button"
|
||||
appearance="primary"
|
||||
[icon]="icon"
|
||||
class="tui-space_right-3 tui-space_bottom-3"
|
||||
>
|
||||
<ng-content></ng-content>
|
||||
</button>
|
23
src/app/games-bar/game-button/game-button.component.spec.ts
Normal file
23
src/app/games-bar/game-button/game-button.component.spec.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { GameButtonComponent } from './game-button.component';
|
||||
|
||||
describe('GameButtonComponent', () => {
|
||||
let component: GameButtonComponent;
|
||||
let fixture: ComponentFixture<GameButtonComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ GameButtonComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(GameButtonComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
15
src/app/games-bar/game-button/game-button.component.ts
Normal file
15
src/app/games-bar/game-button/game-button.component.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-game-button',
|
||||
templateUrl: './game-button.component.html',
|
||||
styleUrls: ['./game-button.component.scss']
|
||||
})
|
||||
export class GameButtonComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
5
src/app/games-bar/games-bar.component.html
Normal file
5
src/app/games-bar/games-bar.component.html
Normal file
@ -0,0 +1,5 @@
|
||||
<!-- <app-game-button *ngFor="let item of games" (click)="removePlayerZero(item)"> -->
|
||||
<app-game-button *ngFor="let item of games">
|
||||
name: {{item.name}}
|
||||
<div *ngFor="let player of item.icon">{{player}}</div>
|
||||
</app-game-button>
|
0
src/app/games-bar/games-bar.component.scss
Normal file
0
src/app/games-bar/games-bar.component.scss
Normal file
23
src/app/games-bar/games-bar.component.spec.ts
Normal file
23
src/app/games-bar/games-bar.component.spec.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { GamesBarComponent } from './games-bar.component';
|
||||
|
||||
describe('GamesBarComponent', () => {
|
||||
let component: GamesBarComponent;
|
||||
let fixture: ComponentFixture<GamesBarComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ GamesBarComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(GamesBarComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
39
src/app/games-bar/games-bar.component.ts
Normal file
39
src/app/games-bar/games-bar.component.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { LauncherService } from '../services/launcher.service';
|
||||
import { Game } from '../services/oxana.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-games-bar',
|
||||
templateUrl: './games-bar.component.html',
|
||||
styleUrls: ['./games-bar.component.scss']
|
||||
})
|
||||
|
||||
export class GamesBarComponent implements OnInit {
|
||||
constructor(private launcher: LauncherService) { }
|
||||
|
||||
games!: Game[]
|
||||
// games: Game[] = [{
|
||||
// name: 'str',
|
||||
// players: ['1', '2']
|
||||
// },
|
||||
// {
|
||||
// name: 'qwe',
|
||||
// players: ['6', '4']
|
||||
// }]
|
||||
|
||||
|
||||
ngOnInit(): void {
|
||||
// let i = 0
|
||||
// setInterval(() => {
|
||||
// this.games.push({name: `name-${++i}`, players: []})
|
||||
// }, 100)
|
||||
this.games = this.launcher.GetGames()
|
||||
console.log("asdasd")
|
||||
console.log(this.games)
|
||||
}
|
||||
|
||||
// removePlayerZero (item: Game) {
|
||||
// if (item.players.length == 0) return
|
||||
// item.players.splice(0, 1)
|
||||
// }
|
||||
}
|
16
src/app/services/launcher.service.spec.ts
Normal file
16
src/app/services/launcher.service.spec.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LauncherService } from './launcher.service';
|
||||
|
||||
describe('LauncherService', () => {
|
||||
let service: LauncherService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(LauncherService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
19
src/app/services/launcher.service.ts
Normal file
19
src/app/services/launcher.service.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Game } from './oxana.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LauncherService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
public GetGames(): Game[]{
|
||||
var currentGames :Game[] = [
|
||||
{ name: "ad", icon: "string", id: "string"},
|
||||
{ name: "qwet", icon: "string", id: "string"},
|
||||
{ name: "1233", icon: "string", id: "string"},
|
||||
{ name: "ghjghj", icon: "string", id: "string"}
|
||||
]
|
||||
return currentGames
|
||||
}
|
||||
}
|
16
src/app/services/oxana.service.spec.ts
Normal file
16
src/app/services/oxana.service.spec.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { OxanaService } from './oxana.service';
|
||||
|
||||
describe('OxanaService', () => {
|
||||
let service: OxanaService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(OxanaService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
23
src/app/services/oxana.service.ts
Normal file
23
src/app/services/oxana.service.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { LauncherService } from './launcher.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
|
||||
|
||||
export class OxanaService {
|
||||
private games!: Game
|
||||
constructor(private launcher: LauncherService) { }
|
||||
|
||||
// public getGames():Game{
|
||||
// currentGames = launcher.GetGames()
|
||||
// return currentGames
|
||||
// }
|
||||
}
|
||||
|
||||
export interface Game {
|
||||
name: string
|
||||
icon: string
|
||||
id: string
|
||||
}
|
Loading…
Reference in New Issue
Block a user