From 2aefb6fa32704f23eff02655a4d00642270e9173 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Wed, 27 Oct 2010 19:34:44 +0100 Subject: [PATCH] Convert strings to frames --- Clique.lua | 11 ++++++++--- Utils.lua | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Clique.lua b/Clique.lua index 232bfe7..51fa2f6 100755 --- a/Clique.lua +++ b/Clique.lua @@ -724,9 +724,14 @@ function addon:UpdateRegisteredClicks(frame) end for frame in pairs(self.hccframes) do - if not self:IsFrameBlacklisted(frame) then - frame:RegisterForClicks(direction) - end + if not self:IsFrameBlacklisted(frame) then + if type(frame) == "string" then + frame = _G[frame] + end + if frame then + frame:RegisterForClicks(direction) + end + end end end diff --git a/Utils.lua b/Utils.lua index d432f3e..52aca79 100644 --- a/Utils.lua +++ b/Utils.lua @@ -12,8 +12,8 @@ local addonName, addon = ... local L = addon.L --- Returns the prefix string for the current keyboard state. --- +-- Returns the prefix string for the current keyboard state. +-- -- Arguments: -- split - Whether or not to split the modifier keys into left and right components @@ -31,7 +31,7 @@ function addon:GetPrefixString(split) lctrl, rctrl = false, false lalt, ralt = false, false end - + local prefix = "" if shift then prefix = ((lshift and "LSHIFT-") or (rshift and "RSHIFT-") or "SHIFT-") .. prefix @@ -140,7 +140,7 @@ end function addon:GetBindingKeyComboText(binding) if type(binding) == "table" and binding.key then - return strconcat(convert(strsplit("-", binding.key))) + return strconcat(convert(strsplit("-", binding.key))) elseif type(binding) == "string" then return strconcat(convert(strsplit("-", binding))) else -- 1.7.9.5