diff --git a/SteaSummon.toc b/SteaSummon.toc index 0578c35..3d28f4b 100755 --- a/SteaSummon.toc +++ b/SteaSummon.toc @@ -2,7 +2,7 @@ ## Title: SteaSummon ## Notes: Warlock Summoning ## Author: Stea -## Version: 0.47 +## Version: 0.48 ## SavedVariablesPerCharacter: SteaSummonSave, SteaDEBUG diff --git a/settings.lua b/settings.lua index 6a889e7..3633132 100644 --- a/settings.lua +++ b/settings.lua @@ -58,8 +58,8 @@ settings = { SteaSummonSave.buffs = true end - if SteaSummonSave.windowPos == nil then - SteaSummonSave.windowPos = {} + if SteaSummonSave.windowPos == nil or (type(SteaSummonSave.windowPos[2]) == "table" or not SteaSummonSave.windowPos["height"]) then + SteaSummonSave.windowPos = {"CENTER", nil, "CENTER", 0, 0, ["height"] = 300, ["width"] = 250} end end, @@ -81,7 +81,7 @@ settings = { SteaSummonSave.timeStamp = 0 SteaSummonSave.waitingKeepTime = 5 SteaSummonSave.buffs = true - SteaSummonSave.windowPos = {} + SteaSummonSave.windowPos = {"CENTER", nil, "CENTER", 0, 0, ["height"] = 300, ["width"] = 250} end, findSummonWord = function(self, phrase) @@ -143,11 +143,11 @@ settings = { end, getWindowPos = function(self) - return SteaSummonSave.winowPos + return SteaSummonSave.windowPos end, setWindowPos = function(self, pos) - SteaSummonSave.winowPos = pos + SteaSummonSave.windowPos = pos end, } diff --git a/summon.lua b/summon.lua index 681acf6..eaec576 100644 --- a/summon.lua +++ b/summon.lua @@ -291,9 +291,10 @@ local summon = { f:SetPoint("CENTER") f:SetSize(300, 250) f:SetScale(SteaSummonSave.windowSize) + local wpos = addonData.settings:getWindowPos() - if wpos and #wpos then - cprint("summon.display", wpos[1], wpos[2], wpos[3], wpos[4], wpos[5], "width:", wpos["width"], "height:", wpos["height"]) + if wpos and #wpos > 0 then + db("summon.display", wpos[1], wpos[2], wpos[3], wpos[4], wpos[5], "width:", wpos["width"], "height:", wpos["height"]) f:ClearAllPoints() f:SetPoint(wpos[1], wpos[2], wpos[3], wpos[4], wpos[5]) --f:SetPoint("TOPLEFT", UIParent, "TOPLEFT", wpos["left"], wpos["top"])