Update Notes
Last updated
Last updated
DISCLAIMER - This update will likely break your existing Inventory implementation. Due to the substantial code changes required, the old UI will not be compatible. I fully recommend that you DO NOT update if you are in the middle of a project. If you want to use the new UI, be prepared to set it up again! Also, make sure you fully back up your project BEFORE updating.
Main Feature -> UI For the Whole Product
Due to code changes, it is not compatible with old UI.
Thank you Morri for your fantastic artwork and making this possible!
There are massive changes across the board for this - a new tutorial will show how to set this up.
Reworked -> Reworked Notification System
Now has more styles and positions to use
Positioning is based off of screen anchors rather than animations so now any screen size is supported
The animations are handled by the UIAnimationHelper class.
Can now set a default position and style for the notification.
The default can be overridden for specific notifications using an overload on the OpenNotification() Function which can now handle styles.
Reworked -> Cooking Minigame
The old cooking minigame was a bit clunky and looked awful. Was fine for a first attempt but this one is a bit better.
Code reworked to be made simpler
Added -> Small Setup Wizard to get all the dependencies installed into the project that the asset requires with links to documentation. This will be expanded in coming patches to do things like setting up your character automatically etc.
Added -> Sorting Items in Inventory (Sorting in Chest will come in v2.1)
Added -> UIAnimationHelper has now been expanded to support the UI Rework
Added -> Unity 6 Compatibility -> Due to major bugs found with Unity 6 Compatibility, I'll be releasing a patch as fast as I can to support this as a priority.
Added -> First Time Item Pickup Unique Notification
When you pick up an item for the very first time and it's unknown to you a unique notification can appear that displays the items info - think Zelda. After that, regular notifications display.
Is tracked in Inventory Data
Can be turned off in Notification Manager settings.
Added -> Can now cook multiple items at once as long as you have the correct amount of ingredients.
Added -> The Item Infopanel now holds open when an item is selected
Fixed -> Issue with ClearSingleInventory and ClearAllInventories functions not updating slots even though it did work mathematically.
Fixed -> Issue with notifications appearing when game is loaded - no longer spams every item in the inventory!!
Fixed -> Drop function gave null reference when dropping multiple objects.
Fixed -> Hotbar Actions are now correctly disabled when Inventory is open
Fixed -> When Equipping a weapon, moving it to the hotbar, then closing/opening the Inventory, the Inventory Slot was incorrectly losing it's equipped status.
Fixed -> When you Destroy an Item, the InfoPanel details were not clearing correctly
Fixed -> Inventory slot was not swapping with an empty space correctly.
Fixed -> Drop Item & Use Item were not invoking OnItemUsed event correctly for the Inventory Slot.
Fixed -> Melting Steve He is no longer melting!!
Fixed -> Issue where items were not displaying the correct Interact UI text in Demo Scene
Fixed -> Issue with stacking more than one of the same type of Item e.g. 99 Apples Slot 1, 1 Apple Slot 2, pick up one more, should go to slot 2 but ends up in new slot. Thank you @FGB74!
Fixed -> If you set an item to say 120, but the max stacks of it was 99, it allowed you to pick it up. Now fixed and correctly splits the stack into multiple if slots are available to do so.
Fixed -> Notifications were being incorrectly called when picking up stackable items.
Fixed -> Notifications were incorrectly displaying wrong information when picking up stackable items.
Fixed -> Having a full inventory, then adding a new stackable item correctly gave the notification, but actually cleared the slot data and caused havoc...
Fixed -> Dragging a stack of items on top of another stack that was at the max capacity, caused the receiving slot to disappear.
Due to various life commitments getting in the way, this update focuses solely on fixes as well as a singular new feature in Currencies. Thank you for your patience!
Added -> NEW FEATURE - Multiple Currencies
Added support for multiple currencies
Setup via InventoryMaster component on the "Currencies" tab.
Wallet can save/load different currencies.
Huge Rework of a lot of the ShopUIManager and associated classes to accomodate!
Each Item can have multiple currencies and you can set per item whether to buy it, you need ALL of the currencies, or you can use ANY of them.
Note - in the UI buying screen when selecting an item that can use ANY assigned currency, up to 3 different currencies are supported by default but if you want to change the UI to make it support more, go for it!
Fixed -> There was an issue where if you try to set up like tutorial documents/video, you get an error because the modular shop system was not turned on. Now fixed and you can leave it off.
Fixed -> Issue where non-stackable items were sometimes not using notifications.
Fixed -> Fixed issue with Inventory Slots where checking if you were using the UI Settings was causing it to fail.
Fixed -> Loading Chest Data caused 3 different debug messages to appear. Now fixed and only produces one singular message.
Fixed -> Fixed issue with InventoryMaster where no EventSystem caused a null reference error. Now creates one if one doesnt exist in scene.
Fixed -> Chests in Demo Scene have been changed to use a different layer to stop you running over them
Changed -> Small refactor to the Inventory.cs code to eliminate duplication of code and make it more modular. Also cleaned up some functions and optimised with LINQ to read easier.
Added -> New Event that uses the Item as a parameter called OnThisItemUsed to the Item. Thanks DungeonMaster for idea and implementation
Added -> Two new functions inside of InventoryMaster (Thanks FGB74 for the suggestion!):
ClearSingleInventory(Inventory inventory) - resets a single inventory back to no items.
ClearAllInventories() - resets all inventories back to no items
KNOWN ISSUES
There is a known issue with the Notification Manager where if you choose the left sided notifications, they "may" depending on your resolution, appear off-screen. All right sided, and centre notifications are fine. This is to do with the way the animations are interacting with the anchors & various resolutions. I'll be fixing this for next update.
Added -> Simple Hotbar
The Hotbar can be dynamically sized to whatever size you require
Can be set up to use with hotkeys via the Malbers Input
Items can be toggled on/off for use on the Hotbar
Integrated with the save/load system
Added -> New Notification Styles! Check out the Notification Manager to find them! Thank you Bahaa!
Added -> New "Max Number of Notifications" variable for the Notification System which limits how many notifications are on the screen at once and queues up any in a backlog. Thank you Bahaa!
Added -> Alternative Pickup Indicator to use with OnFocused which shows the quantity, item name, rarity and item type!
Added -> Settings file! You can now use a settings file and set it on Inventory Master to customise the look of the UI. Basic settings to begin with and will be added to over time.
Changed -> Renamed "Remove" button to "Destroy" - Thank you Lexus-1!
Changed -> Draggable parenting logic so the icon of the item when moving can take into account the hotbar.
Fixed -> When viewing the Armour tab on Inventory Master, it gave a null reference error in the editor code. Now fixed. Thank you Vision!
Fixed -> Null Reference Error caused by missing null check when loading Chest Data when chest isnt in scene. Now Fixed. Thank you Vision!
Fixed -> Raycasting can now penetrate the notifications correctly. Thank you Lexus-1!
Fixed -> Remove/Destroy item wasn't auto-saving correctly. Now fixed. Thank you FGB74!
Removed -> Legacy components from the Notification Manager and Child due to switching from Simple Transformer to Full Animation for Notifications.
Added -> Inventory Item Manager. Allows you to manage all your items in one space and create new items. Reactions outside of the basic ones and various other options still need to be set up directly on the item itself.
Added -> New OnOpen/OnClose events for each screen state in the UIManager. You can now assign various functions to these events. E.g. call a custom function when Inventory screen opens/closes etc.
Added -> New UI for UIManager - just cleans it up a bit.
Added -> New Public Method to check for if save data exists. Thanks DungeonMaster.
Added -> Can now save Shop Data which remembers pricing, items and stock levels, including if anything is sold out.
Added -> Physical Close Button For Inventory
Added -> Basic Inventory Helpers inside of Inventory Master that mimic the functionality within the individual Inventories for adding, removing and finding an item. Also added a DropAllItemsInAllInventories function as suggested by BigMak on Discord - Thanks!!
Added -> Notification for when you dont have required items to be able to cook. Now informs the player.
Added -> Physical Close Button to Cooking Recipe Screen
Fixed -> Issue where Loading On Start for First time without save data available caused a null reference. It now saves a new copy if it can't find any save data.
Fixed -> Issue where selling an item, allowed you to choose another item to sell instead and make a large amount of money!
Fixed -> When opening the stack split panel, then closing the Inventory, it didnt correctly reset the values.
Fixed -> When dragging an item from the Inventory to a Chest and you dropped it in the empty space between slots - the item would freeze mid-air. Now fixed.
Fixed -> Dragging and swapping an item within a chest caused odd behaviour and would look like it was duplicating items. Fixed.
Fixed -> Shop Data was not loading correctly due to a weird null check. Now fixed.
Fixed -> When certain modules were turned off such as the shop or the simple dialogue, the UIManager didn't understand how to handle that and a null reference was produced. Refactored the code to make sure each UI State only uses what it needs.
Fixed -> When not using the cooking minigame, items used to cook did not decrease. Fixed.
Fixed -> Added null checks to the UIManager when changing screens and a component didnt exist.
Fixed -> Value Exception Error when using the scene outside of the folder structure by removing the Transform Hook for the Use Button on the CookingUI Prefab.
Fixed -> Fixed issue with null reference from the Cooking Minigame Coroutine when cooking for the 2nd time.
Fixed -> Fixed issue where moving items from the player inventory to a chest inventory kept the focus on the item, which then when using reactions such as Use/Equip/Remove etc, would cause a null reference error.
Fixed -> When trying to pick up an item when the Inventory was full, it vanished! This is now fixed and the player now drops the item back into the world correctly as well as giving a notification to the player (if notifications are turned on!)
Fixed -> When dropping a weapon, it caused an error when being picked back up and tried to be used. Caused by an incorrect boolean set in Drop Item. Fixed.
Fixed -> When Cooking same item twice and was stackable, it wouldn't stack and would create it's own stack. Fixed.
Fixed -> When cooking the same item twice using the minigame, the TryCook() function got called multiple times. This was due to not clearing the event listener correctly. Now Fixed.
Fixed -> Recipe screen could be opened when the Inventory was open as well the other way around. Now fixed. Only one can be open at a time.
Fixed -> Camera now correctly stops moving when the recipe/cooking screens are open.
Fixed -> Shop now correctly remembers if the item is sold out in the same play session. Stock doesnt automatically refill after leaving shop!
New Additions/Changes
YOU MUST UPDATE TO v1.4.4 OF ANIMAL CONTROLLER TO USE THIS UPDATE! It is extremely recommended that before you update Animal Controller and/or the Inventory Add-On, that you make a backup of your project first. This Inventory Update reworks a LOT of back-end code. I've tested as much as I can but I can almost guarantee there will be some weird bugs as a result of this. Please report them in the Discord Server as normal and we will have a fast-following hotfix for any major issues.
NOTE - Crafting is going to be moved to the next update. That feature needs a bit more work on it. Thank you for your understanding.
Added -> Cooking System
The Cooking System is the main feature of this update.
The inspiration of the Cooking System is based on Genshin Impact.
When choosing a Recipe to cook, you need to ensure you have the correct items, otherwise you wont be able to cook it! Then, once cooking, you will have a bar with a sweet spot. Make sure you get the indicator into the Sweet Spot in order to achieve a Perfect Cook!
Added a new SubType Indicator on the Item to indicate whether an item is "Food", "Recipe" or "Item"
Added a new Reaction called "Learn Recipe" which you need to add to your recipe items that you pick up in order to learn it. Once learned, it will be saved whenever you save the Inventory Data.
Perfectly Cooked items (setup as separate items), can have different buffs/debuffs, whereas normal cooked items can have reduced buffs/debuffs.
If you dont want to use the cooking minigame, you can instead toggle it OFF, and have a custom chance instead of producing a perfectly cooked item
Added -> Custom Rarities are now possible as have switched them over to using the ID System rather than an enum
Added -> Various Buff/Debuff Reactions for Damagers. Allows you to do things like: +10 damage on equip, +10hp regen on use, +10% Crit Chance Multiplier etc.
Added -> Armour Equipping - You can now equip unskinned armour to any part of the body. (Sorry for missing this previously!)
Added -> Simple UI Animation Library to help with some basic UI animations. Fade, Scale, Move & Rotate UI Elements. Can be accessed via the UIManager.
Added -> List Of Damager Components on the References Tab of the Inventory Master. Add in here all of your attack triggers/damagers that wont be equipped. E.g. Hand Attack Triggers for Unarmed Combat. Do not add weapons, these get added automatically.
Moved -> Rarity Colors are now on the individual rarity ID's themselves rather than on Inventory Master.
Changed -> Inventory UI Demo to use different default sprites to improve the look of it
Removed -> Removed Update() from InventoryItem.cs as was not needed
Reworked -> Reworked a TON of code (changes to around 60% of all scripts) in order to use Item Instances, rather than just the Item Scriptable Objects. Needed for future development of Items.
The new item is of a class called ItemInstance which inside of the class will allow us to expand on the Item Class and hold new references. In the future this could allow for various things like Specific Stat Overrides etc.
Reworked -> Reworked the entire SaveLoad system from the ground up in order to incorporate Item Instances. Made vast improvements including various fixes around null checks and clearing down the inventory prior to loading.
Reworked & Added -> Add Item, Remove Item, Drop Item and added overloads to account for Item Instances
Fixes
Fixed -> Fixed issue with weapons dropping instead of being destroyed when unequipping weapons when using the built-in prefab.
Fixed -> Drop Reaction removed the item (giving the illusion of dropping), whilst also not actually ejecting all data about the item itself, instead of updating and dropping the item properly. Now fixed.
Fixed -> When dragging item back to Inventory after double clicking to get it to chest, it returned with a quantity of 1. Now Fixed.
Fixed -> When double-clicking to get the item to a chest, then double-clicking back, then dragging the item to the chest, it would make the item disappear. Now Fixed.
Fixed -> If Inventory was full when attempting to buy an item at the shop, it would let you buy it and item would disappear. Now stops you and issue fixed.
New Additions/Changes
Added -> Improved Save/Load System so that it now saves what weapon you have equipped and re-equips it on Load
Fixes
Fixed issue where OnClose Shop Event was not firing correctly
New Additions/Changes
Added -> Shop System
The shop system is a simple one. You can buy, or sell items.
Set up individual shops via the Shop component.
Easy to set up - Drag and Drop Prefab into Scene and add the ShopCanvas!
Uses the default Malbers currency of coins, but you can use whatever you wish.
Added -> Stack Splitting types: Minecraft Method or Classical UI
Minecraft Method splits the stack in half with a single click
Classical UI allows you to define how much to split with a UI
Added -> Drag and Drop to Combine Stacks - If you go over a stack limit then it will try to create a remainder item in the receiving inventory if there is space. If there isn't space, then it can't add to the stack at all.
Added -> Item Rarity
4 Types: Common, Rare, Epic & Legendary
Icon slots will now change colour depending on rarity - choose your own colors in the Inventory Master!
Will be expanded upon in a future update to allow for custom rarities!
Added -> New Test items - Apple, Wood Logs & Iron Ore
Added -> Auto-Save Functionality - Thank you SW4N for the request!
Added -> UI Manager Prefab
The amount of UI Elements was getting quite complex to manage so have created a UI Manager prefab to manage all of the UI Screens. Will be a lot easier to manage going forward and develop with. This has meant that quite a bit of code has moved/reworked behind the scenes. If you have any existing dependencies - make sure you check them!
Added -> New Shop Camera to SteveInventory Prefab which pans in when the user interacts with the shop
Added -> Simple Dialogue System for use with the Shop System. Displays when going to a shop.
This is optional and doesnt have to be used - used only for demo purposes and will not be updated further.
Removed -> OpenInventory() & CloseInventory() From InventoryMaster.cs as they were obsolete.
Moved -> OpenCloseInventory() functionality to UIManager.cs
IMPORTANT - This change will effect opening and closing your Inventory. Please make sure you update any references as per the documentation.
Changed the Inventory Master Editor to align closer with the look of Animal Controller and HAP's editors. Everything on there is the same, just now categorized for easier viewing.
Re-made icons for the demo items - they look so much better!
Added new events to support the new shop system
Fixes
Fixed issue with Loading on Start if there is no save data to begin with. Now throws a warning instead of an error.
Fixed issue when dropping an item where if you gave it a quantity higher than 1 then dropped it, the resulting instantiated prefab's quantity would mirror the original item thereby allowing you to duplicate items infinitely
Fixed issue when adding items - if you had more than 1 item of the same type and was stackable, and another was added, it would add 1 each time to a new slot instead of creating a new stack and adding to that new stack
Fixes
Fixed null reference issue with having no chests in the scene where it was causing null reference errors
Fixed null reference issue with loading and having no chest data to load
Fixed null reference issue when adding a new item scriptable object, related to the Stackable property.
Added Storage Chests!!
Added Load on Start option - Thank you SW4N!
Added a new Debug Toggle to turn on/off debug messages and added a ton of new messages across the whole asset using a new Debugging function (idea taken from Animal Controller!)
Added new Delete Save functionality using DeleteInventorySave()
Added new GetItemQuantity() Overload Functions to check specific items and names of items for quantity values - Thanks DungeonMaster!
Added InventoryType (Either Player, Chest or NPC) to determine what type of Inventory it is.
Added Saving/Loading for Chests. Called via normal save/load methods.
Added double clicking to move items functionality when an additional inventory (e.g. chest) is open along side of the players inventory and added a MoveItemBetweenInventoriesWithDoubleClick() function to support this
Added a bunch of new Transform Hooks to use within the Inventory system which remove all hard dependancies
Added new Events Folder
Added new InventoryOpenClose Malbers Event
Added new ChestOpen Malbers Event
Changed the Structure of the Inventory Prefab to allow for Chest and NPC Storage.
Removed redundant MInput from Inventory Prefab
Added new Disable Camera Event -> Used for disabling/re-enabling camera when opening/closing Inventory
Made the OpenInventory(), CloseInventory() and OpenClose() redundant and replaced them with a singular -> OpenCloseInventory() to support the new InventoryOpenClose Event
Added multiple simple translators to the Inventory Prefabs to support animation when opening the Inventory when interacting with a Chest/NPC
Added additional description tooltip for Notification turn on toggle.
Changed name of "Remove Button" to "Delete Button" in the inspector
Added a new Chest Inventory and Chest Inventory UI component to manage the chest functionality
Exposed the InventoryData data class to the inspector of each Inventory for debugging purposes
Moved the Save/Load system over to a Singleton and created a new InventorySaveLoadSystem prefab for it. You now can call the functionality anywhere using SaveLoadSystem.instance. InventoryMaster functions have been amended to point to the singleton.
Amended the InventorySlot Code and added a SwapItemsInSlotsBetweenInventories() function to support Swapping and Moving items between the players inventory and chest inventories
Changed the functionality when dragging an item from one Inventory to another that it always appears on top
Amended Draggable.cs to not allow focusing on Chest items
Amended the Item Spawner name to appear correctly
Fixed Instantiating multiples weapons with UseHolsters turned on via Weapons Manager when dropping a Weapon
Fixed builds not completing due to editor functions not being wrapped in Unity Editor tags
Fixed items not adding to Inventories due to a null value on the Inventories item type. Added console messages showing this and a return function when one is found.
Fixed compatability with the respawner. Now working.
Fix for reactions where they were triggering twice. Now only trigger once correctly.
Moved Stackable to Item Types instead of per item to allow for greater flexibility in the future as well as to make it overridable for certain types of items if needed.
Fix for Inventory Item component, as Quantity wasn't showing in editor inspector
v1.0.0 - Release - 10/11/2023
Removed -> Various Obsolete Code that was left lying around! I'm a messy coder okay!
The UI being used at present is very basic - I intend to make the demo UI look much better in the next update. Change it to however you want it to look!
Reworked -> Equip/Unequip/Drop/Remove Reactions. In order to accommodate the armour equipping I decided to just rework the above Reactions to make them more readable and easier to maintain going forward. Less spaghetti code, more modular functions + a few bug fixes!