inventory-slots #49

Merged
sebastian merged 13 commits from inventory-slots into main 2024-05-11 15:36:10 +02:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit 1469f2e509 - Show all commits

View File

@ -36,7 +36,7 @@
<button mat-icon-button (click)="addInventorySlotCharacteristic()"><mat-icon>add</mat-icon></button>
</th>
<td mat-cell *matCellDef="let slotCharacteristic">
<button mat-icon-button color="warn"><mat-icon>delete</mat-icon></button>
<button mat-icon-button color="warn" (click)="deleteSlotCharacteristic(slotCharacteristic)"><mat-icon>delete</mat-icon></button>
</td>
</ng-container>

View File

@ -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;
}
}