From d64abbcb42747ea085366636440e675cecfd7749 Mon Sep 17 00:00:00 2001 From: F16Gaming Date: Tue, 23 Oct 2012 03:12:43 +0200 Subject: [PATCH] Minor fixes to the ScrollFrame in MobListGUI. Make ScrollFrame stay consistent between Hide/Show. --- MobList.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MobList.lua b/MobList.lua index bec55f1..c5cb849 100644 --- a/MobList.lua +++ b/MobList.lua @@ -134,12 +134,12 @@ function ML:Show() if not created then ML:Create() end - if frame:IsShowing() then return end + if frame:IsShown() then return end frame:Show() end function ML:Hide() - if not frame or not frame:IsShowing() then return end + if not frame or not frame:IsShown() then return end frame:Hide() end @@ -311,6 +311,10 @@ function ML:Create() frame.statusLabel:SetText(STATUS_TEXT:format(1, limit, #Mobs)) self:UpdateEntries(LastOffset) + + frame:SetScript("OnShow", function() ML:UpdateMobs() ML:UpdateEntries() end) + + created = true end function ML:UpdateMobs(sort) @@ -336,7 +340,7 @@ function ML:UpdateEntries(offset) end return end - offset = tonumber(offset) or 0 + offset = (tonumber(offset) or LastOffset) or 0 LastOffset = offset local limit = ROW_COUNT if limit > #Mobs then -- 1.7.9.5