Skip to content

Commit

Permalink
#2585 Fixed tooltips showing changes that other people have done
Browse files Browse the repository at this point in the history
  • Loading branch information
Wotuu committed Nov 6, 2024
1 parent 215d342 commit 1d3bf3a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion resources/assets/js/custom/mapcontrols/echocontrols.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions resources/assets/js/custom/mapobjectgroups/mapobjectgroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
Expand Down

0 comments on commit 1d3bf3a

Please sign in to comment.