Originally posted by BFSskepsis Any chance to add like an ammo plugin for this? example:
Bags: 30/100(10000) where the number in the parentheses is the ammo?
Something like that would be awesome. Reagents whatever xD
Sorry for my late answer.
I havent tested it yet, but if you replace
Code:
f:SetScript("OnEvent",function()
--== Bags ==--
if(db.Bags) then
local bag_f, bag_text, bg = stCore:CreateText("Bags")
local freeSlots, totalSlots = 0, 0
local UpdateBags = function(self,elapsed)
freeSlots, totalSlots = 0, 0
for i = 0, 4 do
local slots, slotsTotal = GetContainerNumFreeSlots(i), GetContainerNumSlots(i)
freeSlots = freeSlots + slots
totalSlots = totalSlots + slotsTotal
end
if stSettings.Bags_ShowFree then
bag_text:SetText(colorCode.."Bags: |r"..freeSlots.."/"..totalSlots)
else
bag_text:SetText(colorCode.."Bags: |r"..(totalSlots - freeSlots).."/"..totalSlots)
end
end
bag_f:SetScript("OnUpdate",UpdateBags)
end
end)
with
Code:
f:SetScript("OnEvent",function()
--== Bags ==--
if(db.Bags) then
local bag_f, bag_text, bg = stCore:CreateText("Bags")
local freeSlots, totalSlots = 0, 0
local ammoSlot = GetInventorySlotInfo("AmmoSlot");
local ammoCount = 0;
local UpdateBags = function(self,elapsed)
freeSlots, totalSlots = 0, 0
for i = 0, 4 do
local slots, slotsTotal = GetContainerNumFreeSlots(i), GetContainerNumSlots(i)
freeSlots = freeSlots + slots
totalSlots = totalSlots + slotsTotal
end
ammoCount = GetInventoryItemCount("player", ammoSlot);
if ((ammoCount == 1) and (not GetInventoryItemTexture("player", ammoSlot))) then
ammoCount = 0;
end;
if stSettings.Bags_ShowFree then
if( ammoCount > 0) then
bag_text:SetText(colorCode.."Bags: |r"..freeSlots.."/"..totalSlots.." ("..ammoCount..")")
else
bag_text:SetText(colorCode.."Bags: |r"..freeSlots.."/"..totalSlots)
end
else
if( ammoCount > 0) then
bag_text:SetText(colorCode.."Bags: |r"..(totalSlots - freeSlots).."/"..totalSlots.." ("..ammoCount..")")
else
bag_text:SetText(colorCode.."Bags: |r"..(totalSlots - freeSlots).."/"..totalSlots)
end
end
end
bag_f:SetScript("OnUpdate",UpdateBags)
end
end)
it should display the quantity of equipped ammo in parentheses.