# Changelog

<details>

<summary>Changelog - Version 1.2.1</summary>

## Changes

* Moved to the new zyke\_lib loader.
* Moved effects to use zyke\_status, old system still works but the switch is recommended.
* Better alignment for idle particles.
* Added more base flavours for vapes, along with their items.
* Removable cartridges for vapes. If your cartridge is set as unique in your inventory, it carries the amount metadata.
* Added possibility to hide the UI via config. More info [here](https://docs.zykeresources.com/paid-resources/smoking/config#hud).
* Added client `GetItemData` export to get the item data for your equipped item.
* Added ability to modify coloring of the inhale progress bar.
* Made stress management easily available even without using zyke\_status.

## Files Affected

* <mark style="color:yellow;">client/unlocked/functions.lua</mark>
* <mark style="color:yellow;">client/locked/eventhandler.lua</mark>
* <mark style="color:yellow;">client/unlocked/eventhandler.lua</mark>
* <mark style="color:yellow;">using\_loops/functions.lua</mark>
* <mark style="color:yellow;">nui/\*</mark>
* <mark style="color:green;">extras/images/vape\_green\_flavour.png</mark>
* <mark style="color:green;">extras/images/vape\_green\_flavour.png</mark>
* <mark style="color:green;">extras/images/vape\_green\_flavour.png</mark>
* <mark style="color:green;">extras/images/vape\_vanilla\_flavour.png</mark>
* <mark style="color:red;">extras/images/vape\_flavour\_capsule.png</mark>
* <mark style="color:yellow;">server/locked/functions.lua</mark>
* <mark style="color:yellow;">server/unlocked/eventhandler.lua</mark>
* <mark style="color:yellow;">shared/unlocked/config.lua</mark>
  * <mark style="color:yellow;">Showcasing how to use the new effects.</mark>
  * <mark style="color:green;">Config.Settings.hud</mark>
  * <mark style="color:green;">Config.Settings.itemDataIndicators</mark>
* <mark style="color:yellow;">extras/items/ox\_inventory.lua</mark>
* <mark style="color:yellow;">extras/items/qb-core.lua</mark>
* <mark style="color:green;">shared/unlocked/main.lua</mark>
* <mark style="color:yellow;">shared/unlocked/types.lua</mark>
* <mark style="color:yellow;">fxmanifest.lua</mark>

</details>

<details>

<summary>Changelog - Version 1.2.0</summary>

## Changes

* Colored smoke.
* Updates sounds configuration to align with the latest zyke\_sounds.
* Removed manual database setup, it now runs automatically.
* Stop playing sounds when you unequip the item.
* Instantly hide the inhaling bar when unequipping.
* `force_stop_use` command to forcefully stop use in case of issues to not prevent flow of gameplay. Please still report bugs if you encounter them.
* Instantly syncing UI for recipient when transferring an item.
* Fixed effect multiplier calculation being slightly wonky.
* Misc cleanup.

## Files Affected

* client/locked/eventhandler.lua

* client/locked/using\_loops/functions.lua

* extras/sounds/cough\_f1.wav

* extras/sounds/cough\_f2.wav

* extras/sounds/cough\_f3.wav

* extras/sounds/cough\_f4.wav

* extras/sounds/cough\_f5.wav

* extras/sounds/cough\_f6.wav

* extras/sounds/cough\_f7.wav

* extras/sounds/cough\_m2.ogg

* extras/sounds/cough\_m3.ogg

* extras/sounds/cough\_m4.ogg

* extras/sounds/cough\_m5.ogg

* extras/zyke\_smoking.sql

* server/locked/eventhandler.lua

* server/locked/functions.lua

* server/unlocked/eventhandler.lua

* server/unlocked/functions.lua

* server/unlocked/main.lua

* shared/unlocked/config.lua

* shared/unlocked/functions.lua

* shared/unlocked/main.lua

* shared/unlocked/types.lua

* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.1.1</summary>

## Changes

* Automatically running database on script start.
* Unlocked `LightCigarette` function.
* Re-structured to avoid excessive client syncing events.

## Files Affected

* client/locked/using\_loops/functions.lua
* client/unlocked/functions.lua
* server/locked/eventhandler.lua
* server/locked/functions.lua
* server/locked/main.lua
* server/unlocked/database.lua
* server/unlocked/main.lua
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.1.0</summary>

## Changes

* Added client & server `isOccupied` export.
* Better honk prevention handling.
* Configurable "automatic" inhaling. Press to start, press to stop. Will avoid coughing if you don't stop inhaling.
* Adjusted a few intervals for a smoother experience.
* Unique coughing sounds for female characters, along with randomly selecting the sound if more are available.
* Minor cleanup.
* Individual item effect multiplier, you can now change the potency of each smokeable.
* Better fail reason handling, to display why you can't do something.
* Configurable notification for the item you unpacked.
* Configurable option to remove a cigarette pack once it is empty.
* Moved lighter particle settings to the config.

## Files Affected

* README.md
* client/locked/eventhandler.lua
* client/locked/using\_loops/functions.lua
* client/unlocked/keys.lua
* extras/sounds/cough\_f1.wav
* extras/sounds/cough\_f2.wav
* extras/sounds/cough\_f3.wav
* extras/sounds/cough\_f4.wav
* extras/sounds/cough\_f5.wav
* extras/sounds/cough\_f6.wav
* extras/sounds/cough\_f7.wav
* extras/sounds/cough\_m1.wav
* extras/sounds/grab\_bong.wav
* extras/sounds/inhale.wav
* extras/sounds/inhale\_bong.wav
* extras/sounds/inhale\_vape.wav
* extras/sounds/lighter.wav
* extras/sounds/vape\_beep.mp3
* fxmanifest.lua
* locales/en.lua
  * Added `invalidAnim`
  * Added `isDead`
  * Added `inWater`
  * Added `unpackedCigarette`
  * Added `noActiveItem`
* server/locked/eventhandler.lua
* server/locked/functions.lua
* server/unlocked/cigarette\_pack.lua
* server/unlocked/eventhandler.lua
* shared/unlocked/config.lua
  * **Config.Settings**
    * Added `automaticSmoking`
    * Added `removePackWhenEmpty`
    * Added \`notificationOnCigaretteUnpack
  * **Config.Settings.lighter**
    * Added `particle`
    * Added `attempts`
* shared/unlocked/functions.lua
* shared/unlocked/types.lua

</details>

<details>

<summary>Changelog - Version 1.0.11</summary>

## Changes

* Fixed item not being recognized for unique lighter sounds.
* Added zyke\_lib download to readme.
* Removed testing command.

## Files Affected

* client/locked/using\_loops/functions.lua
* server/unlocked/eventhandler.lua
* server/unlocked/lighter\_fluid.lua
* README.md
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.0.10</summary>

## Changes

* Cigarette packs are now using the `ensureMetadata` function within `zyke_lib`. Functionality remains largely the same.

## Files Affected

* server/unlocked/cigarette\_pack.lua
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.0.9</summary>

## Changes

* Verify an animation is cached before you try to cancel it.

## Files Affected

* client/locked/functions.lua
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.0.8</summary>

## Changes

* Fixed duplicate lighter fx and lighter fluid usage.
* Adding a percentage symbol for the lighter fluid description.
* Tweaked particle creation to limit amount spawned. Previously multiple was spawned for a more realistic effect, which caused issues with pool limit.

## Files Affected

* client/locked/using\_loops/funcitons.lua
* client/locked/eventhandler.lua
* server/locked/eventhandler.lua
* locales/en.lua
  * Modified `lighter:description`.
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.0.7</summary>

## Changes

* Replaced animpost effects with timecycle effects.
* Added `IsHigh`, `HasWalkEffect` & `HasScreenEffect` client exports.

## Files Affected

* client/locked/functions.lua
* client/unlocked/eventhandler.lua
* client/unlocked/functions.lua
* client/unlocked/main.lua
* shared/unlocked/config.lua
  * Replaced animpost effect names with timecycle effect names.
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.0.6</summary>

## Changes

* Added qs-inventory support to zyke\_lib, allowing users to now use this resource along with it.
* Re-made screen & walk effect to work together, you are now able to have a different walk effect for all different smokeables.
* Correctly stopping animation, actions such as sitting are no longer cancelled after an animation has been performed.
* Lighter prop spawning when lighting your smokeables.
* New & more realistic lighter spark fx.
* Bong now plays lighter fx.
* Configurable lighter fluid usage, draining your lighters over time.
* Support for multiple lighter sounds, if you use completely different lighters.
* Prevent smoking when dead.
* Prevent smoking when under water.
* Prevent honking when smoking.
* Added `TransferItem` & `SwitchItemPlacement` exports.
* Unlocked keymapping file handler.
* Fixed an issue where vapes & bongs would lose their metadata if you logged out with them in your hand.
* Organized & cleaned up the code.

## Files Affected

* Replace all files.

</details>

<details>

<summary>Changelog - Version 1.0.5</summary>

## Changes

* Supports different lighters, not just one.
* Affects walking style when high.

## Files Affected

* client/unlocked/functions.lua
* client/unlocked/main.lua
* client/locked/functions.lua
* server/locked/eventhandler.lua
* shared/unlocked/config.lua
  * Modified `lighterItem`
  * Added `walkEffect`
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.0.4</summary>

## Changes

* Correctly chooses item used based on slot.
* Tracks metadata for all items, you can now change effects in `clientFunc` & `serverFunc` based on the item metadata. Also includes the item in vape & bong.
* Fixed prop issues when chaing routing buckets.
* Support for looped & non-looped screen effects.
* Various type corrections.
* Providing lighter image.
* Miscellaneous cleanup in the code.

## Files Affected

* client/locked/bong/refill\_item.lua
* client/locked/eventhandler.lua
* client/locked/functions.lua
* client/unlocked/eventhandler.lua
* client/unlocked/functions.lua
* server/locked/eventhandler.lua
* server/locked/functions.lua
* server/locked/main.lua
* server/unlocked/eventhandler.lua
* server/unlocked/main.lua
* shared/unlocked/types.lua
* shared/unlocked/config.lua
  * Added new `metadata` parameter at the end of `clientFunc` & `serverFunc`
* extras/items/images/lighter.png
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.0.3</summary>

## Changes

* Correctly linking flavor names to effects.
* Added missing bong\_water item.
* Added debug messages.

## Files Affected

* client/unlocked/eventhandler.lua
* extras/items
  * ox\_inventory.lua
  * qb-core.lua
* server/unlocked/eventhandler.lua
* shared/unlocked/config.lua
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.0.2</summary>

## Changes

* Item data indicators styling available to modify in the config.
* Config option to disable attacking when inhaling.
* Config option to disable shooting when a smokeable is in your hand.

## Files Affected

* client/locked/using\_loops/functions.lua
* client/locked/eventhandler.lua
* nui/index.js
* locales/en.lua
  * Added `armedWhenSmoking`
* shared/unlocked/config.lua
  * Added `disableSmokingWhenArmed`
  * Added `disableAttackingWhenSmoking`
  * Added `itemDataIndicators`
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.0.1</summary>

## Changes

* Fixed an issue where effects would throw an error for cigarettes, joints and cigars.

## Files Affected

* server/unlocked/eventhandler.lua
* shared/unlocked/types.lua
* fxmanifest.lua

</details>

<details>

<summary>Changelog - Version 1.0.0</summary>

Official release for ESX and QBCore.

</details>
