annotate LDB.lua @ 104:4bc50350f405

- Added LDB support - Updated readme - Pulled in LibStub and CallbackHandler instead of external
author Flick <flickerstreak@gmail.com>
date Fri, 07 Nov 2008 23:55:33 +0000
parents
children
rev   line source
flickerstreak@104 1 local ReAction = ReAction
flickerstreak@104 2 local L = ReAction.L
flickerstreak@104 3 local format = string.format
flickerstreak@104 4
flickerstreak@104 5 -- Export ReAction launcher to LibDataBroker-aware displays
flickerstreak@104 6 LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject( "ReAction",
flickerstreak@104 7 {
flickerstreak@104 8 type = "launcher",
flickerstreak@104 9 icon = "Interface\\Icons\\INV_Qiraj_JewelEncased",
flickerstreak@104 10
flickerstreak@104 11 OnClick = function( frame, button )
flickerstreak@104 12 if not InCombatLockdown() then
flickerstreak@104 13 if IsAltKeyDown() then
flickerstreak@104 14 ReAction:SetKeybindMode( not ReAction:GetKeybindMode() )
flickerstreak@104 15 elseif IsShiftKeyDown() then
flickerstreak@104 16 ReAction:SetConfigMode( not ReAction:GetConfigMode() )
flickerstreak@104 17 elseif button == "RightButton" then
flickerstreak@104 18 ReAction:ShowEditor()
flickerstreak@104 19 else
flickerstreak@104 20 ReAction:ShowConfig()
flickerstreak@104 21 end
flickerstreak@104 22 else
flickerstreak@104 23 ReAction:UserError(L["ReAction: can't configure in combat"])
flickerstreak@104 24 end
flickerstreak@104 25 end,
flickerstreak@104 26
flickerstreak@104 27 -- this isn't included in the 'launcher' type LDB spec but it seems all launcher displays use it
flickerstreak@104 28 OnTooltipShow = function( tooltip )
flickerstreak@104 29 tooltip:AddLine(format("|cffffffff%s|r %s",L["Click"],L["for global configuration"]))
flickerstreak@104 30 tooltip:AddLine(format("|cffffd200%s|r %s",L["Right-click"],L["for bar editor dialog"]))
flickerstreak@104 31 tooltip:AddLine(format("|cff00ff00%s|r %s",L["Shift-click"],L["to unlock bars"]))
flickerstreak@104 32 tooltip:AddLine(format("|cff00cccc%s|r %s",L["Alt-click"],L["for keybind mode"]))
flickerstreak@104 33 end,
flickerstreak@104 34
flickerstreak@104 35 }
flickerstreak@104 36 )