Thank you for your help kurapica. I tried your solution but it didn't change. Counts are displayed when no filter is applied and not displayed when any of them is applied.
I even tried to completely remove the texture part and set the fontstring as direct child to the scrollframe:
Code:
function Merchant.UI.AddStockpileStock(itemID, count)
if #Merchant.UI.StockpileStocks < Merchant.UI.StockpileStockCnt then
local frame = Merchant.UI.StockpileGridScrollFrameContent
local x = (32 + 10) * ((Merchant.UI.StockpileStockCnt - 1) % Merchant.UI.StockpileGridMaxPerLine)
local y = (-32 - 10) * math.floor((Merchant.UI.StockpileStockCnt - 1) / Merchant.UI.StockpileGridMaxPerLine)
-- local iconFrame = CreateFrame("Frame", nil, frame)
-- iconFrame:SetSize(32, 32)
-- iconFrame:SetPoint("TOPLEFT", x, y)
-- local itemTexture = iconFrame:CreateTexture(nil, "ARTWORK")
-- itemTexture:SetAllPoints()
-- local countFrame = CreateFrame("Frame", nil, frame)
-- countFrame:SetSize(32, 32)
-- countFrame:SetPoint("TOPLEFT", x, y - 9)
local itemCountText = frame:CreateFontString(nil, "OVERLAY")
itemCountText:SetPoint("TOPLEFT", x, y)
-- itemCountText:SetPoint("BOTTOMRIGHT", -4, 4)
-- itemCountText:SetAllPoints()
itemCountText:SetFont("Fonts\\FRIZQT__.TTF", 11, "THICKOUTLINE")
itemCountText:SetJustifyH("RIGHT")
table.insert(Merchant.UI.StockpileStocks, {
-- IconFrame = iconFrame,
-- ItemTexture = itemTexture,
-- ItemCountFrame = countFrame,
ItemCountText = itemCountText
})
end
local stock = Merchant.UI.StockpileStocks[Merchant.UI.StockpileStockCnt]
-- stock.ItemTexture:SetTexture(GetItemIcon(itemID))
stock.ItemCountText:SetText("|cFFFFFFFF" .. tostring(count))
-- Merchant.Debug(stock.ItemCountText:GetText())
Merchant.UI.StockpileStockCnt = Merchant.UI.StockpileStockCnt + 1
Merchant.UI.StockpileGridScrollFrameContent:SetHeight((32 + 10) * math.floor((Merchant.UI.StockpileStockCnt - 1) / Merchant.UI.StockpileGridMaxPerLine))
end
but the issue is still here.
I added a dump in the chat/console of "stock.ItemCountText:GetText()" and it's good, the value is good.