Open veechs opened 6 months ago
I just realized that always relying on Blizzard code means that when charges is at 1, they’ll be hidden just like count, which is probably why you didn’t write it that way. So if that’s your goal, feel free to ignore this (you’ll probably still want to fix the string concatenation bug though).
A simple fix for only the concatination issue would be:
function SUPERAPIHOOK_SetItemButtonCount(button, count)
if not button or not count then
return SUPERAPIHOOK_SetItemButtonCountOriginal(button, count)
end
if (count < 0) then
getglobal(button:GetName().."Count"):SetText((count < -999) and "*" or math.abs(count));
getglobal(button:GetName().."Count"):Show();
getglobal(button:GetName().."Count"):SetFontObject(NumberFontNormalYellow);
else
getglobal(button:GetName().."Count"):SetFontObject(NumberFontNormal);
SUPERAPIHOOK_SetItemButtonCountOriginal(button, count)
end
end
Updates to
SUPERAPIHOOK_SetItemButtonCount
:Interface\AddOns\SuperAPI\SuperAPI.lua:123: attempt to perform arithmetic on local
count' (a string value) whencount
< -999.button.count
to 0 so the split stack code doesn't get confused.)