/
if (getglobal("SimpleCoords_X"):GetText() == "" or getglobal("SimpleCoords_Y"):GetText() == "") then |
-- only one field filled in |
else |
PlaySoundFile("Sound\\interface\\PickUp\\PutDownGems.wav"); |
PlaySoundFile(567574); |
-- PlaySoundFile("Sound\\interface\\PickUp\\PutDownGems.wav"); |
local x_text, y_text; |
x_text = getglobal("SimpleCoords_X"):GetText(); |
y_text = getglobal("SimpleCoords_Y"):GetText(); |
-- With accompanying sound |
-- |
if(getglobal("SimpleCoords_X"):IsShown()) then |
PlaySoundFile("Sound\\interface\\uMiniMapClose.wav"); |
PlaySoundFile(567515); |
-- PlaySoundFile("Sound\\interface\\uMiniMapClose.wav"); |
getglobal("SimpleCoords_X"):Hide(); |
getglobal("SimpleCoords_Y"):Hide(); |
panelOpen=false; |
else |
PlaySoundFile("Sound\\interface\\uMiniMapOpen.wav"); |
PlaySoundFile(567529); -- ("Sound\\interface\\uMiniMapOpen.wav"); |
getglobal("SimpleCoords_X"):Show(); |
getglobal("SimpleCoords_Y"):Show(); |
getglobal("SimpleCoords_X"):SetFocus(); |
## Interface: 80000 |
## Interface: 80200 |
## Title: SimpleCoords |
## Version: 4.00 |
## Version: 4.10 |
## Notes: Show map coordinates in movable frame. |
## Author: Schnoggo |
## Dependencies: |
-- HereBeDragons-Migrate is not supported on WoW 7.x or earlier |
if select(4, GetBuildInfo()) < 80000 then |
return |
end |
local MAJOR, MINOR = "HereBeDragons-Migrate", 2 |
assert(LibStub, MAJOR .. " requires LibStub") |
-- HereBeDragons is a data API for the World of Warcraft mapping system |
-- HereBeDragons-2.0 is not supported on WoW 7.x or earlier |
if select(4, GetBuildInfo()) < 80000 then |
return |
end |
local MAJOR, MINOR = "HereBeDragons-2.0", 6 |
local MAJOR, MINOR = "HereBeDragons-2.0", 7 |
assert(LibStub, MAJOR .. " requires LibStub") |
local HereBeDragons, oldversion = LibStub:NewLibrary(MAJOR, MINOR) |
} |
-- gather map info, but only if this isn't an upgrade (or the upgrade version forces a re-map) |
if not oldversion or oldversion < 3 then |
if not oldversion or oldversion < 7 then |
-- wipe old data, if required, otherwise the upgrade path isn't triggered |
if oldversion then |
wipe(mapData) |
local vector00, vector05 = CreateVector2D(0, 0), CreateVector2D(0.5, 0.5) |
-- gather the data of one map (by uiMapID) |
local function processMap(id, data) |
if not id or mapData[id] then return end |
local function processMap(id, data, parent) |
if not id or not data or mapData[id] then return end |
if data.parentMapID and data.parentMapID ~= 0 then |
parent = data.parentMapID |
elseif not parent then |
parent = 0 |
end |
-- get two positions from the map, we use 0/0 and 0.5/0.5 to avoid issues on some maps where 1/1 is translated inaccurately |
local instance, topLeft = C_Map.GetWorldPosFromMapPos(id, vector00) |
local _, bottomRight = C_Map.GetWorldPosFromMapPos(id, vector05) |
right = left + (right - left) * 2 |
instance, left, right, top, bottom = applyMapTransforms(instance, left, right, top, bottom) |
mapData[id] = {left - right, top - bottom, left, top, instance = instance, name = data.name, mapType = data.mapType, parent = data.parentMapID} |
mapData[id] = {left - right, top - bottom, left, top, instance = instance, name = data.name, mapType = data.mapType, parent = parent } |
else |
mapData[id] = {0, 0, 0, 0, instance = instance or -1, name = data.name, mapType = data.mapType, parent = data.parentMapID } |
mapData[id] = {0, 0, 0, 0, instance = instance or -1, name = data.name, mapType = data.mapType, parent = parent } |
end |
end |
local function processMapChildrenRecursive(id) |
local children = C_Map.GetMapChildrenInfo(id) |
local function processMapChildrenRecursive(parent) |
local children = C_Map.GetMapChildrenInfo(parent) |
if children and #children > 0 then |
for i = 1, #children do |
local id = children[i].mapID |
if id and not mapData[id] then |
processMap(id, children[i]) |
processMap(id, children[i], parent) |
processMapChildrenRecursive(id) |
-- process sibling maps (in the same group) |
-- in some cases these are not discovered by GetMapChildrenInfo above |
local groupID = C_Map.GetMapGroupID(id) |
if groupID then |
local groupMembers = C_Map.GetMapGroupMembersInfo(groupID) |
if groupMembers then |
for k = 1, #groupMembers do |
local memberId = groupMembers[k].mapID |
if memberId and not mapData[memberId] then |
processMap(memberId, C_Map.GetMapInfo(memberId), parent) |
processMapChildrenRecursive(memberId) |
end |
end |
end |
end |
end |
end |
end |
tag a0d9d7d23b61dfd50e81bb5d5008ed2a9168a001 2.00-release |
tag 529cf963909b0c048d607d9fb35e549e2867a61c 2.01-release |
Author: Hendrik Leppkes <h.leppkes@gmail.com> |
Date: Tue Jul 17 14:46:43 2018 +0200 |
Date: Thu Jan 24 10:17:51 2019 +0100 |
Tag as 2.00-release |
Tag as 2.01-release |
commit fbe9b033a29ba62bb525d65e9ed1197ea2738041 |
commit 6df387471e91795b8152b6271ce7a8fa15c9d151 |
Author: Hendrik Leppkes <h.leppkes@gmail.com> |
Date: Tue Jul 17 14:46:33 2018 +0200 |
Date: Thu Jan 24 10:17:20 2019 +0100 |
Update TOC for 8.0 |
Remove load guards |
commit d6e04fda96a84f89a43d248c3a6e195b4e414bcf |
commit 601d62a39f98f533d81027473efdfe5f52672df5 |
Author: Hendrik Leppkes <h.leppkes@gmail.com> |
Date: Sun Jul 1 12:37:59 2018 +0200 |
Date: Thu Jan 24 10:06:55 2019 +0100 |
Update transform data for the latest beta build |
Add support for specifying the frame level category for world map pins |
commit 41e7284588afe1f43f987df7efd4669c5467ebb4 |
Author: Hendrik Leppkes <h.leppkes@gmail.com> |
Date: Tue Jan 22 13:13:53 2019 +0100 |
Remove HereBeDragons-1.0 from the source |
1.0 was developed for Legion, and has not functioned in WoW 8.0 |
commit 3ee227ed2b69d15ffeab4c9b06f06141dc879f78 |
Author: Hendrik Leppkes <h.leppkes@gmail.com> |
Date: Mon Sep 10 11:09:08 2018 +0200 |
Use the parent parameter instead of accessing the table, it holds the same value |
commit 6f03f6f9297155fba47b03f16c29dabd7445081d |
Author: Hendrik Leppkes <h.leppkes@gmail.com> |
Date: Mon Sep 10 11:07:18 2018 +0200 |
Improve map discovery to handle improperly flagged dungeon floor maps |
These maps sometimes do not show up as a child, and can only be detected |
by checking the map group. |
--[[ $Id: CallbackHandler-1.0.lua 18 2014-10-16 02:52:20Z mikk $ ]] |
local MAJOR, MINOR = "CallbackHandler-1.0", 6 |
--[[ $Id: CallbackHandler-1.0.lua 22 2018-07-21 14:17:22Z nevcairiel $ ]] |
local MAJOR, MINOR = "CallbackHandler-1.0", 7 |
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR) |
if not CallbackHandler then return end -- No upgrade needed |
return geterrorhandler()(err) |
end |
local function CreateDispatcher(argCount) |
local code = [[ |
local next, xpcall, eh = ... |
local method, ARGS |
local function call() method(ARGS) end |
local function dispatch(handlers, ...) |
local index |
index, method = next(handlers) |
if not method then return end |
local OLD_ARGS = ARGS |
ARGS = ... |
repeat |
xpcall(call, eh) |
index, method = next(handlers, index) |
until not method |
ARGS = OLD_ARGS |
end |
return dispatch |
]] |
local ARGS, OLD_ARGS = {}, {} |
for i = 1, argCount do ARGS[i], OLD_ARGS[i] = "arg"..i, "old_arg"..i end |
code = code:gsub("OLD_ARGS", tconcat(OLD_ARGS, ", ")):gsub("ARGS", tconcat(ARGS, ", ")) |
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(next, xpcall, errorhandler) |
local function Dispatch(handlers, ...) |
local index, method = next(handlers) |
if not method then return end |
repeat |
xpcall(method, errorhandler, ...) |
index, method = next(handlers, index) |
until not method |
end |
local Dispatchers = setmetatable({}, {__index=function(self, argCount) |
local dispatcher = CreateDispatcher(argCount) |
rawset(self, argCount, dispatcher) |
return dispatcher |
end}) |
-------------------------------------------------------------------------- |
-- CallbackHandler:New |
-- |
local oldrecurse = registry.recurse |
registry.recurse = oldrecurse + 1 |
Dispatchers[select('#', ...) + 1](events[eventname], eventname, ...) |
Dispatch(events[eventname], eventname, ...) |
registry.recurse = oldrecurse |
-- HereBeDragons-Pins is a library to show pins/icons on the world map and minimap |
-- HereBeDragons-Pins-2.0 is not supported on WoW 7.x |
if select(4, GetBuildInfo()) < 80000 then |
return |
end |
local MAJOR, MINOR = "HereBeDragons-Pins-2.0", 5 |
local MAJOR, MINOR = "HereBeDragons-Pins-2.0", 6 |
assert(LibStub, MAJOR .. " requires LibStub") |
local pins, oldversion = LibStub:NewLibrary(MAJOR, MINOR) |
x, y = HBD:GetZoneCoordinatesFromWorld(data.x, data.y, uiMapID) |
end |
if x and y then |
self:GetMap():AcquirePin("HereBeDragonsPinsTemplate", icon, x, y) |
self:GetMap():AcquirePin("HereBeDragonsPinsTemplate", icon, x, y, data.frameLevelType) |
end |
end |
self:SetScalingLimits(1, 1.0, 1.2) |
end |
function worldmapProviderPin:OnAcquired(icon, x, y) |
function worldmapProviderPin:OnAcquired(icon, x, y, frameLevelType) |
self:UseFrameLevelType(frameLevelType or "PIN_FRAME_LEVEL_AREA_POI") |
self:SetPosition(x, y) |
self.icon = icon |
-- @param x X position in world coordinates |
-- @param y Y position in world coordinates |
-- @param showFlag Flag to control on which maps this pin will be shown |
function pins:AddWorldMapIconWorld(ref, icon, instanceID, x, y, showFlag) |
-- @param frameLevel Optional Frame Level type registered with the WorldMapFrame, defaults to PIN_FRAME_LEVEL_AREA_POI |
function pins:AddWorldMapIconWorld(ref, icon, instanceID, x, y, showFlag, frameLevel) |
if not ref then |
error(MAJOR..": AddWorldMapIconWorld: 'ref' must not be nil") |
end |
t.y = y |
t.uiMapID = nil |
t.worldMapShowFlag = showFlag or 0 |
t.frameLevelType = frameLevel |
worldmapPins[icon] = t |
-- @param x X position in local/point coordinates (0-1), relative to the zone |
-- @param y Y position in local/point coordinates (0-1), relative to the zone |
-- @param showFlag Flag to control on which maps this pin will be shown |
function pins:AddWorldMapIconMap(ref, icon, uiMapID, x, y, showFlag) |
-- @param frameLevel Optional Frame Level type registered with the WorldMapFrame, defaults to PIN_FRAME_LEVEL_AREA_POI |
function pins:AddWorldMapIconMap(ref, icon, uiMapID, x, y, showFlag, frameLevel) |
if not ref then |
error(MAJOR..": AddWorldMapIconMap: 'ref' must not be nil") |
end |
t.y = yCoord |
t.uiMapID = uiMapID |
t.worldMapShowFlag = showFlag or 0 |
t.frameLevelType = frameLevel |
worldmapPins[icon] = t |
## Interface: 80000 |
## Interface: 80200 |
## Title: Lib: HereBeDragons |
## Notes: HereBeDragons is a data API for the World of Warcraft mapping system |
## Author: Nevcairiel |
## X-Category: Library |
## X-License: BSD |
## X-Website: http://www.wowace.com/addons/herebedragons/ |
## Version: 2.00-release |
## Version: 2.01-release |
LibStub\LibStub.lua |
CallbackHandler-1.0\CallbackHandler-1.0.lua |
# WoW 7.x version |
HereBeDragons-1.0.lua |
HereBeDragons-Pins-1.0.lua |
# WoW 8.0+ version |
HereBeDragons-2.0.lua |
HereBeDragons-Pins-2.0.lua |
SimpleCoords v4.00 |
SimpleCoords v4.10 |
Description |
=========== |
VERSION HISTORY |
=============== |
July 5, 2019 (4.10) |
* Updated TOC and version for WoW client 8.2 |
* Changed sounds to use IDs instead of file paths |
* Updated HereBeDragons lib to 2.01 |
July 18, 2018 (4.00) |
* Updated TOC and version for WoW client 8.0 |
* Updated HereBeDragons lib to 2.0 |