From 0c328e1fd6b6af4f39ae998638b5f09a5dacc1a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 10 Feb 2024 10:17:21 +0100 Subject: [PATCH] Open Editor to edit Gamesystems --- src/app/app.component.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 43021e3..252e363 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -70,10 +70,18 @@ export class AppComponent implements OnInit{ } private onEditModelComponent() { - if(this.openContent == ModelComponentType.SCRIPTACCOUNT && this.scriptAccountOverview != undefined && this.scriptAccountOverview.selectedScriptAccount != undefined) { - this.editor!.openGameModelComponent(this.scriptAccountOverview.selectedScriptAccount!); - } else { - //Erweitere to Gamesystems + switch (this.openContent!) { + case ModelComponentType.SCRIPTACCOUNT: { + if(this.scriptAccountOverview!.selectedScriptAccount != undefined) { + this.editor!.openGameModelComponent(this.scriptAccountOverview!.selectedScriptAccount); + } + } break; + case ModelComponentType.GAMESYTEM: { + if(this.gamesystemOverview!.selectedGamesystem != undefined) { + const gamesystem = this.gameModel!.findGamesystem(this.gamesystemOverview!.selectedGamesystemName!); + this.editor!.openGameModelComponent(gamesystem!); + } + } break } }