# Changelog

<details>

<summary>Changelog - Version 1.1.12</summary>

### Changes

* Added automatic saving of clean item definitions when importing items.
  * A file is generated in `import_batches/` with stripped-down item data (no client-side status, animations, props, or usetime), ready to be copied into your `ox_inventory/data/items.lua`.

### Files Affected

* <mark style="color:yellow;">server/unlocked/conversions/import/init.lua</mark>
* <mark style="color:green;">import\_batches/.gitkeep</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.11</summary>

### Changes

* Added an in-game import menu for bulk-importing consumable items via a configurable command.
  * Includes an Ox inventory text format parser.
  * Imported items can be activated in batches through a separate command.
* Added translations for 15 new languages: Arabic, Czech, German, Spanish, French, Italian, Japanese, Dutch, Polish, Portuguese, Romanian, Swedish, Thai, Turkish, and Chinese.
* Fixed the idle animation not resetting properly when it shared the same animation clip as the consume animation, which could cause the animation to freeze or not replay correctly after consumption ended.
* Replaced internal print statements with the debug system for cleaner and toggleable console output.

### Files Affected

* <mark style="color:yellow;">client/locked/consuming.lua</mark>
* <mark style="color:yellow;">client/locked/functions.lua</mark>
* <mark style="color:green;">client/unlocked/import.lua</mark>
* <mark style="color:yellow;">server/\*</mark>
* <mark style="color:yellow;">shared/unlocked/config.lua</mark>
* <mark style="color:yellow;">locales/\*</mark>
* <mark style="color:yellow;">types.lua</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.10</summary>

### Changes

* Added a fallback in the ox\_inventory converter to handle more generic items that may not have been previously supported.

### Files Affected

* <mark style="color:yellow;">server/unlocked/conversions/ox\_inventory.lua</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.9</summary>

### Changes

* Added support for `zyke_sounds` presets.
  * Automatically registers "Consumables (Items)" sound files if `zyke_sounds` is detected.
  * Automatically registers "Consumables (Coughing)" sound files for the consumption haste system.
* Unlocked a significant portion of the item creator and core server functions to allow for easier debugging and custom modifications.
* Renamed the `IsInteracting` export to `IsOccupied` for better parity across resources.
* Added a new list of starter ingredients to the default setup.
* Fixed an issue where the Item Creator UI could fail to respond after exporting an item.
* Fixed a bug where consumption rewards would fail to process if the data was not formatted correctly as a table.
* Added validation checks to ensure consumption reward values exist before they are applied.

### Files Affected

* <mark style="color:yellow;">client/locked/events.lua</mark>
* <mark style="color:yellow;">client/unlocked/exports.lua</mark>
* <mark style="color:yellow;">client/unlocked/main.lua</mark>
* <mark style="color:yellow;">server/\*</mark>
* <mark style="color:yellow;">nui/\*</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.8</summary>

### Changes

* Added support for stackable (non-unique) items.
  * Non-unique items are now excluded from the quality decay system.
  * Updated the item creator and ingredient menus to display both unique and non-unique items.
* Added several new exports to check player states, including whether they are currently interacting, if their current item is empty, or if they have an item equipped.
* Added a server-side export to force a player to unequip their current item.
* Improved the item creator to provide smarter warnings when attempting to use items that are not whitelisted.
* Automatically translate consumption rewards to status changes for easier configuration.
* Fixed rounding inconsistencies in consumption reward amounts.
* Reduced console noise by only logging ox\_inventory item conversions when items are actually available to convert.
* Moved exports into dedicated files for better organization.

### Files Affected

* <mark style="color:yellow;">client/locked/events.lua</mark>
* <mark style="color:yellow;">client/locked/quality\_decay/main.lua</mark>
* <mark style="color:green;">client/unlocked/exports.lua</mark>
* <mark style="color:yellow;">client/unlocked/functions.lua</mark>
* <mark style="color:yellow;">server/\*</mark>
* <mark style="color:yellow;">shared/locked/functions.lua</mark>
* <mark style="color:green;">shared/unlocked/exports.lua</mark>
* <mark style="color:yellow;">shared/unlocked/functions.lua</mark>
* <mark style="color:yellow;">shared/unlocked/items.lua</mark>
* <mark style="color:yellow;">nui/\*</mark>
* <mark style="color:yellow;">locales/en.lua</mark>
* <mark style="color:yellow;">types.lua</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.7</summary>

## Changes

* Version checker.
* Using zyke\_lib's method for getting accurate time since server start.
* Some misc logging.

## Files Affected

* <mark style="color:yellow;">nui/\*</mark>
* <mark style="color:yellow;">server/locked/main.lua</mark>
* <mark style="color:yellow;">server/unlocked/functions.lua</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.6</summary>

## Changes

* Stop consuming when preparing to throw.
* Added fallback for missing item labels in inventory config.
* Stop idle stage correctly when you finish an item.
* Experimental qb-smallresources conversion tool for consumables.
* Some misc internal changes.

## Files Affected

* <mark style="color:yellow;">client/locked/dui/main.lua</mark>
* <mark style="color:yellow;">client/locked/events.lua</mark>
* <mark style="color:yellow;">client/locked/functions.lua</mark>
* <mark style="color:yellow;">client/unlocked/functions.lua</mark>
* <mark style="color:yellow;">client/unlocked/throw\_prop.lua</mark>
* <mark style="color:yellow;">nui/\*</mark>
* <mark style="color:green;">server/unlocked/conversions/qb-smallresources.lua</mark>
* <mark style="color:yellow;">server/unlocked/functions.lua</mark>
* <mark style="color:yellow;">shared/unlocked/functions.lua</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.5</summary>

## Changes

* Fixed an early variable definition raising an error due to timing issue where your cached item data may be cleared too early when coughing & unequipping your item.
* Moved some locked code into unlocked files, mainly for debug purposes.
* Removed some dev prints.

## Files Affected

* <mark style="color:yellow;">server/locked/functions.lua</mark>
* <mark style="color:yellow;">server/unlocked/functions.lua</mark>
* <mark style="color:yellow;">nui/\*</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.4</summary>

## Changes

* More robust fetching for dependencies used to fix timing related issues. This fixes instances where you could not apply sounds.

## Files Affected

* <mark style="color:yellow;">client/locked/events.lua</mark>
* <mark style="color:yellow;">nui/\*</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.3</summary>

## Changes

* Added some debugging.
* Fixed missing database column not being added.

## Files Affected

* <mark style="color:yellow;">client/locked/events.lua</mark>
* <mark style="color:yellow;">client/locked/dui/main.lua</mark>
* <mark style="color:yellow;">client/locked/events.lua</mark>
* <mark style="color:yellow;">client/unlocked/functions.lua</mark>
* <mark style="color:yellow;">client/unlocked/keybinds.lua</mark>
* <mark style="color:yellow;">server/unlocked/database.lua</mark>
* <mark style="color:yellow;">nui/\*</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.2</summary>

## Changes

* Fixed targeting not being recognized correctly for world interactions using the new loader.

## Files Affected

* <mark style="color:yellow;">client/unlocked/world\_interaction/pickup.lua</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.1</summary>

## Changes

* Removed dependency that was added during testing.
* Fixed trash cans by waiting for target systems to be initialized properly.
* Added client-sided consumption rewards, allowing new rewards such as health & armor to be added.
* Added health & armor rewards.
* Added a "max amount" input for rewards. This allows limiting the max amount a reward can give you. For example, consuming an item can give you at most 25 armor, once you have 25 armor it doesn't give the reward anymore.

## Files Affected

* <mark style="color:yellow;">client/unlocked/threads/trash\_can.lua</mark>
* <mark style="color:yellow;">client/locked/consuming.lua</mark>
* <mark style="color:yellow;">client/locked/events.lua</mark>
* <mark style="color:green;">client/unlocked/on\_consumption.lua</mark>
* <mark style="color:yellow;">server/locked/functions.lua</mark>
* <mark style="color:yellow;">server/unlocked/on\_consumption.lua</mark>
* <mark style="color:yellow;">shared/unlocked/functions.lua</mark>
* <mark style="color:yellow;">locales/en.lua</mark>
  * <mark style="color:green;">ing:ingredientRewardMaxAmount</mark>
  * <mark style="color:green;">ing:ingredientRewardMaxAmountTooltip</mark>
* <mark style="color:yellow;">nui/\*</mark>
* <mark style="color:yellow;">types.lua</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.1.0</summary>

## Changelog

* Moved to the new zyke\_lib loader.
* Fixed a reversed logical operator.
* Set interaction when pouring, to block new actions.
* Avoid timing issue when ensuring idle stage right when you unequip your item.
* Block changes to consumption haste when you are in placement mode.
* Added sounds when pouring drinks.
* Cleanup active items connected to an item id if the item id is invalid and is no longer connected to a item configuration.
* Validate item settings exist when constructing item metadata.
* Fixed an incorrect variable used when adding to list of items.
* Reset loading when duplicating ingredients.
* Adjusted the choking settings for a better default.
* Correctly updating the metadata after closing the item (usually drinks) when placing it down.
* Config setting to fetch possible ox conversions for items.
* Fixed spelling error for `discardedCurrentItem`.
* Moved methods for translating keys into zyke\_lib.
* Registering keybinds earlier to avoid timing issues.
* Conversion system from pixel-consumables to our system.
* Added item hooks, to create additional functionality on item events like starting or stopping consumption, much more has been added but keeping it brief.
* Fixed an issue where restarting the script would throw errors if you had players without a selected character.
* Truncating item weight to one decimal.
* Configurable toggle for item quality in the descriptions.
* Additional search fields, you can search for both label & name to find items.
* Hint setting for trashcans, you can now select if you want it to be displayed or not.
* Fixed an issue with converting certain ox\_inventory.lua items.
* An items.lua file is now created with all of the items you converted, ready to be pasted into your old items.lua file. This speeds up converting tons of items with one copy & paste.
* Keybind menu next to your consumption bar to dynamically display all active keybinds.
* Configurable discard rewards for items, for example, giving an empty banana peel when finishing a banana, a bone after eating a chicken leg or a generic can when finishing a drink.
* Sorting available items in the item configurator list in alphabetical order.
* Smoother wait for items to spawn when equipping them.
* Additional rIght-arm throwing for items that are in your right arm.
* Moved item validation into new file.
* Added item categories to filter your items in the configurator.
* Preview sounds in the item configurator.
* Allow pre-animation without playing a sound, for example, when peeling a banana by using it for the first time.
* Discard items that are below the configured quality when interacting with a trash can.
* Fixed a rounding issue for the reward calculation affecting some people.
* Item name is now being truncated in the item list for the configurator.
* Colored the pagination dots correctly.
* The consumption bar color can now be changed in the config.
* Updated the setup link to the docs instead of the old beta-testing channel.
* Added in item packs, for example, this allows you to grab multiple donuts from one donut case.
  * These packs are placable in the world, if configured.
  * Can be configured to require placement. Perhaps you don't want players to have packs they can just grab from in their inventory.
  * The packs can be made generic to only require one item with dynamic metadata, or item-specific if you wish to sell these packs easily in stores and have a dedicated item for each pack.
  * A personal setting has been added for displaying the contents inside of a placed pack. You can have just the pack, a static prop on top or a rotating prop on top.
  * Cleans up automatically after a configured time of not being interacted with.
  * Configurable max packs placed by one player at a time.
  * Admin-debug exists for placed packs to catch malicious users.

## Files Affected

* All

## SQL Modifications

```sql
ALTER TABLE `zyke_consumables_configured_items`
    ADD COLUMN `discard_rewards` TEXT DEFAULT NULL,
    ADD COLUMN `categories` TEXT DEFAULT "[]",
    ADD COLUMN `pack` TEXT DEFAULT NULL;
```

</details>

<details>

<summary>Changelog - Version 1.0.0</summary>

Official release for ESX, QBCore & Qbox.

</details>
