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-tab-group>
<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)"
[enableEditing]="true"
></app-scriptaccount-action-editor>
</mat-tab>
<mat-tab label="Inventory Actions">
<p>Inventory Actions</p>
<mat-tab label="Inventory Itemgroup Actions">
</mat-tab>
<mat-tab label="Inventory Item Actions">
</mat-tab>
<mat-tab label="Gamesystem Actions">
<p>Gamesystem Actions</p>

View File

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

View File

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