View Single Post
12-15-10, 05:39 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The global this, event, and argN variables were removed in Patch 4.0.1, as was the getglobal function. These things were all deprecated long before that, but many addons were lazy and continued to use them, or were written based on outdated or poorly written references. NameViolation appears to have been written in 2008, so "lazy" and/or "outdated references" would seem to apply.

The whole code in general is pretty horrifying, but I don't have time to rewrite it. Try making these changes. I'm at work, so I can't test them myself right now.

NameViolation.xml
  1. Search for all instances of "this" and replace them with "self".
  2. Change line 6 to:
    Code:
    NameViolation_OnLoad(self);
  3. Change line 9 to:
    Code:
    NameViolation_OnEvent(self, event, ...);
  4. Change line 30 to:
    Code:
    self.text = _G[self:GetName().."Text"];
  5. Change line 245 to:
    Code:
    NameViolationReport_OnLoad(self);
  6. Change line 248 to:
    Code:
    NameViolationReport_OnShow(self)
  7. Change line 257 to:
    Code:
    NameViolationReport_OnHide()
  8. Search for all instances of:
    Code:
    getglobal(this:GetName().."Text")
    ... and replace them with:
    Code:
    _G[self:GetName().."Text"];
NameViolation.lua
  • Search for all instances of "this" and replace them with "self".
  • Replace line 45 with:
    Code:
    function NameViolation_OnLoad(self)
  • Replace line 88 with:
    Code:
    function NameViolation_OnEvent(self, event, ...)
  • Replace line 328 with:
    Code:
    local text = _G["DropDownList"..level.."Button"..id].value;
  • Replace lines 385 with:
    Code:
    local dropdownMenu = UIDROPDOWNMENU_INIT_MENU;
  • Replace line 492 with:
    Code:
    function NameViolation_UnitPopup_OnClick(self, button)
  • Replace lines 494 with:
    Code:
    local dropdownMenu = UIDROPDOWNMENU_INIT_MENU;

Report back with any error messages triggered.
  Reply With Quote