diff --git a/src/app/app.component.html b/src/app/app.component.html index dee2fce..85d1f15 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -27,7 +27,7 @@
- +
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7d1f22e..3cbfe90 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -116,6 +116,11 @@ export class AppComponent implements OnInit{ } else { console.log("[WARN] [App.Component] Editor is undefined") } + } + onModelNameUpdate() { + if(this.openContent == ModelComponentType.GAMESYTEM) { + this.gamesystemOverview!.onUpdateModelName(); + } } } diff --git a/src/app/editor/editor.component.html b/src/app/editor/editor.component.html index ef4276b..dc9bd38 100644 --- a/src/app/editor/editor.component.html +++ b/src/app/editor/editor.component.html @@ -5,7 +5,7 @@ {{modelComponent.componentName}} - + diff --git a/src/app/editor/editor.component.ts b/src/app/editor/editor.component.ts index 6b222fe..36b6726 100644 --- a/src/app/editor/editor.component.ts +++ b/src/app/editor/editor.component.ts @@ -1,4 +1,4 @@ -import {Component, Input} from '@angular/core'; +import {Component, EventEmitter, Input, Output} from '@angular/core'; import {GameModel} from "../game-model/GameModel"; import {ModelComponent} from "../game-model/ModelComponent"; import {ModelComponentType} from "../game-model/ModelComponentType"; @@ -11,6 +11,7 @@ import {ScriptAccount} from "../game-model/scriptAccounts/ScriptAccount"; }) export class EditorComponent { gameModelComponents: ModelComponent[] = []; + @Output("onModelNameUpdate") onModelNameUpdateEmitter = new EventEmitter(); openGameModelComponent(gameModelComponent: ModelComponent) { if(!this.gameModelComponents.includes(gameModelComponent)) { @@ -29,4 +30,8 @@ export class EditorComponent { } protected readonly ModelComponentType = ModelComponentType; + + onModelNameUpdate() { + this.onModelNameUpdateEmitter.emit(true); + } } diff --git a/src/app/editor/model-component-editor/model-component-editor.component.ts b/src/app/editor/model-component-editor/model-component-editor.component.ts index c3a4e67..c527bb5 100644 --- a/src/app/editor/model-component-editor/model-component-editor.component.ts +++ b/src/app/editor/model-component-editor/model-component-editor.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, OnInit} from '@angular/core'; +import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import {ModelComponent} from "../../game-model/ModelComponent"; import {FormControl, Validators} from "@angular/forms"; @@ -9,6 +9,7 @@ import {FormControl, Validators} from "@angular/forms"; }) export class ModelComponentEditorComponent implements OnInit{ @Input('modelComponent') modelComponent: ModelComponent | undefined + @Output("onModelNameUpdated") onModelNameUpdateEmitter = new EventEmitter(); nameCtrl: FormControl = new FormControl('', [Validators.required]); descriptionCtrl: FormControl = new FormControl('' ); @@ -21,6 +22,7 @@ export class ModelComponentEditorComponent implements OnInit{ onUpdateName() { this.modelComponent!.componentName = this.nameCtrl.value; this.modelComponent!.onModifyContent(); + this.onModelNameUpdateEmitter.emit(true); } onUpdateDescription() { diff --git a/src/app/side-overviews/gamescript-overview/gamescript-overview.component.ts b/src/app/side-overviews/gamescript-overview/gamescript-overview.component.ts index 892bcde..87129b9 100644 --- a/src/app/side-overviews/gamescript-overview/gamescript-overview.component.ts +++ b/src/app/side-overviews/gamescript-overview/gamescript-overview.component.ts @@ -91,4 +91,8 @@ export class GamescriptOverviewComponent implements OnInit { this.openGamesystemEmitter.emit(gamesystem); } } + + onUpdateModelName() { + this.dataSource.data = this.gameModel!.gamesystems; + } }