Commit Graph

397 Commits

Author SHA1 Message Date
DokaDoka
65787d3b6d fix(zones): draw complex polygons properly
convex polygons are split into triangles more simply
complex polygons are split into trapezoids and then triangles to be drawn
2022-04-29 00:41:21 +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
DokaDoka
de201dcf03 feat(zones): box
streamlined rectangle polygon creation for the lazy, with rotation
2022-04-26 23:06:23 +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
DokaDoka
adb110d8d8 feat(imports/zones): basic glm polygon zones
build on the points structure
2022-04-25 20:28:10 +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
155dc617f8 refactor(points): support single argument for lib.points.new 2022-04-21 15:18:50 +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
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
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
d2441eb60a feat(logger): add datadog logging 2022-03-30 12:32:41 +00: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
33681a1557 feat(imports/points): onEnter method 2022-03-16 01:18:10 +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
3acc70f32a fix(callback): incorrect param definition 2022-03-10 14:23:25 +00:00
Linden
5c157db3e5 fix(callback): incorrect args in __call method 2022-03-04 10:35:14 +11: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
02ba40124e feat(commands): chat suggestions 2022-02-28 08:09:03 +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
ec1a98b83a feat(keys): implement a DisableControlAction wrapper 2021-12-06 09:54:45 +11:00
Linden
31404fbfce Revert "feat(mysql): add imports for oxmysql"
This reverts commit 2426a768a4.
2021-12-04 22:19:42 +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
7c41ac5d6e refactor(table): revert to old match function
Going to need some work to accurately compare some table types, but this is better for the intended purpose.
2021-11-14 03:43:06 +11:00
Linden
6aede19f4e fix(table): correctly check if table contains value for non-tables
Only strings were allowed through this initial check, but we want non-table values to check if v = value.
2021-11-14 01:42:36 +11:00
Linden
5a925695bc refactor(table): change match to matches 2021-11-12 10:26:49 +11:00
Linden
901cb381b4 feat(table): add functions to the standard table lib
Can overwrite the default table functions with `table = import 'table'`, adding functions to check if value(s) exist or match a table.
2021-11-12 10:16:16 +11:00
Linden
a1d3dd31a3 chore: update information 2021-11-11 18:23:07 +11:00
Linden
2426a768a4 feat(mysql): add imports for oxmysql
Similar to the mysql-async style library included with oxmysql., but without the aliases.
2021-11-11 18:18:17 +11:00
Linden
827ce1a223 chore: readme 2021-11-11 08:18:06 +11:00
Linden
9a60f3bd1d chore(callbacks): update annotations 2021-11-11 07:56:15 +11:00
Linden
ab4807fee0 refactor: remove modules system and fix indentation
Setting a "standard" module and resource structure is too limiting, so stick to import only.
2021-11-11 07:52:38 +11:00
Linden
7b3062f6e1 fix(callbacks): Resolve promise arguments 2021-10-30 16:18:42 +11:00
Linden
bc5c7ad209 Add files via upload 2021-10-30 15:58:25 +11:00