From 38a11ad6289ce556889f862fba481a57f56577c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Fri, 22 Mar 2024 19:48:59 +0100 Subject: [PATCH] Remove character senstive transition --- .../template-transition-editor.component.html | 8 -------- .../template-transition-editor.component.ts | 19 +++++++------------ 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.html b/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.html index e984077..3f83ab5 100644 --- a/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.html +++ b/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.html @@ -41,14 +41,6 @@ - - - - - - - - diff --git a/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.ts b/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.ts index 7655553..d075eb3 100644 --- a/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.ts +++ b/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.ts @@ -24,7 +24,7 @@ export class TemplateTransitionEditorComponent { @Input() templateGamesystem: TemplateGamesystem | undefined @Input() scriptAccounts: ScriptAccount[] = [] - displayedColumns: string[] = ["starting-state", "ending-state", "edit", "delete"]; + displayedColumns: string[] = ["starting-state", "ending-state", "delete"]; dataSource = new MatTableDataSource(); columnsToDisplayWithExpand = [...this.displayedColumns, 'expand']; expandedElement: SimpleTransition | null = null; @@ -44,23 +44,18 @@ export class TemplateTransitionEditorComponent { } onCreateCondition(transition: SimpleTransition, condition: ScriptAccountCondition) { - + transition.addScriptAccountCondition(condition); } deleteCondition(transition: SimpleTransition, condition: ScriptAccountCondition) { - + transition.removeScriptAccountCondition(condition.scriptAccount); } deleteTransition(transition: SimpleTransition) { - - } - - onEditTransition(transition: SimpleTransition) { - if(this.editedTransition == undefined) { - this.editedTransition = transition - } else { - this.editedTransition = undefined - } + this.templateGamesystem!.templateTransitions = this.templateGamesystem!.templateTransitions.filter(templateTranstion => + templateTranstion.startingState.stateLabel !== transition.startingState.stateLabel && + templateTranstion.endingState.stateLabel !== transition.endingState.stateLabel); + this.dataSource.data = this.templateGamesystem!.templateTransitions } extractReferencedTransition(transition: SimpleTransition) {