inventory-items-2 #44
@ -27,7 +27,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container matColumnDef="delete">
|
<ng-container matColumnDef="delete">
|
||||||
<th mat-header-cell *matHeaderCellDef> <button mat-icon-button><mat-icon>add</mat-icon></button> </th>
|
<th mat-header-cell *matHeaderCellDef> <button mat-icon-button (click)="addItemgroupCharacteristic()"><mat-icon>add</mat-icon></button> </th>
|
||||||
<td mat-cell *matCellDef="let element"><button mat-icon-button color="warn" (click)="deleteItemgroupCharacteristic(element)"><mat-icon>delete</mat-icon></button></td>
|
<td mat-cell *matCellDef="let element"><button mat-icon-button color="warn" (click)="deleteItemgroupCharacteristic(element)"><mat-icon>delete</mat-icon></button></td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import {ItemGroup} from "../../../project/game-model/inventory/ItemGroup";
|
|||||||
import {MatColumnDef, MatTable, MatTableDataSource} from "@angular/material/table";
|
import {MatColumnDef, MatTable, MatTableDataSource} from "@angular/material/table";
|
||||||
import {ItemQuality} from "../../../project/game-model/inventory/ItemQuality";
|
import {ItemQuality} from "../../../project/game-model/inventory/ItemQuality";
|
||||||
import {ItemGroupCharacteristic} from "../../../project/game-model/inventory/ItemgroupCharacteristic";
|
import {ItemGroupCharacteristic} from "../../../project/game-model/inventory/ItemgroupCharacteristic";
|
||||||
|
import {Item} from "../../../project/game-model/inventory/Item";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-item-group-editor',
|
selector: 'app-item-group-editor',
|
||||||
@ -36,4 +37,11 @@ export class ItemGroupEditorComponent implements OnInit{
|
|||||||
finishEditing() {
|
finishEditing() {
|
||||||
this.editedCharacteristic = undefined;
|
this.editedCharacteristic = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addItemgroupCharacteristic() {
|
||||||
|
const itemgroupCharacteristic = new ItemGroupCharacteristic("", "");
|
||||||
|
this.itemgroup!.itemGroupCharacteristics.push(itemgroupCharacteristic);
|
||||||
|
this.itemQualityDatasource.data = this.itemgroup!.itemGroupCharacteristics;
|
||||||
|
this.editedCharacteristic = itemgroupCharacteristic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user