Commit Graph

73 Commits

Author SHA1 Message Date
DokaDoka
14ce365de1 fix(zones): thickness workaround
thickness is calculated incorrectly by glm.polygon.contains so this is required until it is fixed
2022-05-14 12:34:12 +10:00
Linden
139ae0701b refactor(getCore/client): clean up hasGroup method and return values 2022-05-12 07:44:29 +10:00
Linden
4575b5e02a refactor(player): simplify
Was planning to support checking other user playerdata, but will
require much more planning to implement properly.
2022-05-12 07:41:12 +10:00
Linden
5d1f6019c7 feat(getCore/client): load and extend player class 2022-05-12 01:55:21 +10:00
Linden
df8115ea8c feat(player/client): player class and methods
Provide a couple of helper methods (more to come).
2022-05-12 01:55:06 +10:00
DokaDoka
6a8ebb5a0d chore(zones): rearrange variables 2022-05-11 13:38:27 +10:00
DokaDoka
2a1ae2e287 feat(zones): consistent zone debug appearance
through merging debugPoly and debugBox
2022-05-11 13:36:36 +10:00
DokaDoka
38dbc2ac34 refactor(zones): create data.triangles even if the polygon is convex 2022-05-11 13:34:06 +10:00
DokaDoka
9b5ac35ab3 refactior(zones): make makeTriangles available outside of getTriangles 2022-05-11 13:29:18 +10:00
Linden
7a4745c0da chore(zones): adjust debug rgba 2022-05-10 15:29:07 +10:00
Linden
55bfa7ca3d refactor(zones): global Zones 2022-05-07 11:47:39 +10:00
Linden
ce3f916c42 refactor(zones): centroid -> coords
While centroid is a more accurate term, coords is a little simpler when
writing it a million times.
Prefer to use a single term (sphere was using coords) to simplify API.
2022-05-07 11:19:27 +10:00
Linden
d4b5e0402c refactor(server/locale): get array of valid locales 2022-05-06 16:37:36 +10:00
Linden
d3718622cf feat(zones): sphere zone
It's just a distance check and works exactly like lib.points, with some
minor API changes for consistency.
2022-05-06 14:28:45 +10:00
Linden
4555fa0a22 refactor(zones): call zone:contains instead of zone.polygon:contains
Added this function earlier but forgot to include thickness, so
it didn't work.
2022-05-06 14:26:56 +10:00
Linden
96eabf5592 refactor(imports/getCore): set constants and use new import files 2022-05-04 06:33:32 +10:00
Linden
c5bdaaafe8 refactor(imports/getCore): create import files for esx and qb 2022-05-04 06:33:32 +10:00
Linden
a3f38723e3 refactor(getCore): rename loadFramework, tweaks
ESX imports are limited to an event and getSharedObject export.
In the future I want to introduce some generic functions to simplify
cross-framework compatibility
when working with player, accounts, inventories, and groups (jobs/gangs).
2022-05-01 22:51:59 +10:00
DokaDoka
18f55ffefe refactor(zones): handle multiple points in the same horizontal line
- new intersection points are generated per vertical coord present in the original polygon rather than per vertex and are grouped together rather than associated directly with the parent
- hopefully better code structure and organisation for the entire triangle generating section
2022-05-01 12:49:56 +10:00
Linden
48728f0241 feat(locales): include some locales
Partial, and google translated just for the sake of setting an example.
Also renamed many of the language codes where the extra characters are
redundant (i.e. fr-FR, de-DE).
2022-04-30 05:04:15 +10:00
Linden
031cccd886 fix(locale): server hotload and "external" kvp
External kvp's don't exist for the server, so we have to export the proper language.
2022-04-29 16:53:24 +10:00
Linden
8af19bae42 feat: locale system 2022-04-29 05:56:41 +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
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