when saving an inventory, I want to check if the item has at least 1 Inventory Group. If not, then add in a default group.
I am just having trouble on the Add. I don't think it likes the "ZZZZZZZZZZ0000000000"
- Code: Select all
Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
Dim InventoryForm As JiwaInventoryUI.InventoryMaintenanceForm = DirectCast(JiwaForm, JiwaInventoryUI.InventoryMaintenanceForm)
AddHandler InventoryForm.Inventory.SaveStart, AddressOf CheckGroup
End Sub
Sub CheckGroup(Sender As Object, e As System.EventArgs)
Dim inventory As JiwaInventory.Inventory = DirectCast(sender, JiwaInventory.Inventory)
If inventory.Groups.Count <= 0 Then
inventory.Groups.Add("ZZZZZZZZZZ0000000000") 'this bit here isn't working
End If
End Sub
Cheers
Danny