Commit Graph
100 Commits
Author SHA1 Message Date
Linden f6216af1ae refactor: rename lualib variable and move clipboard export 2022-04-29 03:02:06 +10:00
Linden c7bab9b47f fix(zones): debug functions should not be global 2022-04-29 02:01:51 +10:00
Linden 634dd747b7 refactor(zones): assign X directly and store triangles as matrices 2022-04-29 02:01:17 +10:00
Linden 754ae1bd8d refactor(zones): use array table structure when creating triangles 2022-04-29 01:50:31 +10:00
Linden 247b9916e1 refactor(zones): rename variables and minor perf
Set box vertices and poly triangles once during creation (with debug).
2022-04-29 01:38:01 +10:00
Linden cfffcee577 feat(zones): debugBox draw lines on edges
It's an abomination until Doka works his magic.
2022-04-27 17:13:26 +10:00
Linden 5dce90682f refactor(zones): reduce value reassignments 2022-04-27 17:11:36 +10:00
Linden fc3e5d6339 feat(zones): add contains method to zones
Reduces number of table lookups for micro-optimisation.
zone:contains(coords) is also a bit nicer than zone.polygon:contains(coords).
2022-04-27 17:09:32 +10:00
Linden a340c83e1a perf(zones): assign inside count and index to local
Reduce number of times the inside table needs to be indexed or have length checked.
Also assign debug zones to table without having to be inside the zone.
2022-04-27 17:07:24 +10:00
Linden cc770ada64 refactor(zones): change new to poly, default box rotation 2022-04-27 10:33:18 +10:00
Linden f651a91bf6 perf(zones): debug
Iterate polygon userdata directly, instead of creating a new table each frame.
2022-04-25 21:51:03 +10:00
Linden 94a460903d refactor(zones): perf, args, and insideZone
lib.zones.new should take a single argument containing all
data related to the new zone, then append new fields to the table.
No need for a distance check and 'nearby', instead check if player
is inside the polygon.
Use a function ref instead of closures for debug (drawPolygon).
2022-04-25 21:33:56 +10:00
Linden bf792004e9 fix(interface/progress): check for data.disable.move 2022-04-25 13:31:59 +10:00
Linden 3443475cc0 fix(loadFramework): call correct function after load 2022-04-22 15:33:22 +10:00
Linden d70fa5de82 fix(loadFramework): catch error during load 2022-04-22 15:29:20 +10:00
Linden 8c448db68d refactor(loadFramework): determine target based on resource state
Easier to work with out-the-box.
2022-04-22 15:28:24 +10:00
Linden 26fe012b55 refactor(interface/progress): disable controls
Last implementation was basically copied over from ox_inventory which used
the control actions wrapper; somewhat pointless in this case.
2022-04-22 14:32:40 +10:00
Linden 155dc617f8 refactor(points): support single argument for lib.points.new 2022-04-21 15:18:50 +10:00
Linden 877409486f refactor(resource/cache): remove commented code
Probably won't use this, but if I do then I'll add it when appropriate.
2022-04-21 15:09:42 +10:00
Linden 4464b0ec57 ci(release): create release workflow 2022-04-19 09:53:55 +10:00
Linden 84ad4abcca refactor(resource/version): checkDependency optional print and return
Send 'true' to match old behaviour (print message, return nil).
New behaviour has no output unless sending a third argument.
2022-04-19 01:09:22 +10:00
Linden f4e0739b04 fix(interface/textui): localise input 2022-04-18 23:30:58 +10:00
Linden e7ede94866 fix(points): remove tick value when clearing interval 2022-04-18 23:18:39 +10:00
Linden 65a5bab623 perf(points): use interval for on-frame thread 2022-04-14 14:50:27 +00:00
Linden 9a3b17029f refactor(resource/interface): keymapping and multi-prop support
Prop data should support a single table or an array for multiple
props.
2022-04-14 13:47:56 +00:00
Linden aaab5798c0 feat(resource/interface): progressActive and cancelprogress command 2022-04-14 13:11:51 +00:00
Linden 0a21924d39 feat(points): get closest point 2022-04-14 11:08:56 +00:00
Linden 21e0edd115 feat(points): remove points 2022-04-14 10:58:17 +00:00
Linden 7ea609ae91 Merge branch 'master' of https://github.com/overextended/ox_lib 2022-04-14 06:45:55 +00:00
Linden 0227bd11a6 feat(resource/interface): progress bar 2022-04-14 06:45:48 +00:00
Linden c7dafe56cd tweak(resource/cache): playerId, serverId, and micro 2022-04-14 06:44:34 +00:00
Linden 760f18653d tweak(resource/interface): register net event for lib.notify 2022-04-11 04:59:21 +00:00
Linden 1ac844f20a tweak(init): store serverId 2022-04-11 04:59:01 +00:00
Linden 84a456bf68 Merge pull request #12 from overextended/feat/ui
Feat/UI
2022-04-11 13:55:23 +10:00
Linden e842185382 feat(resource/interface): export notify 2022-04-11 03:52:25 +00:00
Linden 34310698bc feat(imports/loadFramework): loader for ox, qb, and esx
Deeply upsetting code that should probably be thrown into a fire.
2022-03-31 12:47:56 +00:00
Linden d30a355254 feat(acl): if principal is a number, reference player.num 2022-03-31 12:47:38 +00:00
Linden 5c94328b45 Merge branch 'master' of https://github.com/overextended/ox_lib 2022-03-30 12:33:10 +00:00
Linden d2441eb60a feat(logger): add datadog logging 2022-03-30 12:32:41 +00:00
Linden 13be3e7cdc Merge pull request #10 from xrtw/patch-1
GetVehicleXenonLightsColour -> GetVehicleXenonLightsColor
2022-03-30 22:21:01 +11:00
Linden c2bfb83816 fix(imports/points): incorrect var ref
Them feels when you forget to push a commit before making a release.
2022-03-25 10:58:46 +00:00
Linden 500315ddaa refactor(imports/points): rename point.callback to point.inside 2022-03-25 10:41:48 +00:00
Linden 3b18ca2b33 perf(imports/points): only insert into nearby if point uses callback 2022-03-25 10:38:32 +00:00
Linden 820beb5438 fix(cache): leftover print 2022-03-16 06:18:20 +00:00
Linden 913c51307a fix(cache): update seat when shuffling 2022-03-16 06:08:18 +00:00
Linden 33681a1557 feat(imports/points): onEnter method 2022-03-16 01:18:10 +00:00
Linden 62e4fea5ad refactor(init): set cache[key] after triggering onCache
Allow for comparison of new and old values by checking cache[key]
against the value sent as an argument.
2022-03-15 10:34:22 +00:00
Linden e971778b29 refactor(vehicleproperties): throw error for invalid or unowned entity 2022-03-15 06:52:40 +00:00
Linden 2ce934c41a feat(imports/points): distance checks and interaction api
WIP. Set callback functions when exiting and standing in range of
a set point. Primary callback is called on-frame and can be used
to check for key presses, distance, draw markers, etc.
2022-03-13 03:22:09 +00:00
Linden 35e4bc7509 perf(cache): check vehicle every second tick 2022-03-13 03:21:33 +00:00
Linden 13c8c29811 refactor: change event names from lualib to ox_lib 2022-03-13 03:21:01 +00:00
Linden f40accd9e8 Merge branch 'master' of https://github.com/overextended/ox_lib 2022-03-10 14:23:28 +00:00
Linden 3acc70f32a fix(callback): incorrect param definition 2022-03-10 14:23:25 +00:00
Linden 3c7cd3dc6b refactor(init): throw an error if ox_lib is not started 2022-03-10 15:54:13 +11:00
Linden 55c32d91f4 Update README.md 2022-03-04 11:15:47 +11:00
Linden 5c157db3e5 fix(callback): incorrect args in __call method 2022-03-04 10:35:14 +11:00
Linden 2a14391561 Merge pull request #9 from overextended/dev 2022-03-02 17:50:37 +11:00
Linden cdc7523146 fix(cache): ped not triggering update event 2022-03-02 02:28:10 +00:00
Linden 6b8b7990c8 fix(init): incorrect server check 2022-03-01 14:20:14 +00:00
Linden 5a30dd7ad1 fix(init): initial cache index returns full table 2022-03-01 13:58:08 +00:00
Linden a37a897b10 feat(init): callback hook when updating cache 2022-03-01 13:42:39 +00:00
Linden 58faab6217 feat(init): implement cache 2022-03-01 13:23:47 +00:00
Linden b37e9f772f refactor(cache): save seat index instead of driver 2022-03-01 13:22:52 +00:00
Linden f8d68df5e9 feat(cache): add lib.cache and update event 2022-03-01 12:28:04 +00:00
Linden adf08e44b8 chore: move files, add docs link 2022-03-01 10:55:46 +00:00
Linden 381935e844 Create FUNDING.yml 2022-03-01 21:39:34 +11:00
Linden 6aeda78428 fix(vehicleproperties): save correct tyre damage 2022-02-28 07:20:46 +00:00
Linden 4ae20d4dad refactor(imports/callback): new syntax
BREAKING!
2022-02-28 17:17:05 +11:00
Linden aeccbece09 refactor: rename imports
BREAKING!
Since the folder name determines the import name (i.e. lib.callbacks), use better names and lowerCamelCase.
2022-02-28 16:30:58 +11:00
Linden aceacbcdae Update README.md 2022-02-28 14:17:25 +11:00
Linden e83aa653cc refactor(init): call imports and exports via lib
Deprecate import (now just references lib); when calling or indexing
lib for the first time, attempt to load a module else call an export.
2022-02-28 02:40:25 +00:00
Linden 37032fe0dd feat(states): WIP handler for cacheing and setting states
Provide a centralised non-framework dependent interval to
track and perform tasks based on certain variables, such as
if the player is driving, in a vehicle, or walking.

Will later add a statebag change handler with callbacks, to
easily listen for state changes and use them in third-party
resources.
2022-02-28 00:49:44 +00:00
Linden 478cd93e97 feat(version): version and dependency checks 2022-02-28 00:49:24 +00:00
Linden d3ef7d5018 refactor: rename resource 2022-02-28 00:48:36 +00:00
Linden 40b7fe2a77 refactor(init): don't cache function refs 2022-02-28 08:35:32 +11:00
Linden 02ba40124e feat(commands): chat suggestions 2022-02-28 08:09:03 +11:00
Linden 75fa709200 feat(vehicleproperties): save broken windows, doors, and tyres 2022-02-28 08:08:22 +11:00
Linden 167938c7f1 feat(acl): add exports to set acl permissions
Needing to grant multiple resources permissions to use this commands is no bueno.
2022-02-28 08:07:52 +11:00
Linden 4c70dbe64d feat(exports/entities): persistent window state (smashed/intact) 2022-01-31 23:50:12 +11:00
Linden 12d42b6881 feat(exports/entities): vehicle properties 2022-01-31 22:47:54 +11:00
Linden 6125165acc Update README.md 2022-01-10 01:00:45 +11:00
Linden cd1ca12c33 Merge pull request #6 from tony-stark-17/master
Intervals Readme update
2022-01-09 07:03:51 +11:00
Linden 72575c90ee refactor(callbacks): remove the cb argument
BREAKING CHANGE: Registered callbacks now return values rather than sending them as a callback.

Previously the cb needed to be called to return to the client, now it will happen once the function closes. i.e.

cb(string, string, false) -> return string, string, false
2022-01-01 20:43:06 +11:00
Linden 2084897785 refactor(callbacks): randomise event callback and fix timer logic
Prevent any possibility of listening for server callback or conflicting event handlers on the client.
2022-01-01 02:26:42 +11:00
Linden b8ad392692 feat(commands): add a RegisterCommand wrapper 2021-12-30 02:25:29 +11:00
Linden d0c5f722db refactor(init): export cache and update intervals
BREAKING CHANGE: lib will store cached export functions and no longer uses the : syntax to call functions.

Allow SetInterval to return arguments to the callback function.
2021-12-27 12:19:37 +11:00
Linden 6b3af6f0d9 1.0.4 and onesync server constraint 2021-12-24 12:00:05 +11:00
Linden 1afc819f05 Merge pull request #5 from DokaDoka/patch-3
fix(resource/streaming): use hasLoaded properly
2021-12-24 11:58:58 +11:00
Linden ec1a98b83a feat(keys): implement a DisableControlAction wrapper 2021-12-06 09:54:45 +11:00
Linden d25cac3be4 Revert "feat(init): add custom packing for metatables"
This reverts commit 1ad137b8c5.

Prefer native solutions, this is too niche.
2021-12-05 04:58:48 +11:00
Linden 31404fbfce Revert "feat(mysql): add imports for oxmysql"
This reverts commit 2426a768a4.
2021-12-04 22:19:42 +11:00
Linden 4d51879afd refactor(init): metatables and micro-optimise
import now stores all imported modules and uses call and index methods to load modules.

Defining an import as before (local ServerCallbacks = import 'callbacks') works as before, or you can use ServerCallbacks = import.callbacks

You could also use a lazy loading method by never defining ServerCallbacks, i.e. import.callbacks.Register(...) will work without explicitly importing the module previously.
2021-11-28 18:04:09 +11:00
Linden 0ad0201ab2 chore: update readme 2021-11-25 01:21:22 +11:00
Linden 1ad137b8c5 feat(init): add custom packing for metatables
Adds lib.unpack and lib.pack functions to the global lib table.
2021-11-25 01:00:12 +11:00
Linden 9adbccd2f8 feat(init): implement interval
This is different from the one implemented in Ox ESX.
2021-11-25 00:56:07 +11:00
Linden e9f64c53e6 feat(table): add recursive clone function
table.clone creates a soft copy of an existing table (any tables inside the table will still be references).

This sets up a basic loop to clone any tables within a table and create deep copies.
2021-11-22 08:55:43 +11:00
Linden 90c0911c55 Merge pull request #3 from DokaDoka/patch-1
fix(resource/streaming): use correct variable names
2021-11-18 01:15:15 +11:00
Linden 6c2658c302 feat(resource/streaming): timeout functions after 20 ticks 2021-11-17 03:37:59 +11:00
Linden 55a857fbf8 chore: vscode is dumb
all these spaces make a tab
2021-11-16 19:37:36 +11:00
Linden ede02fb1b4 feat(resource): setup streaming exports and placeholders
Naturally I have not tested any of these.
2021-11-16 11:16:34 +11:00