Commit Graph

65 Commits

Author SHA1 Message Date
James Lyne
aaf4ee630d Precalculate bounds for path markers 2022-01-16 21:18:48 +00:00
James Lyne
42e553bda7 Marker storage/display improvements
- Store markers of all types for a marker set in a single map
- Merge all marker type components into a single Markers component
- Add marker type prefixes to dynmap marker ids to ensure they remain unique
- Add id and type properties to marker objects
- Remove now-unused update handler for specific marker types
2022-01-15 15:45:59 +00:00
James Lyne
9abd96ccb1 Overhaul marker update handling
- Renamed pendingSetUpdates to pendingMarkerUpdates
- pendingMarkerUpdates is now a simple array of LiveAtlasMarkerUpdates
- Added separate ADD_MARKER_UPDATES mutation for marker updates
- Set updates via ADD_MARKER_SET_UPDATES are applied immediately and not stored in state
- Removed all marker pop actions and mutations except POP_MARKER_UPDATES, which now returns all marker types
- Added centralised markup update handler in markers.ts, replacing much of the logic in the individual marker type components. Allows additional handlers to be registered for specific marker sets and types
2022-01-15 00:07:25 +00:00
James Lyne
61b6b820aa Combine buildArea/buildRectangle in Pl3xmapMapProvider 2022-01-14 20:52:37 +00:00
James Lyne
e800b9fb73 Pl3xmap tooltip fixes 2022-01-14 20:11:43 +00:00
James Lyne
b3a685e003 Add location property for all marker types
Areas/lines will calculate a center point to use for their location
2022-01-14 20:11:43 +00:00
James Lyne
234b2d0a6b Store plain text version of HTML marker tooltip content 2022-01-14 13:53:43 +00:00
James Lyne
9c74d7b163 Marker changes
- Merge marker label/tooltipContent
- Rename tooltipContent/popupContent to tooltip/popup
- Set tooltip from label for all dynmap marker types
2022-01-13 16:07:27 +00:00
James Lyne
7cd21a19e2 Rename marker types for clarity
- Add "Marker" suffix
- Rename regular marker to "PointMarker"
2022-01-13 14:14:11 +00:00
James Lyne
ff77f09025 Move marker set contents outside the store, other small optimisations.
Improves marker set creation performance by avoiding traversal of all markers when watching the marker set.

Various other small changes to reduce allocations when creating markers
2022-01-11 16:08:30 +00:00
James Lyne
27231ff5ff Fix config hash handling in update response 2021-12-23 21:53:38 +00:00
James Lyne
fd0e11fac0 Handle pl3xmap world ordering 2021-12-10 16:36:32 +00:00
James Lyne
cbd6c7f3b9 Handle pl3xmap world default zoom 2021-12-10 15:54:55 +00:00
James Lyne
2ab03f8fde Handle pl3xmap player update interval 2021-12-10 15:54:30 +00:00
James Lyne
5a778828f8 Initial version of pl3xmap player facing. Closes #129 2021-12-09 01:13:23 +00:00
James Lyne
0c87849356 Use @types/dynmap where possible (Closes #224) 2021-11-12 00:22:52 +00:00
James Lyne
6c0837deae Improve session expiry handling
- Reload configuration and show login dialog when any request fails with "login required"
- Current map position etc is lost, more work needed here
2021-09-30 20:13:23 +01:00
James Lyne
8f794d044f Support Pl3xmap custom world icons 2021-09-30 15:04:01 +01:00
James Lyne
ca1d90a739 Remove unused world/map properties 2021-09-30 13:16:39 +01:00
James Lyne
daee15dd3f Fix various issues with Pl3xmap world/map creation 2021-09-29 21:35:26 +01:00
James Lyne
dc479ca6e8 Support disabling player images in player list
- showplayerfacesinmenu in Dynmap
- Player image is removed entirely rather than mirroring Dynmap behaviour of showing a Steve head, to be consistent with player markers and chat.
- Images are also disabled in FollowTarget
2021-09-29 21:16:31 +01:00
James Lyne
bf383afb8d Support disabling player marker images
- showplayerfaces: false in Dynmap, player-tracker.nameplate.show-head: false in Pl3xmap
- Remove showSkin option in favour of 'none' image size
2021-09-29 19:58:39 +01:00
James Lyne
58199aaed0 Use large player image on Pl3xmap when both health/armor are enabled 2021-09-29 14:56:13 +01:00
James Lyne
66355dfe38 Decouple player image pixel size from PlayerMarker.
- Use single template image and set size after cloning
- Use util method to retrieve pixel size when needed
- Use LiveAtlasPlayerImageSize in getMinecraftHead
2021-09-29 14:33:52 +01:00
James Lyne
770c9242a8 Player marker improvements
- Use <meter> for health/armor
- Condense small/body image properties into single image size option
- Remove image-size dependant margins
- Add circle alongside label for indicating player position
2021-09-29 01:30:35 +01:00
James Lyne
bfc0a381a8 Respect pl3xmap show-armor setting 2021-09-28 18:54:51 +01:00
James Lyne
c71e8289dd Only fetch Pl3xmap players when player markers are enabled 2021-09-28 18:38:34 +01:00
James Lyne
98d7ede3d9 Remove extra / from Pl3xmap players URL (Closes #125) 2021-09-28 13:32:42 +01:00
James Lyne
bfd2b4083f Fix type errors 2021-09-12 20:37:51 +01:00
James Lyne
83bc0ec86d Freeze/seal marker related objects in Pl3xmap provider 2021-09-10 15:31:05 +01:00
James Lyne
8bf0fe04a7 Split DynmapMapProvider build methods into their own file 2021-09-10 15:30:29 +01:00
James Lyne
63a00d0681 Move loginEnabled logic to store getter 2021-09-08 15:23:21 +01:00
James Lyne
0e57a50e0c Cleanup redundant useStore calls 2021-09-08 15:21:27 +01:00
James Lyne
12632004d1 Move loginRequired state into store, reset login related state in RESET 2021-09-07 23:10:57 +01:00
James Lyne
46c9468214 Remove some debug logging 2021-09-01 18:42:26 +01:00
James Lyne
76f151a64c First attempt at login/register 2021-08-30 22:28:20 +01:00
James Lyne
b426ed3cae Refactor fetch logic
- Add credentials: include
- Allow passing arbitrary options to fetch, and rename existing simple get to getJSON
2021-08-30 22:28:19 +01:00
James Lyne
e41a841bdb Don't make sendChatMessage abstract 2021-08-30 22:28:19 +01:00
James Lyne
280e036276 Basic support for Pl3xmap tile update interval 2021-08-13 23:51:03 +01:00
James Lyne
6aa9aaf2bd Only set config hash if present in update response
Prevents infinite reloading if the update response doesn't contain a hash for some reason
2021-08-03 02:26:43 +01:00
James Lyne
eba8a5b7e1 Fix incorrect player head URL (Fixes #2) 2021-08-02 17:12:29 +01:00
James Lyne
f4aca39975 Fix incorrect Dynmap player head URL generation 2021-07-29 19:05:33 +01:00
James Lyne
38946d7015 Initial pl3xmap support 2021-07-29 18:06:19 +01:00
James Lyne
8151dfaab5 Make followZoom optional 2021-07-28 23:52:51 +01:00
James Lyne
b3f186a197 Move grayHiddenPlayers to playerMarkers component 2021-07-28 23:52:03 +01:00
James Lyne
7bff12b729 Move maxPlayers to separate field in store, add mutation 2021-07-28 23:50:59 +01:00
James Lyne
4feb46c641 Move player count/max into playersHeading 2021-07-28 22:27:43 +01:00
James Lyne
d04226e3ec Refactor popup handling
- Merge label and popupContent properties for vector layers, as only one is ever used
- Move common vector methods to separate file and remove duplicates
- Rename isHTML properties to be clearer
2021-07-28 17:49:38 +01:00
James Lyne
2a216dd4e8 Path performance improvements
- Avoid intermediate objects when creating leaflet objects to reduce allocations
- Make individual path objects non-reactive
- Avoid projecting path points twice during updates
2021-07-28 04:04:47 +01:00
James Lyne
9517de0760 Path point handling changes
- Store path points as {x,y,z} objects instead of separate arrays
- Project point objects right before layer creation
- A bit slower overall but matches the format of Pl3xmap path points.
2021-07-28 04:04:46 +01:00