Skip to content

Can i made some PR ? #60

@cyberbobjr

Description

@cyberbobjr

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions