main #48

Closed
sebastian wants to merge 44 commits from main into inventory
2 changed files with 9 additions and 1 deletions
Showing only changes of commit ae640a7a31 - Show all commits

View File

@ -27,7 +27,7 @@
</td>
</ng-container>
<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>
</ng-container>

View File

@ -3,6 +3,7 @@ import {ItemGroup} from "../../../project/game-model/inventory/ItemGroup";
import {MatColumnDef, MatTable, MatTableDataSource} from "@angular/material/table";
import {ItemQuality} from "../../../project/game-model/inventory/ItemQuality";
import {ItemGroupCharacteristic} from "../../../project/game-model/inventory/ItemgroupCharacteristic";
import {Item} from "../../../project/game-model/inventory/Item";
@Component({
selector: 'app-item-group-editor',
@ -36,4 +37,11 @@ export class ItemGroupEditorComponent implements OnInit{
finishEditing() {
this.editedCharacteristic = undefined;
}
addItemgroupCharacteristic() {
const itemgroupCharacteristic = new ItemGroupCharacteristic("", "");
this.itemgroup!.itemGroupCharacteristics.push(itemgroupCharacteristic);
this.itemQualityDatasource.data = this.itemgroup!.itemGroupCharacteristics;
this.editedCharacteristic = itemgroupCharacteristic;
}
}