Is there a prefered way to extend InventoryItems to add additional properties? #45
-
There are currently max_stack, icon, and name by default. Currently I'm trying to do something like this:
Which seems to work fine, but I was curious if there was a better or more preferred way to add properties to the InventoryItem class? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello! Yes this is already planned to be added. In the develop branch, the editor item is being added, which will add custom properties to the item with a dictionary, but to have complete integration with the editor, more work is needed. This develop will be released by the end of this month if everything goes well! I'm still going to study if the "weight" can be a basic property of the InventoryItem. You can also extend the InventoryItem, creating for example the InventoryItemWeight, which will have the property you expect. |
Beta Was this translation helpful? Give feedback.
Hello! Yes this is already planned to be added. In the develop branch, the editor item is being added, which will add custom properties to the item with a dictionary, but to have complete integration with the editor, more work is needed.
Even without a full editor, you can still edit these properties in the resource inspector.
This develop will be released by the end of this month if everything goes well!
I'm still going to study if the "weight" can be a basic property of the InventoryItem.
You can also extend the InventoryItem, creating for example the InventoryItemWeight, which will have the property you expect.