Skip to content

Instantly share code, notes, and snippets.

@jnwhiteh
Created September 7, 2025 15:34
Show Gist options
  • Save jnwhiteh/4fce731c56e94d1a1c58260c41507e0f to your computer and use it in GitHub Desktop.
Save jnwhiteh/4fce731c56e94d1a1c58260c41507e0f to your computer and use it in GitHub Desktop.
local function crazyArrowDropdownGenerator(owner, rootDescription)
rootDescription:CreateTitle(L["TomTom Waypoint Arrow"]);
-- Waypoint communications
local sendWaypoint = rootDescription:CreateButton(L["Send waypoint to"])
sendWaypoint:CreateTitle(L["Waypoint communication"])
sendWaypoint:CreateButton(L["Send to party"], function()
addon:SendWaypoint(addon.dropdown_uid, "PARTY")
end)
sendWaypoint:CreateButton(L["Send to raid"], function()
addon:SendWaypoint(addon.dropdown_uid, "RAID")
end)
sendWaypoint:CreateButton(L["Send to battleground"], function()
addon:SendWaypoint(addon.dropdown_uid, "BATTLEGROUND")
end)
sendWaypoint:CreateButton(L["Send to guild"], function()
addon:SendWaypoint(addon.dropdown_uid, "GUILD")
end)
rootDescription:CreateButton(L["Clear waypoint from crazy arrow"], function()
addon:ClearCrazyArrowPoint(false)
end)
rootDescription:CreateButton(L["Remove waypoint"], function()
addon:ClearCrazyArrowPoint(true)
end)
rootDescription:CreateButton(L["Remove all waypoints from this zone"], function()
local uid = addon.dropdown_uid
local data = uid
local mapId = data[1]
for key, waypoint in pairs(addon.waypoints[mapId]) do
addon:RemoveWaypoint(waypoint)
end
end)
rootDescription:CreateButton(L["Remove all waypoints"], function()
if addon.db.profile.general.confirmremoveall then
StaticPopup_Show("TOMTOM_REMOVE_ALL_CONFIRM")
else
StaticPopupDialogs["TOMTOM_REMOVE_ALL_CONFIRM"].OnAccept()
return
end
end)
local maybeLocked = addon.db.profile.arrow.lock and L["Unlock crazy arrow"] or L["Lock crazy arrow"]
rootDescription:CreateButton(L[maybeLocked], function()
addon.db.profile.arrow.lock = not addon.db.profile.arrow.lock
addon:ShowHideCrazyArrow()
end)
end
local function WayFrame_OnClick(self, button)
if active_point then
if addon.db.profile.arrow.menu then
addon.dropdown_uid = active_point
MenuUtil.CreateContextMenu(self, crazyArrowDropdownGenerator)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment