PZ-Community-API
PZ-Community-API copied to clipboard
Can i made some PR ?
Hello, I updated the tooltipAPI to be more flexible : with my modification you can now use predicate for tooltip like this :
local function predicateItem(item)
if item.getFabricType then
local fabric = item:getFabricType()
if item:getTags():contains("zReRepairableVest") then
fabric = "Kevlar"
end
if item:getTags():contains("zReRepairableChemsuit") then
fabric = "zReRubberizedFabrics"
end
return fabric ~= nil
end
return false
end
local ItemTooltipPredicate = ItemTooltipAPI.CreateToolTipByPredicate("fabricType", predicateItem)
ItemTooltipPredicate:addField(getText("IGUI_SM_Fabric"), getMaterialText) -- Fixed field value
And i made some modification to fix the compatibility with the latest version of PZ (41.78.16).
Are you open to PR ?