Implement basic version of characters #32
@ -27,7 +27,7 @@
|
||||
</div>
|
||||
<app-script-account-overview *ngIf="openContent == ModelComponentType.SCRIPTACCOUNT" #scriptAccountOverview [gameModel]="gameModel" (onOpenScriptAccount)="openModelComponent($event)"></app-script-account-overview>
|
||||
<app-gamescript-overview *ngIf="openContent == ModelComponentType.GAMESYTEM" #gamesystemOverview [gameModel]="gameModel" (openGamesystemEditor)="openModelComponent($event)"></app-gamescript-overview>
|
||||
<app-character-overview *ngIf="openContent == ModelComponentType.CHARACTER" #characterOverview [gameModel]="gameModel"></app-character-overview>
|
||||
<app-character-overview *ngIf="openContent == ModelComponentType.CHARACTER" #characterOverview [gameModel]="gameModel" (onOpenCharacterEditor)="openModelComponent($event)"></app-character-overview>
|
||||
</mat-drawer>
|
||||
|
||||
<div class="example-sidenav-content">
|
||||
|
@ -69,6 +69,7 @@ import {
|
||||
ScriptaccountConditionEditorComponent
|
||||
} from "./editor/gamesystem-editor/scriptaccount-condition-editor/scriptaccount-condition-editor.component";
|
||||
import {CharacterOverviewComponent} from "./side-overviews/character-overview/character-overview.component";
|
||||
import {CharacterEditorComponent} from "./editor/character-editor/character-editor.component";
|
||||
|
||||
// AoT requires an exported function for factories
|
||||
const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
||||
@ -90,7 +91,9 @@ const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new Transl
|
||||
ProductStateEditorComponent,
|
||||
ProductGamesystemEditorComponent,
|
||||
ScriptaccountActionEditorComponent,
|
||||
ScriptaccountConditionEditorComponent
|
||||
ScriptaccountConditionEditorComponent,
|
||||
CharacterOverviewComponent,
|
||||
CharacterEditorComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
@ -147,8 +150,7 @@ const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new Transl
|
||||
MatHint,
|
||||
MatTooltip,
|
||||
MatCard,
|
||||
MatCardContent,
|
||||
CharacterOverviewComponent
|
||||
MatCardContent
|
||||
],
|
||||
providers: [],
|
||||
bootstrap: [AppComponent]
|
||||
|
@ -0,0 +1 @@
|
||||
<p>character-editor works!</p>
|
@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CharacterEditorComponent } from './character-editor.component';
|
||||
|
||||
describe('CharacterEditorComponent', () => {
|
||||
let component: CharacterEditorComponent;
|
||||
let fixture: ComponentFixture<CharacterEditorComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CharacterEditorComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(CharacterEditorComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-character-editor',
|
||||
templateUrl: './character-editor.component.html',
|
||||
styleUrl: './character-editor.component.scss'
|
||||
})
|
||||
export class CharacterEditorComponent {
|
||||
|
||||
}
|
@ -14,6 +14,8 @@
|
||||
[gamesystem]="convertModelComponentToGamesystem(modelComponent)"
|
||||
(onOpenGamesystemEditor)="openGameModelComponent($event)"
|
||||
[scriptAccounts]="gameModel!.scriptAccounts"></app-gamesystem-editor>
|
||||
<app-character-editor *ngIf="modelComponent.type === ModelComponentType.CHARACTER">
|
||||
|
||||
</app-character-editor>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
|
@ -1,5 +1,8 @@
|
||||
<mat-action-list>
|
||||
<mat-list-item class="scriptAccount-item" *ngFor="let character of gameModel!.characters">
|
||||
<mat-list-item class="scriptAccount-item" *ngFor="let character of gameModel!.characters"
|
||||
(dblclick)="onOpenCharacter(character)" (click)="selectCharacter(character)"
|
||||
[ngClass]="selectedCharacter === character ?'selected-item':''"
|
||||
(contextmenu)="selectCharacter(character)">
|
||||
<mat-icon class="scriptAccount-icon">person</mat-icon>{{character.componentName}}
|
||||
</mat-list-item>
|
||||
</mat-action-list>
|
||||
|
@ -1,22 +1,28 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||
import {GameModel} from "../../project/game-model/GameModel";
|
||||
import {MatActionList, MatListItem} from "@angular/material/list";
|
||||
import {MatIcon} from "@angular/material/icon";
|
||||
import {NgForOf} from "@angular/common";
|
||||
import {NgClass, NgForOf} from "@angular/common";
|
||||
import {ScriptAccount} from "../../project/game-model/scriptAccounts/ScriptAccount";
|
||||
import {Character} from "../../project/game-model/characters/Character";
|
||||
|
||||
@Component({
|
||||
selector: 'app-character-overview',
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatActionList,
|
||||
MatIcon,
|
||||
MatListItem,
|
||||
NgForOf
|
||||
],
|
||||
templateUrl: './character-overview.component.html',
|
||||
styleUrl: './character-overview.component.scss'
|
||||
})
|
||||
export class CharacterOverviewComponent {
|
||||
|
||||
@Input() gameModel: GameModel | undefined
|
||||
@Output("onOpenCharacterEditor") openCharacterEmitter: EventEmitter<Character> = new EventEmitter<Character>();
|
||||
|
||||
selectedCharacter: Character | undefined
|
||||
|
||||
onOpenCharacter(character: Character) {
|
||||
this.openCharacterEmitter.emit(character);
|
||||
}
|
||||
|
||||
selectCharacter(character: Character) {
|
||||
this.selectedCharacter = character;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user