Ради вашего удобства наш сайт использует cookies! Узнать больше! Мы используем cookies

Tooltiplib - Tooltip Framework for Modders

[img]https://pz-mod-images.us-southeast-1.linodeobjects.com/tooltiplib-banner.png[/img] Half the Workshop independently hooks ISToolTipInv.render to add content to item tooltips. Every one of them saves the original function, replaces it with their own, crosses its fingers, and ships. Load two together and it's a coin flip whose content shows up. TooltipLib fixes this. One managed hook per surface. Mods register as providers instead of fighting over who owns the render function. Priority ordering, error isolation, automatic column alignment, two-tier caching. Install it and every tooltip mod works together — aligned, organized, conflict-free. [img]https://pz-mod-images.us-southeast-1.linodeobjects.com/tooltiplib-flow.png[/img] [hr] [b]For Players[/b] Install it. If a mod lists TooltipLib as a dependency, install TooltipLib. No configuration. No load order fiddling. No compatibility patches. Safe to add mid-save. Safe to remove mid-save. No persistent state. Writes nothing to your save file. [hr] [img]https://pz-mod-images.us-southeast-1.linodeobjects.com/header-surfaces.png[/img] [b]Item[/b] — Inventory tooltips. The one everyone fights over. Not anymore. [b]Item Slot[/b] — Crafting panel slots. Item providers auto-apply here. [b]World Object[/b] — Generators, fridges, rain collectors, containers — anything in the world. [b]Skill[/b] — Character skill bars. Rich text. [b]Vehicle[/b] — Mechanic overlay part tooltips. Rich text. [b]Recipe[/b] — Build 42 crafting recipe side panel. All six share the same context method interface. Write a provider once, point it at any surface. [hr] [img]https://pz-mod-images.us-southeast-1.linodeobjects.com/header-formodders.png[/img] One call. No hooking, no metatable juggling, no layout lifecycle. require "TooltipLib/Core" TooltipLib.registerProvider({ id = "MyMod_WeaponStats", target = "item", enabled = TooltipLib.Filters.weapon, cacheable = true, description = "Weapon damage stats", callback = function(ctx) ctx:addKeyValue("Damage:", "+15%", nil, TooltipLib.Colors.GREEN) ctx:addProgress("Mastery:", 0.75, nil, TooltipLib.Colors.GOLD) end, }) The framework handles the hook, the layout, the error handling, and the caching. Your callback adds content. [b]Error isolation.[/b] Every callback runs inside pcall. Provider A fails, providers B through Z keep rendering. Circuit breaker benches repeat offenders after 10 consecutive errors. Cleanup phase runs unconditionally — if your preTooltip modified item state and your callback divided by zero, cleanup still fires. [b]Filtering.[/b] 14 item filters, 3 world object filters, factory functions for custom cases, combinators (allOf, anyOf, negate). Every filter is pcall-hardened. [b]Context methods.[/b] Ten common methods for all surfaces: addLabel addKeyValue addProgress addInteger addFloat addPercentage addSpacer addHeader addDivider addText Layout surfaces (item, itemSlot, object) add texture rendering. Rich text surfaces (skill, vehicle) add line-level formatting. [b]5-phase lifecycle.[/b] preTooltip → callback → textures → postRender → cleanup. In order. Every time. [b]Documentation Bundled w/ Modfiles[/b] [hr] [b]Multiplayer[/b] Item, skill, vehicle, and recipe surfaces are fully client-side. Zero server traffic. World objects use a request-response pipeline on dedicated servers. Client sends one request per object. Server reads whitelisted methods only — getters and boolean checks. No mutations, no arbitrary invocation. Responses cached client-side. Sandbox option EnableMPSync lets admins disable the pipeline. Singleplayer and listen servers read directly. No network overhead. [hr] [b]Compatibility[/b] Works alongside mods that hook ISToolTipInv.render directly — deferred mode detects the foreign hook and renders provider content below it. Works with Inventory Tetris, Equipment UI, and other UI-replacing mods. Multiple mods can bundle TooltipLib — version guard ensures newest copy loads, older ones skip silently. [hr] [b]Requirements[/b] [list] [*] Build 42.13.1+ [*] Safe to add or remove mid-save [*] No persistent state, no save writes [/list] [b]Bug reports:[/b] TooltipLib Version: Game Version: Mode: [SP / MP Host / Dedicated Server] What happened: Other tooltip mods installed: [img]https://pz-mod-images.us-southeast-1.linodeobjects.com/mod-tiles.png[/img] Workshop ID: 3694097672 Mod ID: TooltipLib Workshop ID: 3694097672 Mod ID: TooltipLib Workshop ID: 3694097672 Mod ID: TooltipLib