PZ-Community-API icon indicating copy to clipboard operation
PZ-Community-API copied to clipboard

Can i made some PR ?

Open cyberbobjr opened this issue 6 months ago • 0 comments

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 ?

cyberbobjr avatar Aug 06 '24 09:08 cyberbobjr