From b4c66b6285c6f1776ef9d9c7c63a8ed821e439a0 Mon Sep 17 00:00:00 2001 From: p3lim Date: Wed, 22 Dec 2010 01:19:28 +0100 Subject: [PATCH] Adjust some things and make them work --- Database.lua | 6 +++--- Molinari.lua | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Database.lua b/Database.lua index a3c7c32..e1741bb 100644 --- a/Database.lua +++ b/Database.lua @@ -1,5 +1,5 @@ -local _, notDisenchantable = ... +local _, ns = ... + +ns.notDisenchantable = { -notDisenchantable = { - } diff --git a/Molinari.lua b/Molinari.lua index b71e57e..6bdf2b1 100644 --- a/Molinari.lua +++ b/Molinari.lua @@ -1,5 +1,5 @@  -local addonName, notDisenchantable = ... +local addonName, ns = ... local armorType = GetLocale() == 'ruRU' and '' or ARMOR local button = CreateFrame('Button', addonName, UIParent, 'SecureActionButtonTemplate') @@ -35,10 +35,11 @@ function button:PLAYER_LOGIN() if(item and not InCombatLockdown() and IsAltKeyDown()) then local spell, r, g, b = ScanTooltip(self, spells) - if(not spell and disenchantable and not notDisenchantable[link:match('item:(%d+):')]) then - local _, _, quality, _, _, type = GetItemInfo(item) + + if(not spell and disenchantable and not ns.notDisenchantable[link:match('item:(%d+):')]) then + local _, _, quality, _, _, itemType = GetItemInfo(item) - if((type == armorType or type == ENCHSLOT_WEAPON) and (quality and (quality > 1 or quality < 5))) then + if((itemType == armorType or itemType == ENCHSLOT_WEAPON) and (quality and (quality > 1 or quality < 5))) then spell, r, g, b = unpack(disenchantable) end end @@ -65,7 +66,7 @@ end function button:MODIFIER_STATE_CHANGED(key) if(not self:IsShown() and not key and key ~= 'LALT' and key ~= 'RALT') then return end - + if(InCombatLockdown()) then self:SetAlpha(0) self:RegisterEvent('PLAYER_REGEN_ENABLED') -- 1.7.9.5