Download
(2Kb)
Download
Updated: 12-10-09 09:31 AM
Addon for:
stText.
Pictures
File Info
Updated:12-10-09 09:31 AM
Created:12-06-09 12:10 PM
Downloads:2,336
Favorites:2
MD5:

stText Bags

Version: r2
by: Joschasa [More]

stText_Bags is an optional plugin for stText, which shows, how many bag slots you have used / available.
(Configuration inside Texts.lua)

This Plugin was inspired by SLDataText.

r2 - bump toc to 3.3

r1 - initial release
Post A Reply Comment Options
Unread 05-21-10, 02:36 AM  
Joschasa
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 20
Uploads: 2
Re: Ammo

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.
Report comment to moderator  
Reply With Quote
Unread 03-30-10, 03:31 PM  
BFSskepsis
Premium Member
 
BFSskepsis's Avatar
AddOn Compiler - Click to view compilations

Forum posts: 39
File comments: 192
Uploads: 1
Ammo

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
__________________
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: