inventory-slots #49
@ -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">
|
||||||
|
@ -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>();
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -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": []
|
||||||
|
Loading…
Reference in New Issue
Block a user