Skip to content
Version 2.35.0
↓ Get the launcher

IChatPositionShare interface

Map-position chat links: share the local player’s position the way the game’s chat “Location” tab does, and follow a received position link the way clicking it in the game’s chat does. Reached through IChat (services.Chat.SharePosition(...)), which inherits it. Since framework 2.35.0.

Main thread only — every member drives the game’s Lua. Call from a UI handler, Update or Post; off-thread calls return WrongThread and do nothing. These are user-action calls (a button press), not something to poll every frame.

public interface IChatPositionShare
name description
GetSharePosition() Reads what SharePosition would send now — scene, line, rounded coordinates, layer, scene name — and whether this map allows sharing. One short Lua call; fine to refresh a few times a second while a share UI is open, not every frame.
SharePosition(…) Shares the local player’s current position to target as a real game position link (the server builds the link message; every client — this one included — receives it as a hypertext chat message with Kind = Position). textBefore is optional text shown before the link (rich tags except <sprite=N> are stripped).
TrackPosition(…) Does what clicking a position link in the game’s chat does: sets a map waypoint on position and opens the map (no teleport, no server call). Refused when the target map is locked for this character or can’t be navigated to from here (the game then shows its own tip as well, as for a native click; the result carries the same reason). Pass Position from a received message, or build one.