From 1d3bf3a7fb40b23202dcb71add154429cb9bc036 Mon Sep 17 00:00:00 2001 From: Wotuu Date: Wed, 6 Nov 2024 17:36:04 +0100 Subject: [PATCH] #2585 Fixed tooltips showing changes that other people have done --- .../messagehandler/listen/models/brushline/deleted.js | 1 - resources/assets/js/custom/mapcontrols/echocontrols.js | 8 +++++++- .../assets/js/custom/mapobjectgroups/mapobjectgroup.js | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/resources/assets/js/custom/echo/messagehandler/listen/models/brushline/deleted.js b/resources/assets/js/custom/echo/messagehandler/listen/models/brushline/deleted.js index f4317bf50..05de703bf 100644 --- a/resources/assets/js/custom/echo/messagehandler/listen/models/brushline/deleted.js +++ b/resources/assets/js/custom/echo/messagehandler/listen/models/brushline/deleted.js @@ -14,7 +14,6 @@ class BrushlineDeletedHandler extends ModelDeletedHandler { console.log(`BrushlineDeletedHandler::onReceive: ${e.model_id} ${e.model_class}`); if (shouldHandle) { - let brushlineMapObjectGroup = this.echo.map.mapObjectGroupManager.getByName(MAP_OBJECT_GROUP_BRUSHLINE); let mapObject = brushlineMapObjectGroup.findMapObjectById(e.model_id); diff --git a/resources/assets/js/custom/mapcontrols/echocontrols.js b/resources/assets/js/custom/mapcontrols/echocontrols.js index cce8df02e..5c266300b 100644 --- a/resources/assets/js/custom/mapcontrols/echocontrols.js +++ b/resources/assets/js/custom/mapcontrols/echocontrols.js @@ -275,7 +275,13 @@ class EchoControls extends MapControl { .echo_user_${user.public_key} { border: 3px ${getState().getEcho().getUserColor(user.public_key)} solid !important; border-radius: 16px; - }`) + } + + .echo_user_${user.public_key}_tooltip { + background-color: ${getState().getEcho().getUserColor(user.public_key)}; + } + + `) .appendTo('head'); // Update the text color depending on the luminance diff --git a/resources/assets/js/custom/mapobjectgroups/mapobjectgroup.js b/resources/assets/js/custom/mapobjectgroups/mapobjectgroup.js index e67680b68..d6aebf05b 100644 --- a/resources/assets/js/custom/mapobjectgroups/mapobjectgroup.js +++ b/resources/assets/js/custom/mapobjectgroups/mapobjectgroup.js @@ -319,7 +319,7 @@ class MapObjectGroup extends Signalable { let oldTooltipLayerId = layer._leaflet_id; let tooltip = layer.bindTooltip(user.name, { - permanent: true, className: `user_color_${user.public_key} ${fontClass}`, direction: 'top' + permanent: true, className: `echo_user_${user.public_key}_tooltip ${fontClass}`, direction: 'top' }); // Fadeout after some time @@ -333,7 +333,7 @@ class MapObjectGroup extends Signalable { // Rebind killzone pull index tooltip localMapObject.layer.bindTooltip(oldTooltip._content, oldTooltip.options); } - }, c.map.echo.tooltipFadeOutTimeout); + }, c.map.echo.tooltipFadeOutTimeoutMs); } else { console.warn('Unable to display echo received action to user, layer was null', localMapObject); }