Update 1.6.0 is available right now!
This update is all about small but extremely important changes that should simplify using the asset. Below you'll find the most notable changes explained, please refer to the open post for a detailed list.
New event notification system!
The goal of exINV has always been to provide an inventory system that is decoupled from its representation, allowing the developer to program his own user interface from scratch if required. This was achieved using a callback script (ex_inv_updated) that was in charge of update all the UI components. It worked, but was less than ideal.
The new event notification system, based on the observer pattern, allows any instance to "subscribe" to event notifications. By simply adding a line like the one below to any object, you are telling exINV to run the specified script for the specified instance whenever the inventory changes.
Code:
ex_ev_subscribe(player_equpment_inv, player_instance, update_player_equipment)
The code above for example could update the player appearance or attributes automatically whenever something changes in his equipment inventory.
Database updates
You are no longer forced to use the built in CSV loader to create an item database. The ex_db_add script allows populating the item database manually from code.
Moreover, items in the database can be assigned to groups, allowing retrieving a list of item keys for specific groups (useful for example if you want to get random items of a specific type for loot etc...)
GUI layer migration
Previously, the inventories user interface was built using regular draw events. The idea was to keep things as simple as possible in order for the developer to customize to fit. Being able though to display the inventory regardless of the GUI resolution and view settings is by far the most requested feature since the first version of exINV, so I'm happy to announce that as of version 1.6 you get this out of the box.
UI rework
The objects for the user interface have been rebuilt from scratch (but keeping the same structure) in order to fit the new event system. As a result, objects code is cleaner and better organized.
Tags management
Lastly, there have been a few changes to the management of item tags. Until now, you could retrieve the tags ds_map of an item directly by using
ex_item_get_tags. This caused a lot of problems since that ds_map was managed internally by the system, and allowing the developer to access it directly led to very confusing issues. As of version 1.6, it is no longer possible to access this data directly, but only as a copy that can be used and altered freely without worrying about the original data.
Due to this change, if you now use ex_item_get_tags to get the tags ds_map, you should remember to destroy it when finished!
This is it for this update, remember to look at the updated documentation for the latest version (link in the open post).
If you encounter any problem, as always feel free to contact me.