I have compiled a few suggestions for API changes. I am interested in your opinions:
Inventory/Economy:
-
InventorySystem.SetOnConsumeReward:- IMO there should be an additional
consumedItemparameter. There is no way to access the speficic instance properties of the source item. - Would it be possible to add a metadata object to the
ConsumeItemscall? This object could then be read out in theSetOnConsumeRewardhook, to modify the resulting rewards with additional user input.
- IMO there should be an additional
-
InventorySystem.GrantItems:- Could we have a parameter to set inventory item properties directly when granting items? Currently you’d have to grant the items, then call the
InventorySystem.UpdateItemscall. It would be more convenient to set the initial properties viaGrantItems(..., properties map[string]*hiro.InventoryUpdateItemProperties, ...)or something
- Could we have a parameter to set inventory item properties directly when granting items? Currently you’d have to grant the items, then call the
-
EconomySystem.CanPurchaseItem:- I’d like to be able to check if an economy store item can be purchased, without actually having to call
EconomySystem.PurchaseItem, almost like adding --dry-run flag. As of now I need to go through all rewards in the economy store item, and check their costs and item (set) limits,
- I’d like to be able to check if an economy store item can be purchased, without actually having to call
Progression:
- The ability to define progressions as prerequisite for item purchases would be very convenient. According to the docs only costs can be defined as requirement. At the moment we have a custom system to check if an item can be bought, based on its associated progression (matching ids)
"some_id": {
"cost": { ... }
"progressions": {
"some_progression_id" // Required to be completed
}
}
}