Quantcast

Config rewrite

p3lim-52096 [09-21-08 - 21:50]
Config rewrite

git-svn-id: svn://svn.wowinterface.com/pMinimap-54/trunk@23 ae24c21f-2f0c-4c94-9256-0092abe71e0d
Filename
pMinimap/pMinimap.lua
pMinimap/pMinimap.toc
pMinimap/pMinimapConfig.lua
diff --git a/pMinimap/pMinimap.lua b/pMinimap/pMinimap.lua
index 65f8bfa..9c2822d 100644
--- a/pMinimap/pMinimap.lua
+++ b/pMinimap/pMinimap.lua
@@ -1,5 +1,5 @@
 pMinimap = CreateFrame('Frame', 'pMinimap', UIParent)
-pMinimap:SetScript('OnEvent', function(self, event, ...) self[event](self, ...) end)
+pMinimap:SetScript('OnEvent', function(self, event, ...) self[event](self, event, ...) end)
 pMinimap:RegisterEvent('ADDON_LOADED')

 function pMinimap:ADDON_LOADED()
diff --git a/pMinimap/pMinimap.toc b/pMinimap/pMinimap.toc
index b51f152..0e674b1 100644
--- a/pMinimap/pMinimap.toc
+++ b/pMinimap/pMinimap.toc
@@ -1,6 +1,6 @@
 ## Interface: 20400
 ## Author: p3lim
-## Version: Revision wowi:revision
+## Version: 20400.wowi:revision
 ## Title: |cffff6000p|rMinimap
 ## Notes: Yet another square minimap addon
 ## OptionalDeps: LibStub, LibSimpleOptions-1.0
diff --git a/pMinimap/pMinimapConfig.lua b/pMinimap/pMinimapConfig.lua
index 71ddcf6..bd2fdb0 100644
--- a/pMinimap/pMinimapConfig.lua
+++ b/pMinimap/pMinimapConfig.lua
@@ -90,11 +90,13 @@ local function CreateOptions(self, db)
 	):SetPoint('TOPLEFT', sub, 'BOTTOMLEFT', 0, -156)
 end

-function pMinimap:PLAYER_ENTERING_WORLD()
+function pMinimap:PLAYER_ENTERING_WORLD(event)
 	local db = pMinimapDB or {point = {'TOPRIGHT', 'UIParent', 'TOPRIGHT', -15, -15}, scale = 0.9, offset = 1, colors = {0, 0, 0, 1}, durability = true}

 	LibStub('LibSimpleOptions-1.0').AddOptionsPanel('pMinimap', function(self) CreateOptions(self, db) end)
 	LibStub('LibSimpleOptions-1.0').AddSlashCommand('pMinimap', '/pminimap', '/pmm')

+	self:UnregisterEvent(event)
+
 	pMinimapDB = db
 end
\ No newline at end of file