Quantcast

Convert strings to frames

James Whitehead II [10-27-10 - 18:34]
Convert strings to frames
Filename
Clique.lua
Utils.lua
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