issue-5-product-gamesystems #10

Merged
sebastian merged 31 commits from issue-5-product-gamesystems into main 2024-02-16 18:00:29 +01:00
2 changed files with 3 additions and 1 deletions
Showing only changes of commit 8f45063d4f - Show all commits

View File

@ -1,4 +1,4 @@
<mat-tab-group> <mat-tab-group [(selectedIndex)]="activeTab">
<mat-tab *ngFor="let modelComponent of gameModelComponents"> <mat-tab *ngFor="let modelComponent of gameModelComponents">
<ng-template mat-tab-label> <ng-template mat-tab-label>
<mat-icon class="example-tab-icon unsaved" *ngIf="modelComponent.type === ModelComponentType.SCRIPTACCOUNT" [ngClass]="modelComponent.unsaved? 'unsaved':'saved'">inventory_2</mat-icon> <mat-icon class="example-tab-icon unsaved" *ngIf="modelComponent.type === ModelComponentType.SCRIPTACCOUNT" [ngClass]="modelComponent.unsaved? 'unsaved':'saved'">inventory_2</mat-icon>

View File

@ -15,10 +15,12 @@ import {Transition} from "../game-model/gamesystems/Transition";
export class EditorComponent { export class EditorComponent {
gameModelComponents: ModelComponent[] = []; gameModelComponents: ModelComponent[] = [];
@Output("onModelNameUpdate") onModelNameUpdateEmitter = new EventEmitter<boolean>(); @Output("onModelNameUpdate") onModelNameUpdateEmitter = new EventEmitter<boolean>();
activeTab: number = this.gameModelComponents.length;
openGameModelComponent(gameModelComponent: ModelComponent) { openGameModelComponent(gameModelComponent: ModelComponent) {
if(!this.gameModelComponents.includes(gameModelComponent)) { if(!this.gameModelComponents.includes(gameModelComponent)) {
this.gameModelComponents.push(gameModelComponent); this.gameModelComponents.push(gameModelComponent);
this.activeTab = this.gameModelComponents.length;
} }
} }