Assign ScriptAccountActions to expanded ineraction
All checks were successful
E2E Testing / test (push) Successful in 1m17s

This commit is contained in:
Sebastian Boeckelmann 2024-06-15 14:17:08 +02:00
parent fe63b30115
commit bc0617eb85
3 changed files with 20 additions and 3 deletions

View File

@ -123,13 +123,16 @@
</mat-expansion-panel-header> </mat-expansion-panel-header>
<mat-tab-group> <mat-tab-group>
<mat-tab label="ScriptAccount Actions"> <mat-tab label="ScriptAccount Actions">
<app-scriptaccount-action-editor [scriptAccounts]="gameModel!.scriptAccounts" [actions]="element.scriptAccountActions" <app-scriptaccount-action-editor [scriptAccounts]="gameModel!.scriptAccounts" [actions]="getInterActionAsSolidInteraction(element)!.scriptAccountActions"
(onAddAction)="onAddAction(element, $event)" (onRemoveAction)="onRemoveAction(element, $event)" (onAddAction)="onAddAction(element, $event)" (onRemoveAction)="onRemoveAction(element, $event)"
[enableEditing]="true" [enableEditing]="true"
></app-scriptaccount-action-editor> ></app-scriptaccount-action-editor>
</mat-tab> </mat-tab>
<mat-tab label="Inventory Actions"> <mat-tab label="Inventory Itemgroup Actions">
<p>Inventory Actions</p>
</mat-tab>
<mat-tab label="Inventory Item Actions">
</mat-tab> </mat-tab>
<mat-tab label="Gamesystem Actions"> <mat-tab label="Gamesystem Actions">
<p>Gamesystem Actions</p> <p>Gamesystem Actions</p>

View File

@ -47,6 +47,13 @@ export class CharacterInteractionEditorComponent implements OnInit{
return interaction instanceof InteractionSequences return interaction instanceof InteractionSequences
} }
getInterActionAsSolidInteraction(interaction: AbstractInteraction) {
if(interaction instanceof Interaction) {
return interaction as Interaction;
}
return undefined;
}
addInteraction() { addInteraction() {
const interaction = new Interaction(this.character!, undefined, "") const interaction = new Interaction(this.character!, undefined, "")
this.editedElement = interaction; this.editedElement = interaction;

View File

@ -2,6 +2,9 @@ import {Character} from "../characters/Character";
import {Condition} from "./condition/Condition"; import {Condition} from "./condition/Condition";
import {Action} from "./actions/Action"; import {Action} from "./actions/Action";
import {AbstractInteraction} from "./AbstractInteraction"; import {AbstractInteraction} from "./AbstractInteraction";
import {ScriptAccountCondition} from "../gamesystems/conditions/ScriptAccountCondition";
import {ScriptAccountAction} from "../gamesystems/actions/ScriptAccountAction";
import {InventoryCondition} from "./condition/InventoryCondition";
export class Interaction extends AbstractInteraction{ export class Interaction extends AbstractInteraction{
@ -34,6 +37,10 @@ export class Interaction extends AbstractInteraction{
return validCharacters && validLabel; return validCharacters && validLabel;
} }
get scriptAccountActions() : ScriptAccountAction[]{
return this.actions.filter(condition => condition instanceof ScriptAccountAction).map(condition => condition as ScriptAccountAction)
}
addAction(action: Action) { addAction(action: Action) {
this.actions.push(action); this.actions.push(action);