Linden
250cd56896
fix(callback): return types
2023-02-06 13:22:19 +11:00
Linden
97d5bd6ac0
fix(client/progress): anim task/scenario check
...
Correct behaviour from pull request #208 .
Include some refactoring to reduce repetitive table indexing.
2023-02-03 13:25:30 +11:00
Linden
1565187860
refactor(init): change notify netevent name
...
Other name was too generic and may conflict with user-code.
2023-02-03 13:04:48 +11:00
Linden
a8b9f8cde5
fix(locale/shared): phrase-construction for strings without placeholders
...
string.gsub returns two variables, the updated string and the pattern occurrences.
The outer string.gsub would replace n occurrences, or nothing if the string did not
contain '%'.
2023-02-01 03:20:04 +11:00
Linden
6fbdd49702
fix(shared/locale): only construct phrases for strings
2023-01-16 18:18:51 +11:00
Linden
fd5bd066ab
feat(shared/locale): locale phrases
2023-01-08 15:24:36 +11:00
Linden
012b68a3be
fix(client/zones): remove all zone references
...
Should resolve #191 .
2022-12-30 21:07:32 +11:00
Linden
6a704c40fe
refactor(client/zones): re-order zones and call onExit before onEnter
...
insideZones will be stored as a map rather than an array for simplicity.
Store zones the player is entering and exiting, then sort based on distance;
always triggering onExit for all zones before onEnter.
See #179 .
2022-12-24 16:08:21 +11:00
Linden
b688b98bba
fix(client/raycast): missing table
...
This was broken with 26538b8
2022-12-20 17:54:59 +11:00
Linden
0ea5725b86
refactor(imports/getCore): add removal notice
...
Was deprecated ~3 months ago, will be removed in the next large update.
2022-12-20 08:22:14 +11:00
Linden
511241e03c
refactor(client/points): ensure coords are a vector
2022-12-20 08:09:35 +11:00
Linden
08a725105b
fix(client/zones): disable marker rotation
2022-12-17 06:21:22 +11:00
Linden
ccad59fcf6
fix(server/logger): validate response on failed http request
...
One person is receiving a CURL error rather than a response from
datadog, leading to a nil index.
We'll also use the newly supported "warn" function.
2022-12-15 11:24:08 +11:00
Linden
b50c0b7df8
fix(client/context): reset focus
...
Should resolve #170 but ceebs testing
2022-12-13 08:37:56 +11:00
Linden
8abc416dad
feat(package): TS callback events
2022-12-13 08:26:43 +11:00
Linden
124a5f15ba
refactor(imports/callback): response varargs
...
Trying to have scrt compatible responses gets weird when using
msgpack.
2022-12-13 08:26:43 +11:00
Linden
d9511231b1
refactor(client/progress): move controls outside of function
2022-12-06 13:33:04 +11:00
Linden
ca38dd61ca
fix(resource): set cache.game
...
Property was only set for imported modules.
2022-12-06 13:30:24 +11:00
Linden
ed7c04ac9c
refactor(client/raycast): change los flags
2022-11-26 02:02:02 +11:00
Linden
f96cb13ff4
refactor(client/addKeybind): save control hash
2022-11-24 17:31:03 +11:00
Linden
ba635b91e7
fix(client/addKeybind): get control button when indexing currentKey
...
Changing the key binding for a command invalidates the previous result from
GetControlInstructionalButton. Use an index metamethod for backwards
compatibility and add the getCurrentKey method.
2022-11-24 17:16:57 +11:00
Linden
289fa0ac69
chore(.gitignore): merge files
2022-11-24 17:02:03 +11:00
Linden
3d90d91552
Merge pull request #160 from D4isDAVID/update-locales
...
feat(locales): update Russian & add Hebrew
2022-11-23 21:53:22 +11:00
Linden
00c2086072
refactor(streaming): convert to modules
...
Import methods rather than call via exports.
2022-11-21 21:39:05 +11:00
Linden
6825103dd5
fix(resource): don't export internally loaded modules
...
i.e. exports.ox_lib:callback is invalid
2022-11-21 21:39:05 +11:00
Linden
d2799075ad
fix: types and nil-checks
2022-11-21 21:39:05 +11:00
Linden
ce5697f3b2
feat(zones): add basic zone support to the server
...
Quick and dirty with many features stripped (onEnter/onExit/inside).
2022-11-16 23:07:53 +11:00
Linden
9b7eef2880
fix(client/zones): convert vector4 to vector3
...
Sometimes people send the incorrect types, and it's apparently on us (???)
to allow them to do the wrong thing and catch their mistakes for them.
2022-11-09 16:04:03 +11:00
Linden
e840bbb50f
refactor(init): report ox_lib error when loading imports
...
People like to cry about resources not working because they
failed to install ox_lib and don't know how to read, missing the
fat error and stack trace on resource start.
Now we can remind these people they need to actually install
a release.
2022-10-28 18:46:56 +11:00
Linden
97c18f0c6b
refactor(resource): export load error
2022-10-28 18:45:47 +11:00
Linden
646473f755
fix(client/cache): GetVehiclePedIsIn
...
Native was swapped out due to a bug R* introduced.
It hasn't been a problem for months and this native is safer.
2022-10-28 00:32:18 +11:00
Linden
a2014502d5
refactor(addCommand): send raw input to callback
...
Resolves #101 , just use a pattern or split the string.
2022-10-25 03:09:12 +11:00
Linden
03dcf14f7e
fix(callback): multi-return values for callback method
...
Resolves #136
2022-10-25 03:03:03 +11:00
Linden
541e708970
refactor(addKeybind): move RegisterCommand to top
2022-10-25 02:58:39 +11:00
Linden
2bb0d68415
fix(callback): bad argument to unpack when callback throws error
...
Throwing an error responds with false rather than a string.
2022-10-19 20:20:38 +11:00
Linden
d5437e070c
chore(interface/skillcheck): types
2022-10-18 20:03:00 +02:00
Linden
ec18bbf34a
fix(locale): setLocale
2022-10-19 04:14:36 +11:00
Linden
671be5e7a2
refactor(locale): simplify
...
BREAKING CHANGE (kind of)
Remove user-selection for locales. Adds mostly unnecessary complexity,
and most people don't want to bother with it anyway.
Locale is always based on the convar "ox:locale" instead.
2022-10-18 21:17:26 +11:00
Linden
5b2c74afa0
refactor(addKeybind): improve types
2022-10-16 12:49:47 +11:00
Linden
01b4c53a9d
fix(keybinds): typo
2022-10-14 11:46:06 +11:00
Linden
7355d9ef25
refactor(keybinds): formatting and tweaks
2022-10-14 11:01:57 +11:00
Linden
2c7e812eaf
refactor(logger/server): cleanup
...
DRY
2022-10-11 00:40:40 +11:00
Linden
79dd3f5934
fix: no-op
2022-10-10 16:56:05 +11:00
Linden
988836dcb7
feat(server/logger): add player data to tags
2022-10-09 01:57:02 +11:00
Linden
f5d0deeb21
refactor(server/logger): batch log submissions
...
Create a temporary table and submit logs in a single batch after 500ms.
Includes some micro-optimisation and a new convar to set logging service.
2022-10-09 00:24:49 +11:00
Linden
b05594e77f
fix(callback): pack nil values
...
See #117
2022-10-08 22:20:46 +11:00
Linden
0e9ad23fb3
fix: types
2022-10-02 20:19:35 +11:00
Linden
e624aa2559
fix(version): split and compare semver in 3 parts
...
'11.10' is equal to '11.1' cause maths.
2022-09-29 17:14:11 +10:00
Linden
5c028759f3
fix(client/vehicleProperties): livery getter
2022-09-22 15:05:23 +10:00
Linden
025a8eb168
tweak(client/points): set point.isClosest
2022-09-21 01:51:17 +10:00
Linden
4657de6470
fix(package/cache): check if cached value is defined
2022-09-18 22:53:04 +10:00
Linden
21214728b7
refactor(init): module stub
...
If module doesn't return a result, create a stub function.
2022-09-18 22:42:05 +10:00
Linden
f1671f14bc
fix(imports/player): return function
2022-09-18 22:41:25 +10:00
Linden
0e1dfc78ba
refactor(resource/vehicleProperties): type fixes
2022-09-18 11:33:17 +10:00
Linden
d08101c545
refactor(resource/vehicleProperties): typings and formatting
2022-09-18 11:25:07 +10:00
Linden
6254ba9ba2
refactor(resource/interface): formatting and type definitions
2022-09-18 09:06:32 +10:00
Linden
cb645ae345
Merge pull request #97 from overextended/npm-package
...
Npm package
2022-09-18 08:45:59 +10:00
Linden
c9dd07a936
fix(package): checkDependency type
2022-09-18 08:12:16 +10:00
Linden
7476505ee7
refactor(package): import shared and declare cache in server/client
2022-09-18 08:11:25 +10:00
Linden
6adbf61797
Merge pull request #99 from jag3dagster/feat-menu-open-menu-select-index
...
feat(menu): Add option to open menu with specified item index selected
2022-09-18 06:51:08 +10:00
Linden
95dd3b1838
feat(package): cache
2022-09-18 00:48:04 +10:00
Linden
1dbfd01f48
fix(package): getVehicleProperties param
2022-09-18 00:07:58 +10:00
Linden
cd8e4bbd4d
fix(client/zones): yet another debug fix
...
Because a zone vanishing upon entry is of no use.
2022-09-17 18:21:38 +10:00
Linden
863ac03ca3
refactor(imports): more type fixes
2022-09-14 16:12:43 +10:00
Linden
3084265bbb
refactor(server/zoneCreator): output format and path, security fix
...
Don't allow players to trigger ox_lib:saveZone without ace permissions.
Write created_zones to root.
Use explicit vectors and set name as a string.
2022-09-14 15:19:01 +10:00
Linden
c95fd8ecf4
refactor(client/zoneCreator): create temporary thread
...
Move the on-tick thread into the startCreator function, and kill it once
creatorActive is set to false.
2022-09-14 15:15:36 +10:00
Linden
032e0e2db1
fix(client/zones): CZone.contains return type
2022-09-14 08:12:12 +10:00
Linden
62d56fa885
refactor(client/zones): add types and change indentation
2022-09-14 08:08:00 +10:00
Linden
9a17b9bac5
perf(client/points): apply optimisations used in zones
...
"SphereZones" are really just points with some extra overhead, but the module
had some overall improvements to improve performance.
Includes type definitions for sumneko.
2022-09-14 07:45:03 +10:00
Linden
32e2da2d8f
refactor(init): type-fixes and minor adjustments
2022-09-14 01:42:14 +10:00
Linden
26538b8148
refactor(imports): assign modules directly to lib namespace
...
Mostly a change for improved intellisense with sumneko lua.
Includes some type fixes and deprecation notices.
2022-09-14 01:20:50 +10:00
Linden
107d812dc3
refactor(client/zoneCreator): restrict command access
...
Includes fix for zone name.
2022-09-14 00:56:56 +10:00
Linden
bac9eb576d
feat(client/resource): RegisterCommand wrapper
...
All these tweaks so we can check ACL for client commands.
2022-09-14 00:54:44 +10:00
Linden
9d8584ff9e
feat(server/acl): add ox_lib:checkPlayerAce as callback
2022-09-14 00:53:50 +10:00
Linden
ed7bf536e8
feat(resource): load callbacks
...
Load lib.callback for internal use.
2022-09-14 00:52:10 +10:00
Linden
0ccdf5675c
fix(client/zones): scuffed ternary
...
Since Lua "ternary" expressions run until they have a truthy value,
boxzone and polyzone will try compare distance to radius.
2022-09-11 12:27:23 +10:00
Linden
57187c8c30
perf(client/zones): reduce overhead
...
In a naive test with 10k sphere zones vs points, zones ran 0.02~0.04ms higher.
Overhead is roughly halved with these tweaks.
2022-09-11 12:06:30 +10:00
Linden
be8b740937
feat(client/points): set cache.coords
...
See last commit description.
2022-09-11 11:08:26 +10:00
Linden
77ff8e977b
feat(client/zones): set cache.coords
...
People keep asking for coords to be added to cache, but it be problematic
to spam the events system every tick with that information.
If zones is loaded, we can set cache locally without relying on events.
2022-09-11 11:06:38 +10:00
Linden
99b146d7b9
fix(client/zones): zone triggers twice when inside and debug is enabled
...
Zones would be added to the temporary array twice, so callback functions
and the zone draw would trigger twice.
2022-09-11 11:02:04 +10:00
Linden
5d71c4efdf
fix(client/zones): debug erroneously triggers zone:inside
...
Should only trigger when the player is, in fact, inside the zone.
2022-09-02 22:23:24 +10:00
Linden
3a97a0c569
fix(client/zones): convert tables to vectors
...
Ensure tables (either array or map) set as points, coords, or size are
converted into vectors.
Includes complementary reformatting.
2022-08-30 02:58:41 +10:00
Linden
2a1815c460
tweak(callback): error handling
...
Errors during callbacks will never respond, so we'll use a protected call
and format the error message with a normal print to keep the thread
alive.
2022-08-25 18:49:07 +10:00
Linden
bdb88e74c5
fix(version): properly compare minor/patch semver
...
Comparing "2.7.4" to "2.10.1" would compare each number, i.e.
2 = 2,
7 < 10,
4 > 1
Instead compare the major (2 v 2), then minor.patch (7.4 v 10.1).
where doka to do my math
2022-08-23 19:29:45 +10:00
Linden
1ea4b16c8b
fix(client/interface): set openMenu to nil before triggering callbacks
...
Callbacks may open another menu, which then gets set to nil after
the callback has returned.
2022-08-23 19:12:50 +10:00
Linden
6fc1efdda1
feat(ci): version bumper
2022-08-23 04:50:52 +10:00
Linden
4578d54c5e
fix(client/interface): progressbar props not deleted
...
Somehow, calling DetachEntity before DeleteEntity results in the
entity not being deleted (when oal is enabled).
Fortunately we don't need to detach it before deleting.
2022-08-23 04:30:58 +10:00
Linden
f5c5597277
fix(version): compare semver numbers
...
Values were being compared as whole strings.
2022-08-22 20:53:55 +10:00
Linden
a0bea87dfa
fix(client/vehicleProperties): store neons as an array
...
People normally complain about the most nonsensical non-issues; yet
this one was completely left alone; or more specifically, one person
attributed the issue to ox_lib but didn't bother to report the issue or
provide a fix, instead just
complaining that "ox_lib is constantly updating".
2022-08-20 12:55:07 +10:00
Linden
8c8da4b119
refactor(raycast/client)!: use new native (GetWorldCoordFromScreenCoord)
...
This native got merged days after I pushed the raycast function. This will break
scripts relying on this function (doubt there's many, if any).
2022-08-18 01:58:54 +10:00
Linden
274f2542a8
Update README.md
2022-08-15 20:48:37 +10:00
Linden
46a525e057
fix(zones/client): debug DrawPoly and DrawLine
...
Debug for boxes broke with the oal fixes, since vectors don't unpack.
Also fixes flicker when entering a debug zone.
2022-08-13 17:08:39 +10:00
Linden
231ca90b8f
fix(zones/client): do not overwrite zone.distance with contains
...
Manually calling the contains method would overwrite zone distance.
Also move Wait to the end of the thread to prevent race conditions.
2022-08-10 23:45:48 +10:00
Linden
c3726ed924
tweak(interface/menu): SetNuiFocusKeepInput
...
Default to allow input; disable with "disableInput = true" during registration.
2022-08-09 07:42:20 +10:00
Linden
2e77817c41
refactor(interface/menu): set openMenu to reference menu data, not id
...
No need to index registeredMenus[openMenu] repeatedly.
2022-08-08 17:54:50 +10:00
Linden
245af3df41
refactor(callback): types
2022-08-08 17:16:57 +10:00
Linden
101d94392b
refactor(client/interface): micro-optimise menu callbacks
...
Remove short-lived objects and set local refs to the openMenu to reduce table-lookups.
2022-08-05 00:58:19 +10:00
Linden
f122c6e3ea
feat(imports): getNearbyPlayers
2022-08-05 00:45:10 +10:00
Linden
c662368cd4
fix(client/interface): changeSelected args
2022-08-04 15:04:49 +02:00
Linden
28003c942d
fix(client/streaming): invalid print argument
2022-08-04 02:05:09 +10:00