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 } }