From 1469f2e509ad872646ed2026d005a57fd8319f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 11 May 2024 11:05:00 +0200 Subject: [PATCH] Delete SlotCharacteristics from InventorySlot --- .../inventory-slot-characteristic-editor.component.html | 2 +- .../inventory-slot-characteristic-editor.component.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/editor/character-editor/inventory-slot-editor/inventory-slot-characteristic-editor/inventory-slot-characteristic-editor.component.html b/src/app/editor/character-editor/inventory-slot-editor/inventory-slot-characteristic-editor/inventory-slot-characteristic-editor.component.html index b5d3f27..9a6486d 100644 --- a/src/app/editor/character-editor/inventory-slot-editor/inventory-slot-characteristic-editor/inventory-slot-characteristic-editor.component.html +++ b/src/app/editor/character-editor/inventory-slot-editor/inventory-slot-characteristic-editor/inventory-slot-characteristic-editor.component.html @@ -36,7 +36,7 @@ - + diff --git a/src/app/editor/character-editor/inventory-slot-editor/inventory-slot-characteristic-editor/inventory-slot-characteristic-editor.component.ts b/src/app/editor/character-editor/inventory-slot-editor/inventory-slot-characteristic-editor/inventory-slot-characteristic-editor.component.ts index ce6640e..d0d3c1a 100644 --- a/src/app/editor/character-editor/inventory-slot-editor/inventory-slot-characteristic-editor/inventory-slot-characteristic-editor.component.ts +++ b/src/app/editor/character-editor/inventory-slot-editor/inventory-slot-characteristic-editor/inventory-slot-characteristic-editor.component.ts @@ -60,4 +60,9 @@ export class InventorySlotCharacteristicEditorComponent implements OnInit{ editSlotCharacteristic(slotCharacteristic: InventoryCharacteristic) { this.editedCharacteristic = slotCharacteristic; } + + deleteSlotCharacteristic(slotCharacteristic: InventoryCharacteristic) { + this.inventorySlot!.slotCharacteristics = this.inventorySlot!.slotCharacteristics.filter(characteristic => characteristic !== slotCharacteristic); + this.datasource.data = this.inventorySlot!.slotCharacteristics; + } }