This commit is contained in:
2019-09-10 09:29:53 +02:00
parent 9413b30151
commit c73fefb68d
8 changed files with 54 additions and 136 deletions

View File

@ -53,6 +53,18 @@ function ns.NewMainFrame()
search:SetScript("OnTextChanged", Refresh)
local function Open(self)
self.Merchant = UnitGUID("npc")
local max = math.max(0, GetMerchantNumItems() - NUMROWS)
scrollbar:SetMinMaxValues(0, max)
scrollbar:SetValue(0)
Refresh()
GVS:RegisterEvent("BAG_UPDATE")
GVS:RegisterEvent("MERCHANT_UPDATE")
GVS:RegisterEvent("MERCHANT_SHOW")
end
GVS:EnableMouseWheel(true)
GVS:SetScript("OnMouseWheel", function(self, value)
if value > 0 then
@ -62,15 +74,7 @@ function ns.NewMainFrame()
end
end)
GVS:SetScript("OnEvent", Refresh)
GVS:SetScript("OnShow", function(self)
local max = math.max(0, GetMerchantNumItems() - NUMROWS)
scrollbar:SetMinMaxValues(0, max)
scrollbar:SetValue(0)
Refresh()
GVS:RegisterEvent("BAG_UPDATE")
GVS:RegisterEvent("MERCHANT_UPDATE")
end)
GVS:SetScript("OnShow", Open)
GVS:SetScript("OnHide", GVS.UnregisterAllEvents)
return GVS

View File

@ -34,7 +34,8 @@ end
local function OnClick(self, button)
local id = self:GetID()
local hasaltcurrency = (GetMerchantItemCostInfo(id) > 0)
local currencyname = select(4,GetMerchantItemCostItem(id, 1))
local hasaltcurrency = ((GetMerchantItemCostInfo(id) > 0) and (select(4,GetMerchantItemCostItem(id, 1)) ~= "Garrison Resources"))
if IsAltKeyDown() and not hasaltcurrency then
self:BuyItem(true)
@ -129,7 +130,12 @@ local function SetValue(self, i)
self.ItemName:SetText(text)
self.AltCurrency:SetValue(i)
if self.AltCurrency:IsShown() then
self.ItemName:SetPoint("RIGHT", self.AltCurrency, "LEFT", -GAP, 0)
else
self.ItemName:SetPoint("RIGHT", self.ItemPrice, "LEFT", -GAP, 0)
end
if extendedCost then
self.link, self.texture, self.extendedCost = link, itemTexture, true
end

View File

@ -4,8 +4,10 @@ local myname, ns = ...
function ns.NewSearchField(parent)
local editbox = ns.NewTextInput(parent)
editbox:SetPoint("BOTTOMLEFT", parent, "TOPLEFT", 55, 9)
editbox:SetPoint("TOPLEFT", parent, "TOPLEFT", 98, 42) -- fixed for LeilaUI
editbox:SetPoint("TOPLEFT", parent, "TOPLEFT", 98, 42) -- fixed for LeilaUI
editbox:SetWidth(56) -- added for LeilaUI
editbox:SetHeight(32) -- added for LeilaUI
editbox.placeholder:SetText("Search...")
editbox:SetScript("OnEnter", function(self)