WoW LibFrameAnchorRegistry-1.0 addon Dragonflight/Wrath of the Lich King Classic 2024
logo
wow addon LibFrameAnchorRegistry-1.0

LibFrameAnchorRegistry-1.0

Game Version: 6.0.2
Total Downloads: 18,653
Updated: Oct 19, 2014
Created: Oct 23, 2010
download LibFrameAnchorRegistry-1.0Download Earlier Versions

Earlier Versions

Name Size Uploaded Game Version Downloads
0.2b beta 9.43 KB Oct 19, 2014 6.0.2 16,756 download LibFrameAnchorRegistry-1.0 0.2b betaDownload
0.1b beta 4.68 KB Oct 25, 2010 4.0.1 194 download LibFrameAnchorRegistry-1.0 0.1b betaDownload
0.1b-9-gf0d2651 alpha 9.38 KB Oct 19, 2014 6.0.2 53 download LibFrameAnchorRegistry-1.0 0.1b-9-gf0d2651 alphaDownload
0.1b-8-g8c3be6b alpha 9.36 KB Aug 28, 2012 5.0.4 423 download LibFrameAnchorRegistry-1.0 0.1b-8-g8c3be6b alphaDownload
0.1b-6-g6da2656 alpha 9.28 KB Nov 13, 2010 4.0.1 783 download LibFrameAnchorRegistry-1.0 0.1b-6-g6da2656 alphaDownload
0.1b-5-g53054bb alpha 4.63 KB Nov 13, 2010 4.0.1 56 download LibFrameAnchorRegistry-1.0 0.1b-5-g53054bb alphaDownload
0.1b-3-g733196d alpha 4.58 KB Nov 6, 2010 4.0.1 75 download LibFrameAnchorRegistry-1.0 0.1b-3-g733196d alphaDownload
0.1b-2-gf7ee88a alpha 4.54 KB Oct 27, 2010 4.0.1 75 download LibFrameAnchorRegistry-1.0 0.1b-2-gf7ee88a alphaDownload
r20101024132112 alpha 4.64 KB Oct 24, 2010 4.0.1 52 download LibFrameAnchorRegistry-1.0 r20101024132112 alphaDownload
r20101023214552 alpha 4.46 KB Oct 23, 2010 4.0.1 64 download LibFrameAnchorRegistry-1.0 r20101023214552 alphaDownload
r20101023184425 alpha 4.41 KB Oct 23, 2010 4.0.1 25 download LibFrameAnchorRegistry-1.0 r20101023184425 alphaDownload
r20101023172728 alpha 4.38 KB Oct 23, 2010 4.0.1 47 download LibFrameAnchorRegistry-1.0 r20101023172728 alphaDownload
r20101023171520 alpha 4.25 KB Oct 23, 2010 4.0.1 50 download LibFrameAnchorRegistry-1.0 r20101023171520 alphaDownload

Description

Share this:

Central registry for addons to register their frames as possible frame anchor. Other addons can then retrieve the list of anchor and then let their user anchor the addon to whatever frame they like.

To register a frame with the registry:

LibStub("LibFrameAnchorRegistry-1.0"):RegisterAnchor("MyCateogry", "NameOfFrame", "Identidy", frame)

To register with sub-categories:

LibStub("LibFrameAnchorRegistry-1.0"):RegisterAnchor("MyCateogry\001MySub-Category", "NameOfFrame", "Identidy", frame)

To retrieve the actual frame:

local anchor = LibStub("LibFrameAnchorRegistry-1.0"):GetAnchor(db.AnchorID)

To use with AceConfig:

local frame CreateFrame("Frame", nil, UIparent)
local options = {
   type = "group",
   args = {
      drop = {
         name = "Test",
         desc = "Some testing",
         type = "select",
         width = "double",
         values = function() return LibStub("LibFrameAnchorRegistry-1.0"):GetAnchors(frame) end,
         set = function(info, ident, name, frame)
            db.AnchorID = ident
         end,
         get = function() return db.AnchorID end,
         dialogControl = "FrameAnchorDropdown",
      },
   },
}

LibStub("AceConfig-3.0"):RegisterOptionsTable("Options", options, {"/myslash", "/my"})

To use stand-alone:

local frame CreateFrame("Frame", nil, UIparent)
local t = AceGUI:Create("FrameAnchorDropdown")
t:SetList(FA:GetAnchors(frame ))
t:SetLabel("Anchor")
t:SetValue(db.FrameAnchorID)
t:SetCallback("OnValueChanged", function(self, event, ident, name, frame)
	db.FrameAnchorID = ident
end)

Comments

Add a comment