• World of Warcraft Addons
  • World of Warcraft
  • Average Rating:

  • Your Rating

  • Share
  • Report Abuse

LibDBIcon-1.0

 
Project Updated:
Files Updated: Thu, Sep 3 2009
Supports Game Version: 3.3.0
Category: Libraries
Tags:

, and [Edit Tags]

Project Manager: Rabbit
Additional Authors: No additional authors
Current Version: r11
License: GNU General Public License version 2 (GPLv2)
Development Site: WowAce.com
Avg Daily DL (last 30 days): 33
Downloads Total: 10,350
Favorites: 10
Comments: 0
  • About LibDBIcon-1.0
  •  

LibDBIcon-1.0 is a small library you can throw in your LDB addon that will create a small minimap icon for you and nothing more.

Simply get a reference to the library in your addon like so;

local icon = LibStub("LibDBIcon-1.0")

Then after you've registered your LDB object called "MyLDB", you can do:

icon:Register("MyLDB", myLDB, savedVarTable)

Where myLDB is a object reference to your LDB display and savedVarTable is a table where the library can store data like minimap position, radius and the like.

When you create the display, the library will automatically hide or show the icon based on the "hide = true/false" key in savedVarTable. If you want to add an option to hide or show the display, you can hide or show the icon manually during play with:

icon:Hide("MyLDB")
icon:Show("MyLDB")

So in conclusion, here is a complete Ace3 example of how to use this library

local addon = LibStub("AceAddon-3.0"):NewAddon("Bunnies", "AceConsole-3.0")
local bunnyLDB = LibStub("LibDataBroker-1.1"):NewDataObject("Bunnies!", {
	type = "data source",
	text = "Bunnies!",
	icon = "Interface\\Icons\\INV_Chest_Cloth_17",
	OnClick = function() print("BUNNIES ARE TAKING OVER THE WORLD") end,
})
local icon = LibStub("LibDBIcon-1.0")

function addon:OnInitialize()
	-- Obviously you'll need a ## SavedVariables: BunniesDB line in your TOC, duh!
	self.db = LibStub("AceDB-3.0"):New("BunniesDB", {
		profile = {
			minimap = {
				hide = false,
			},
		},
	})
	icon:Register("Bunnies!", bunnyLDB, self.db.profile.minimap)
	self:RegisterChatCommand("bunnies", "CommandTheBunnies")
end

function addon:CommandTheBunnies()
	self.db.profile.minimap.hide = not self.db.profile.minimap.hide
	if self.db.profile.minimap.hide then
		icon:Hide("Bunnies!")
	else
		icon:Show("Bunnies!")
	end
end
  • Downloads (2)
  •  
File Name Release Type Game Version Downloads Date
Addon Curse.com Beta 2.3.3 0 9/29/2008
  File Name Release Type Game Version Downloads Date  
  LibDBIcon-1.0 r11 Release 3.3.0 2,717 9/3/2009
  LibDBIcon-1.0 r9 Release 3.1.0 7,632 4/14/2009
  • 1 page(s)
  • Comments

Add Comment  

Add

You need to login or register to post.

Benefits of Registration

  • Interact with hundreds of thousands of other gamers on an open social network.
  • Post your stories, news, images, videos, and other content to share.
  • Create a network with your fellow gamers or join an existing one.
  • Gain reputation for everything you do.
  • Addon Packs Containing LibDBIcon-1.0

Most Downloads / Day

  • Similar Addons
  •  

Average downloads per day

  1. 487 Ace3 Libraries
  2. 437 Addon Control Panel Libraries, Development Tools...
  3. 268 Ace2 Libraries
  4. 240 LibBabble-Boss-3.0 Libraries
  5. 207 LibRock-1.0 Libraries