inventory-slots #49

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

View File

@ -12,6 +12,19 @@
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="combinable">
<th mat-header-cell *matHeaderCellDef>Combinable</th>
<td mat-cell *matCellDef="let slot">
<span *ngIf="slot != editedSlot">
<mat-icon *ngIf="slot.combinable">done</mat-icon>
<mat-icon *ngIf="!slot.combinable">close</mat-icon>
</span>
<span *ngIf="slot == editedSlot">
<mat-checkbox [(ngModel)]="slot.combinable"></mat-checkbox>
</span>
</td>
</ng-container>
<ng-container matColumnDef="edit"> <ng-container matColumnDef="edit">
<th mat-header-cell *matHeaderCellDef></th> <th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let slot"> <td mat-cell *matCellDef="let slot">

View File

@ -22,7 +22,7 @@ export class InventorySlotEditorComponent implements OnInit{
@Input() character: Character | undefined @Input() character: Character | undefined
@Input() itemgroups: ItemGroup[] = [] @Input() itemgroups: ItemGroup[] = []
displayedColumns: string[] = ['name', 'edit', 'delete'] displayedColumns: string[] = ['name','combinable', 'edit', 'delete']
columnsToDisplayWithExpand = [...this.displayedColumns, 'expand']; columnsToDisplayWithExpand = [...this.displayedColumns, 'expand'];
dataSource: MatTableDataSource<InventorySlot> = new MatTableDataSource<InventorySlot>(); dataSource: MatTableDataSource<InventorySlot> = new MatTableDataSource<InventorySlot>();

View File

@ -7,6 +7,7 @@ export class InventorySlot {
slotName: string slotName: string
slotCharacteristics: InventoryCharacteristic[] = [] slotCharacteristics: InventoryCharacteristic[] = []
requiredInheritances: ItemGroup[] = [] //if empty: non reqierements requiredInheritances: ItemGroup[] = [] //if empty: non reqierements
combinable: boolean = false;
constructor(slotName: string) { constructor(slotName: string) {

View File

@ -30,6 +30,8 @@ export class InventorySlotParser {
const inventorySlot = new InventorySlot(slotName); const inventorySlot = new InventorySlot(slotName);
inventorySlot.slotCharacteristics = slotCharacteristics; inventorySlot.slotCharacteristics = slotCharacteristics;
inventorySlot.requiredInheritances = inheritedGroups; inventorySlot.requiredInheritances = inheritedGroups;
inventorySlot.combinable = inventorySlotData.combinable;
return inventorySlot; return inventorySlot;
} }

View File

@ -16,7 +16,8 @@ export class InventorySlotSerializer {
}), }),
requiredInheritances: inventorySlot.requiredInheritances.map(itemgroup => { requiredInheritances: inventorySlot.requiredInheritances.map(itemgroup => {
return itemgroup.componentName return itemgroup.componentName
}) }),
combinable: inventorySlot.combinable
} }
}) })
} }

View File

@ -69,7 +69,7 @@
], ],
"inventorySlots": [ "inventorySlots": [
{ {
"slotName": "New Inventory Slot", "slotName": "Linke Hand",
"slotCharacteristics": [ "slotCharacteristics": [
{ {
"increasingCharacteristic": "Test0", "increasingCharacteristic": "Test0",
@ -78,7 +78,14 @@
], ],
"requiredInheritances": [ "requiredInheritances": [
"Clothing" "Clothing"
] ],
"combinable": true
},
{
"slotName": "Rechte Hand",
"slotCharacteristics": [],
"requiredInheritances": [],
"combinable": true
} }
], ],
"combinableInventorySlots": [] "combinableInventorySlots": []