🚀 Heads up! GLoot 2.4 is Coming Soon and Redefines Item Slots #144
peter-kish
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear GLoot Users,
GLoot version 2.4 will be out soon and I think it's worth announcing that there will be some changes that could break backwards compatibility with earlier versions of the plugin.
Usually, I'd save the big changes for a major 3.0 release, but after some thinking I decided that certain features have not been defined and implemented well enough, and that it's better to redefine them now instead of leaving them in a flawed state until version 3.0 comes around.
The changes in question are related to item slots and the
ItemSlot
class. After this discussion pointed out some unintuitive features and I compared the item slot logic to existing inventory systems, I came to the conclusion that the existing implementation doesn't represent the most commonly used item slots very well. Namely, the problem seems to lie in the fact that the slots only hold a reference to a given item instead of taking ownership, which is how most inventory systems implement item slots. This results is items not being removed from the inventory when equipped in a slot, multiple slots being able to hold the same item etc. and forced some developers to come up with all kinds of ugly workarounds.The obvious solution was to redefine item slots to actually own the equipped items, similar to how an inventory does, but at the same time I wanted to keep the option to hold item references in case some users already adopted that approach. This led me into splitting the existing
ItemSlot
class into two:ItemSlot
ItemRefSlot
where
ItemSlot
is the more intuitive implementation which takes ownership of the equipped item, whileItemRefSlot
only holds a reference to an item.So what does this mean to your project in case you do the upgrade?
If you are not using item slots - nothing. The rest of the plugin features suffered no major changes and should work the same way they did in the earlier versions.
But if you are, you have two options:
ItemSlot
nodes withItemRefSlot
nodes to stick to the "old" item slot logic.ItemSlot
nodes a try. They might fit your needs if you had problems getting the slots to behave the way you want them to.Anyways, make sure to review the
ItemSlot
/ItemRefSlot
documentation before doing the upgrade and make the necessary adjustments to your code to ensure a smooth transition.Thanks for your understanding and all the feedback - it really helps ironing out the flaws and making GLoot more robust!
Cheers,
Peter
Beta Was this translation helpful? Give feedback.
All reactions