GnomishVendorShrinker/Init.lua

47 lines
1.2 KiB
Lua
Raw Normal View History

2016-09-12 00:28:04 +00:00
local myname, ns = ...
local ItemSearch = ns.LibItemSearch
ns.LibItemSearch = nil
local NUMROWS, SCROLLSTEP = 14, 5
local function Hide(frame)
frame:Hide()
frame.Show = frame.Hide
end
function ns.OnLoad()
local GVS = ns.NewMainFrame()
GVS:SetWidth(315)
GVS:SetHeight(294)
2016-09-12 02:21:48 +00:00
GVS:SetPoint("TOPLEFT", MerchantFrame, 8, -67)
2016-09-12 00:28:04 +00:00
-- Reanchor the buyback button, it acts weird when switching tabs otherwise...
MerchantBuyBackItem:ClearAllPoints()
MerchantBuyBackItem:SetPoint("BOTTOMRIGHT", -7, 33)
2016-09-12 04:01:26 +00:00
-- The little class select dropdown show trigget a refresh
2016-09-12 02:21:48 +00:00
hooksecurefunc("SetMerchantFilter", function() GVS:GetScript("OnShow")(GVS) end)
2016-09-12 00:28:04 +00:00
2016-09-12 04:01:26 +00:00
-- Force show when we're loaded on demand and the tab is already selected
2016-09-12 02:21:48 +00:00
if MerchantFrame:IsVisible() and MerchantFrame.selectedTab == 1 then
GVS:Show()
end
2016-09-12 00:28:04 +00:00
-- Reparent the first 10 MerchantItem frames, so they only appear for buyback
for i=1,10 do _G["MerchantItem"..i]:SetParent(MerchantItem11) end
2016-09-12 00:28:04 +00:00
2016-09-12 04:01:26 +00:00
-- Hide frames we don't need now
Hide(MerchantNextPageButton)
Hide(MerchantPrevPageButton)
Hide(MerchantPageText)
2016-09-12 00:28:04 +00:00
-- Clean up our frame factories
for i,v in pairs(ns) do if i:match("^New") then ns[i] = nil end end
end