Repository navigation
Releases
v3.42.2
Bug Fixes
- context: support position option (#841) #841 (Arne Van Daele)
- radial: call onSelect export on the resource that added the item (#842) #842 (Arne Van Daele)
- input: format date-range and empty dates with returnString (#843) #843 (Arne Van Daele)
- timer: don't call onEnd when it wasn't set (#844) #844 (Arne Van Daele)
- imports/vehicle: use super class to inherit new Vehicle class (Linden)
Code Refactoring
- swap out deprecated GameEntity class usage (Linden)
v3.42.1
This only affects the TS package - no need to update your resource.
Bug Fixes
- package/callback: corrections to key cleanup (Linden)
v3.42.0
Docs will be coming for new features at some point, but I'm not in the mood to work on that right now. Some snippets and explanations below.
Firstly, cfxlua-require was updated to resolve a bug that affected FiveM Enhanced -- some other minor changes were made too. v1.0.2 is now the minimum requirement to run ox_lib, enforced using the new SemVer module. See fxmanifest.lua for how that's configured.
I finally went ahead and made the new logger module that's been mentioned off-and-on for years now. Basically just making the API less of a nightmare and standardising how providers are added. For now only supports Fivemanage; feel free to PR more providers if I don't get around to it myself. I assume VictoriaLogs will be available soon, and both DataDog and Loki are of course planned.
I've converted the GameEntity classes over from the imports system and made minor changes to the API which will need to be reflected in the docs soon. Aside from that, I went ahead and added a helper method for listening to statebag changes for Players.
-- client.lua
local Player = require 'Ox.Game.Player'
Player.on('test', function(player, key, value, old)
print('triggered player state change handler', key, value, old)
print(json.encode(player:keys()))
end)
-- server.lua
local Player = require 'Ox.Game.Player'
local player = Player:new(-1) -- gets the first available player
player:setr('test', math.random())Features
- SemVer: semantic versioning module (Linden)
- resource dependency version constraints (Linden)
- GameEntity: migrate to modules (Linden)
- logger: implement new logger module (Linden)
- logger: log levels and helper functions (Linden)
- logger: attach player data to logs (Linden)
- logger: ts package (Linden)
- Player: add static method to handle state changes (Linden)
Bug Fixes
- callback: ensure key cleanup on timeout (Linden)
- web: explicit type configuration (Linden)
- resource/init: invalid assignment (Linden)
- init: load require after cache assignment (Linden)
- re-add require as standard dependency (Linden)
- types: make input dialog options optional (#823) #823 (Breeze)
- types: preserve radial icon strictness (#824) #824 (Breeze)
Code Refactoring
- require: simplify pattern matching (Linden)
- resource/init: minor tidy-up to hasLoaded handling (Linden)
- init: default loadStatus message (Linden)
- dependencies: include resource url in error message (Linden)
- logger: tweaks to provider spec and error handling (Linden)
- logger: types (Linden)
Continuous Integration
- release: exclude .git from cfxlua-require package (Linden)
Chores
- disable diagnostics on deprecated imports (Linden)
v3.41.0
I recently introduced some changes to how the require file was loaded and subsequently how modules would be loaded in the future, i.e. "modules v2". Alongside a new package searcher, this would allow for loading internal modules directly - rather than lazy-loaded via calls to lib.
Currently, this only supports two modules: Class, and DataView (the former being functionally identical to lib.class).
local Class = 'Ox.Class'
local DataView = 'Ox.DataView'Some more information is available here.
With that out of the way, I'm announcing another major change to how require works. This is being done to ensure the module system can be standardised and used in other projects without adding ox_lib or any full resource as a dependency.
So, I've created cfxlua-require.
It's not a full resource and only needs to exist in your resource directory for other resources to find and load it. ox_lib will continue to work exactly as it did before and you don't need to do anything - otherwise you can include it inside your own projects and load it like any other script file, or add shared_file '@require/init.lua' to your fxmanifest.
If you are cloning this repository then you will also need to clone this new one; otherwise all releases will now bundle cfxlua-require alongside ox_lib.
The biggest reason for this change is because some project maintainers will go above and beyond to avoid adding third-party resources as dependencies, and whilst it's fine to use and redistribute according to the license it isn't exactly user-friendly for systems to have subtle behavioural differences, incompatibilities, and conflicting globals. ESX, for example, has both esx_lib and es_extended setting up require in ways that may cause problems in the future.
Features
- use cfxlua-require to provide module system (Linden)
Bug Fixes
- package/acl: incorrect export call in removeAce (Linden)
Chores
- add dependency to readme (Linden)
v3.40.3
FiveM has finally updated CEF from M104 to a more recent release. Unfortunately it has broken setClipboard from older builds. This release should resolve the problem for those of you using canary.
Bug Fixes
- setClipboard: focus on textarea before copying to clipboard (#833) #833 (0Programmer)
v3.40.2
Bug Fixes
- corrections to internal resource require handling (Linden)
v3.40.1
Bug Fixes
- require: handle require without a module name (Linden)
Code Refactoring
- require: separate from imports system and polishing (Linden)
- DataView: change path (Linden)
- Class: move to modules v2 (Linden)
Continuous Integration
- release: include modules in the bundled files for release (Linden)
Commits
v3.40.0
Features
- radial: allow open specific radial menu as root (#812) #812 (URRP XC)
- modules: add DataView class (Linden)
Bug Fixes
- class: allow inherited methods to access private fields (#813) #813 (Shorty)
- vehicleProperties: bulletproof tyres (#822) #822 (cassanodev)
- redundant-return-value warning (#814) #814 (Mauro)
- cache: preserve zero values on initial read (#827) #827 (Tomić)
- callbacks: prevent invalid source from responding to handler (Linden)
Code Refactoring
- array: correct spelling mistakes (#821) #821 (cryptosdarius-star)
- require: support ox_lib modules v2 (Linden)
Commits
- cadc40c: Delete .github/ISSUE_TEMPLATE directory (Linden)
v3.39.0
Features
- package/zones: increase api parity with lua (Linden)
- package/zones: remove method (Linden)
- string: add string utility functions (#809) #809 (scorz)
- progress: remove and ignore invalid prop data during validation (Linden)
- vehicleProperties: add support for broken off vehicle wheels (#810) #810 (filo studios.)
Bug Fixes
- cron: support a single named month in expressions (#799) #799 (Astrxw)
- client/context: guard against nil openContextMenu in NUI callbacks (#800) #800 (Astrxw)
- zones: track grid cell locally instead of sharing cache keys (#801) #801 (Astrxw)
- web: bump react-fontawesome so icon animations work (#803) #803 (Whereiam)
- require: add module name and loader data to required modules (Linden)
- cron: schedule pinned times later today instead of next day (#811) #811 (/y)
- web: prevent inputDialog cleanup from destroying chained dialogs (#807) #807 (horaadev)
Commits
- 5f41696: Update NOTICE.md (Linden)
v3.38.0
Features
- new collection types (#796) #796 (Kenshin13)
- insertion-ordered Map (#798) #798 (Kenshin13)
- radial: support adding/removing items from submenus (#797) #797 (Grav)
- collections: support encoding map/set as table (Linden)
- locales: support locales_path in fxmanifest (Linden)
- package/radial: support new arguments (Linden)
Bug Fixes
- stop mutating caller-supplied tables (#791) #791 (Kenshin13)
- callbacks: isCallbackValid returns boolean (#792) #792 (Kenshin13)
Code Refactoring
- logger: split providers into separate files behind a shared dispatcher (#793) #793 (Kenshin13)
- getFilesInDirectory: use io.readdir (Linden)
Commits
- 39e8cce: Update README.md (Linden)