Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isMag) then
- -- Highlight ammo for this magazine.
- local invAmmo={}
- local function getInvammo(target, localItem)
- local isAmmo = IsAmmoForMagazine(item,localItem)
- if(isAmmo) then
- table.insert(invAmmo,localItem:section())
- end
- end
- local player = db.actor
- player:iterate_inventory(getInvammo,player)
- if(invAmmo) then
- local inventory = GetActorMenu();
- if not (inventory and inventory:IsShown()) then
- return
- end
- for i=1,#invAmmo do
- inventory:highlight_section_in_slot(invAmmo[i],EDDListType.iActorBag)
- end
- end
- end
- if(isWep) then
- -- Highlight mags for this weapon.
- local inventory = GetActorMenu();
- local magsToHighlight={}
- local function getInvMags(target, localItem)
- local isMag = isMagazine(localItem)
- if(isMag and IsMagazineForWeapon(item,localItem)) then
- table.insert(magsToHighlight,localItem:section())
- end
- end
- local player = db.actor
- player:iterate_inventory(getInvMags,player)
- if not (magsToHighlight or (inventory and inventory:IsShown())) then
- return
- end
- for i=1,#magsToHighlight do
- inventory:highlight_section_in_slot(magsToHighlight[i],EDDListType.iActorBag)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement