From 5a2282ddd31f1f31433605ef0bc1685b4f3af809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sun, 14 Apr 2024 07:57:50 +0200 Subject: [PATCH] Specify Templatesystem --- .../template-specificator.component.html | 15 ++++++++++++++- .../template-specificator.component.scss | 3 +++ .../template-specificator.component.ts | 18 +++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.html b/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.html index 75f749d..be2c11a 100644 --- a/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.html +++ b/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.html @@ -1 +1,14 @@ -

template-specificator works!

+

Specify Templatesystem

+
+

This will not affect the properties of the Templatesystem itself!

+ + Select Templatesystem + + {{templateSystem.componentName}} + + +
+
+ + +
diff --git a/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.scss b/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.scss index e69de29..4e80027 100644 --- a/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.scss +++ b/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.scss @@ -0,0 +1,3 @@ +.long-form { + width: 100%; +} diff --git a/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.ts b/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.ts index df10080..bd85e38 100644 --- a/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.ts +++ b/src/app/editor/gamesystem-editor/template-specificator/template-specificator.component.ts @@ -1,4 +1,7 @@ -import { Component } from '@angular/core'; +import {Component, Inject} from '@angular/core'; +import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; +import {Gamesystem} from "../../../project/game-model/gamesystems/Gamesystem"; +import {FormControl, Validators} from "@angular/forms"; @Component({ selector: 'app-template-specificator', @@ -7,4 +10,17 @@ import { Component } from '@angular/core'; }) export class TemplateSpecificatorComponent { + templateCtrl: FormControl = new FormControl('', [Validators.required]) + + constructor(private dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public templateSystems: Gamesystem[] = []) { + } + + cancelSpecification() { + this.dialogRef.close() + } + + confirmSpecification() { + this.dialogRef.close(this.templateCtrl.value) + } }