Skip to content

Commit

Permalink
Get ready for DB madness.
Browse files Browse the repository at this point in the history
  • Loading branch information
haste committed Aug 24, 2009
1 parent 4e427d8 commit 4fcb00c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion loot.lua
Expand Up @@ -6,7 +6,12 @@ local L = {
local addon = CreateFrame("Button", "Butsu")
local title = addon:CreateFontString(nil, "OVERLAY")

local iconsize = 22
local db
local defaults = {
iconSize = 22;
frameScale = 1;
}

local sq, ss, sn

local OnEnter = function(self)
Expand Down Expand Up @@ -54,6 +59,7 @@ local OnUpdate = function(self)
end

local createSlot = function(id)
local iconsize = db.iconSize
local frame = CreateFrame("Button", 'ButsuSlot'..id, addon)
frame:SetPoint("LEFT", 8, 0)
frame:SetPoint("RIGHT", -8, 0)
Expand Down Expand Up @@ -259,6 +265,16 @@ addon.UPDATE_MASTER_LOOT_LIST = function(self)
UIDropDownMenu_Refresh(GroupLootDropDown)
end

addon.ADDON_LOADED = function(self, event, addon)
if(addon == "Butsu") then
db = setmetatable({}, {__index = defaults})

-- clean up.
self[event] = nil
self:UnregisterEvent(event)
end
end

addon:SetScript("OnEvent", function(self, event, ...)
self[event](self, event, ...)
end)
Expand All @@ -268,6 +284,7 @@ addon:RegisterEvent"LOOT_SLOT_CLEARED"
addon:RegisterEvent"LOOT_CLOSED"
addon:RegisterEvent"OPEN_MASTER_LOOT_LIST"
addon:RegisterEvent"UPDATE_MASTER_LOOT_LIST"
addon:RegisterEvent"ADDON_LOADED"
addon:Hide()

-- Fuzz
Expand Down

0 comments on commit 4fcb00c

Please sign in to comment.