From 8f45063d4f1921c70ee116c6660045b4281ae930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Mon, 12 Feb 2024 18:34:23 +0100 Subject: [PATCH] Change displayed tab when a new one is opened --- src/app/editor/editor.component.html | 2 +- src/app/editor/editor.component.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/editor/editor.component.html b/src/app/editor/editor.component.html index 688e3bf..59dcd6f 100644 --- a/src/app/editor/editor.component.html +++ b/src/app/editor/editor.component.html @@ -1,4 +1,4 @@ - + inventory_2 diff --git a/src/app/editor/editor.component.ts b/src/app/editor/editor.component.ts index c042346..480330d 100644 --- a/src/app/editor/editor.component.ts +++ b/src/app/editor/editor.component.ts @@ -15,10 +15,12 @@ import {Transition} from "../game-model/gamesystems/Transition"; export class EditorComponent { gameModelComponents: ModelComponent[] = []; @Output("onModelNameUpdate") onModelNameUpdateEmitter = new EventEmitter(); + activeTab: number = this.gameModelComponents.length; openGameModelComponent(gameModelComponent: ModelComponent) { if(!this.gameModelComponents.includes(gameModelComponent)) { this.gameModelComponents.push(gameModelComponent); + this.activeTab = this.gameModelComponents.length; } }