public
Description: WoW Addon - LDB launcher micro buttons
Homepage: http://www.tekkub.net/
Clone URL: git://github.com/tekkub/picobuttons.git
Click here to lend your support to: picobuttons and make a donation at www.pledgie.com !
picobuttons / picoButtons.lua
100644 40 lines (30 sloc) 1.572 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
local microcoord = {0, 1, 22/64, 1}
 
 
local i = 0
local function helper(title, button, label, icon, coords, click)
ldb:NewDataObject(i.. " MicroButton "..title, {
type = "launcher",
icon = icon or "Interface\\Buttons\\UI-MicroButton-"..title.."-Up",
texcoord = coords or (not icon and microcoord),
iconCoords = coords or (not icon and microcoord),
OnClick = click or button:GetScript("OnClick"),
label = label,
})
i = i + 1
end
 
 
local x = MainMenuMicroButton:GetScript("OnMouseUp")
local function mainmenu(self, ...) self.down = 1; x(self, ...) end
 
helper("Character", CharacterMicroButton, CHARACTER_BUTTON, "Interface\\GroupFrame\\UI-Group-LeaderIcon", nil, function() ToggleCharacter("PaperDollFrame") end)
helper("Spellbook", SpellbookMicroButton, SPELLBOOK_ABILITIES_BUTTON)
helper("Talents", TalentMicroButton, TALENTS_BUTTON)
helper("Achievement", AchievementMicroButton, ACHIEVEMENT_BUTTON)
helper("Quest", QuestLogMicroButton, QUESTLOG_BUTTON)
helper("Socials", SocialsMicroButton, SOCIAL_BUTTON)
helper("PVP", PVPMicroButton, PLAYER_V_PLAYER, "Interface\\TargetingFrame\\UI-PVP-"..UnitFactionGroup("player"), {0, 5/8, 0, 5/8}, function() ToggleFrame(PVPParentFrame) end)
helper("LFG", LFGMicroButton, LFG_BUTTON)
helper("MainMenu", MainMenuMicroButton, MAINMENU_BUTTON, nil, nil, mainmenu)
helper("Help", HelpMicroButton, HELP_BUTTON)
 
 
---------------------------
-- About panel --
---------------------------
 
local about = LibStub("tekKonfig-AboutPanel").new(nil, "picoButtons")