Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add alt-click to share just the pin #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion addon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ function ns:CreateUI()
end
end
GameTooltip_AddInstructionLine(GameTooltip, "Control-click to add a map pin")
GameTooltip_AddInstructionLine(GameTooltip, "Shift-click to share to chat")
GameTooltip_AddInstructionLine(GameTooltip, "Shift-click to share name and map pin to chat")
GameTooltip_AddInstructionLine(GameTooltip, "Alt-click to share only the map pin to chat")
GameTooltip:Show()
end
local function Line_OnClick(line, button)
Expand Down Expand Up @@ -308,6 +309,20 @@ function ns:CreateUI()
C_Map.SetUserWaypoint(uiMapPoint)
C_SuperTrack.SetSuperTrackedUserWaypoint(true)
end
elseif IsAltKeyDown() then
local message = ("|cffffff00|Hworldmap:%d:%d:%d|h[%s]|h|r"):format(
uiMapID,
x * 10000,
y * 10000,
-- WoW seems to filter out anything which isn't the standard MAP_PIN_HYPERLINK
MAP_PIN_HYPERLINK
)
PlaySound(SOUNDKIT.UI_MAP_WAYPOINT_CHAT_SHARE)
-- if you have an open editbox, just paste to it
if not ChatEdit_InsertLink(message) then
-- open the chat to whatever it was on and add the text
ChatFrame_OpenChat(message)
end
end
end

Expand Down