diff --git a/pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-apps.component.ts b/pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-apps.component.ts index 8f50bdd..49c8da9 100644 --- a/pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-apps.component.ts +++ b/pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-apps.component.ts @@ -5,11 +5,13 @@ import {IframeAppComponent} from "../../apps/iframe-app.component"; import {AbsListSelect} from "../AbsListSelect"; import {IOService} from "../../../services/IOService"; import {Subscription} from "rxjs"; +import {AbsApp} from "../../apps/AbsApp"; +import { ComponentType } from "@angular/cdk/portal"; export interface InvApp { name: string; action: Function; - icon:string, + icon: string, matIcon: boolean, about: string } @@ -17,21 +19,22 @@ export interface InvApp { @Component({ selector: "app-inventory-apps-component", template: ` -
-
-
-

{{el.name}}

+
+
+
+

{{el.name}}

+
-
-
-
- {{selected.icon}} -
-
-

{{selected.about}}

+
+
+ {{selected.icon}} +
+
+

{{selected.about}}

+
-
` }) export class InventoryAppsComponent extends AbsListSelect { @@ -50,17 +53,19 @@ export class InventoryAppsComponent extends AbsListSelect { this.createSub() } + openApp(app: any, data: any = {}) { + this.ngOnDestroy(); + const ref = this.dialog.open(app, {width: '100%', height: '100%', disableClose: true, data: data}); + ref.afterClosed().subscribe(() => this.createSub()); + } + override elements: InvApp[] = [ {name: "Clock", action: () => { - this.ngOnDestroy(); - const ref = this.dialog.open(ClockDialogApp, {width: '100%', height: '100%', disableClose: true}); - ref.afterClosed().subscribe(() => this.createSub()); + this.openApp(ClockDialogApp); }, matIcon: true, icon: "access_time", about: "Забытые часы самого тодда говарда. Он забыл их в своей прекрастной игре каллаут76."}, {name: "1", action: () => {}, matIcon: true, icon:"help", about: "Кусок кала"}, {name: "Rick Roll", action: () => { - this.ngOnDestroy(); - const ref = this.dialog.open(IframeAppComponent, {width: '100%', height: '100%', disableClose: true, data: {url:"https://youtu.be/dQw4w9WgXcQ?output=embed"}}) - ref.afterClosed().subscribe(() => this.createSub()); + this.openApp(IframeAppComponent, {url:"https://youtu.be/dQw4w9WgXcQ?output=embed"}) }, matIcon: true, icon: "record_voice_over", about: "Нет ничего лучше старого рикролла"} ] override selected: InvApp = this.elements[0]; diff --git a/pipboyUI/src/assets/ToddHoward.jpg b/pipboyUI/src/assets/ToddHoward.jpg new file mode 100644 index 0000000..9cbf4a6 Binary files /dev/null and b/pipboyUI/src/assets/ToddHoward.jpg differ