annotate modules/LDB.lua @ 112:a66595385917

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