view LDB.lua @ 108:b2fb8f7dc780

ButtonFacade support
author Flick <flickerstreak@gmail.com>
date Wed, 07 Jan 2009 00:57:02 +0000
parents 4bc50350f405
children
line wrap: on
line source
local ReAction = ReAction
local L = ReAction.L
local format = string.format

-- Export ReAction launcher to LibDataBroker-aware displays
LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject( "ReAction", 
  {
    type = "launcher", 
    icon = "Interface\\Icons\\INV_Qiraj_JewelEncased",

    OnClick = function( frame, button )
      if not InCombatLockdown() then
        if IsAltKeyDown() then
          ReAction:SetKeybindMode( not ReAction:GetKeybindMode() )
        elseif IsShiftKeyDown() then
          ReAction:SetConfigMode( not ReAction:GetConfigMode() )
        elseif button == "RightButton" then
          ReAction:ShowEditor()
        else
          ReAction:ShowConfig()
        end
      else
        ReAction:UserError(L["ReAction: can't configure in combat"])
      end
    end,

      -- this isn't included in the 'launcher' type LDB spec but it seems all launcher displays use it
    OnTooltipShow = function( tooltip )
      tooltip:AddLine(format("|cffffffff%s|r %s",L["Click"],L["for global configuration"]))
      tooltip:AddLine(format("|cffffd200%s|r %s",L["Right-click"],L["for bar editor dialog"]))
      tooltip:AddLine(format("|cff00ff00%s|r %s",L["Shift-click"],L["to unlock bars"]))
      tooltip:AddLine(format("|cff00cccc%s|r %s",L["Alt-click"],L["for keybind mode"]))
    end,

  }
)