View Single Post
12-16-12, 10:00 PM   #4
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Code:
function SetEnabled(info, newValue)
    UnitScanner_Settings["Bars"][self.CurrentBar]["enabled"] = newValue
    local frm = "US_Frame" .. 1
    if (newValue == true) then
        frm:Show()
    else
        frm:Hide()
    end
end
The reason that doesn't work is "frm" is assigned a string, you need to change it to get the actual object:

Code:
function SetEnabled(info, newValue)
    UnitScanner_Settings["Bars"][self.CurrentBar]["enabled"] = newValue
    local frm = _G["US_Frame" .. 1]
    if (newValue == true) then
        frm:Show()
    else
        frm:Hide()
    end
end
  Reply With Quote