inventory-slots #49
@ -6,6 +6,7 @@ import {MatTable, MatTableDataSource} from "@angular/material/table";
|
||||
import {
|
||||
InventoryCharacteristic
|
||||
} from "../../../../project/game-model/inventory/intentory-slots/InventoryCharacteristic";
|
||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||
|
||||
@Component({
|
||||
selector: 'app-inventory-slot-characteristic-editor',
|
||||
@ -23,6 +24,9 @@ export class InventorySlotCharacteristicEditorComponent implements OnInit{
|
||||
displayedColumns: string[] = ['increasing', 'decreasing', 'edit', 'delete']
|
||||
editedCharacteristic: InventoryCharacteristic | null = null;
|
||||
|
||||
constructor(private snackbar: MatSnackBar) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.itemgroups.forEach(itemgroup => {
|
||||
this.availableCharacteristics = this.availableCharacteristics.concat(itemgroup.itemGroupCharacteristics);
|
||||
@ -38,7 +42,11 @@ export class InventorySlotCharacteristicEditorComponent implements OnInit{
|
||||
}
|
||||
|
||||
finishEditing() {
|
||||
if(this.editedCharacteristic != null && this.editedCharacteristic.isValid()) {
|
||||
this.editedCharacteristic = null;
|
||||
} else if(this.editedCharacteristic != null) {
|
||||
this.snackbar.open("Please select a valid increasing and decreasing Characterstic", "", {duration: 2000});
|
||||
}
|
||||
}
|
||||
|
||||
onSelectIncreasingCharacteristic(selectedCharacteristic: ItemGroupCharacteristic, slotCharacteristic: InventoryCharacteristic) {
|
||||
|
Loading…
Reference in New Issue
Block a user