# HG changeset patch # User Flick # Date 1212535443 0 # Node ID 2c12e2b1752e92572f89ecfe4fa02f123072a73a # Parent a785d6708388b2579b96fd0769b303848a6fc3a1 Fixed unbinding a keystate toggle diff -r a785d6708388 -r 2c12e2b1752e Bar.lua --- a/Bar.lua Tue Jun 03 23:05:16 2008 +0000 +++ b/Bar.lua Tue Jun 03 23:24:03 2008 +0000 @@ -182,11 +182,11 @@ SecureStateHeader_Refresh(self.frame) end -function Bar:SetStateKeybind(keybind, state, defaultstate) +function Bar:SetStateKeybind(key, state, defaultstate) -- use a tiny offscreen button to get around making the bar itself a clickable button local f = self.statebuttonframe local off = ("%s_off"):format(state) - if keybind then + if key then if not f then f = CreateFrame("Button",self:GetName().."_statebutton",UIParent,"SecureActionButtonTemplate") f:SetPoint("BOTTOMRIGHT",UIParent,"TOPLEFT") @@ -204,10 +204,15 @@ f:SetAttribute(("type-%s"):format(off),"attribute") f:SetAttribute(("attribute-value-%s"):format(state), state) f:SetAttribute(("attribute-value-%s"):format(off), defaultstate) - SetBindingClick(keybind, f:GetName(), state) + SetBindingClick(key, f:GetName(), state) elseif f then f:SetAttribute(("type-%s"):format(state),ATTRIBUTE_NOOP) f:SetAttribute(("type-%s"):format(off),ATTRIBUTE_NOOP) + local action = ("CLICK %s:%s"):format(f:GetName(),state) + key = GetBindingKey(action) + if key then + SetBinding(key,nil) + end end end diff -r a785d6708388 -r 2c12e2b1752e State.lua --- a/State.lua Tue Jun 03 23:05:16 2008 +0000 +++ b/State.lua Tue Jun 03 23:24:03 2008 +0000 @@ -700,7 +700,7 @@ }, }, rules = { - name = L["Selection Rule"], + name = L["Rule"], order = 3, type = "group", args = { @@ -825,6 +825,9 @@ order = 2, type = "keybinding", set = function(info, value) + if value and #value == 0 then + value = nil + end setrule("keybind",value) update() end, diff -r a785d6708388 -r 2c12e2b1752e locale/enUS.lua --- a/locale/enUS.lua Tue Jun 03 23:05:16 2008 +0000 +++ b/locale/enUS.lua Tue Jun 03 23:24:03 2008 +0000 @@ -86,7 +86,7 @@ "Y Offset", "Scale", "Set New Scale", -"Selection Rule", +"Rule", "Select this state", "by default", "when ANY of these",