CharacterSpecific Templatesystems #36

Merged
sebastian merged 31 commits from template-systems into main 2024-04-14 13:45:04 +02:00
3 changed files with 34 additions and 2 deletions
Showing only changes of commit 5a2282ddd3 - Show all commits

View File

@ -1 +1,14 @@
<p>template-specificator works!</p>
<h1 mat-dialog-title>Specify Templatesystem</h1>
<div mat-dialog-content>
<p>This will not affect the properties of the Templatesystem itself!</p>
<mat-form-field appearance="outline" class="long-form">
<mat-label>Select Templatesystem</mat-label>
<mat-select [formControl]="templateCtrl">
<mat-option *ngFor="let templateSystem of templateSystems" [value]="templateSystem">{{templateSystem.componentName}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div mat-dialog-actions align="end">
<button mat-stroked-button (click)="cancelSpecification()">Cancel</button>
<button mat-raised-button color="accent" [disabled]="templateCtrl.invalid" (click)="confirmSpecification()">Confirm</button>
</div>

View File

@ -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<TemplateSpecificatorComponent>,
@Inject(MAT_DIALOG_DATA) public templateSystems: Gamesystem<any, any>[] = []) {
}
cancelSpecification() {
this.dialogRef.close()
}
confirmSpecification() {
this.dialogRef.close(this.templateCtrl.value)
}
}