diff --git a/lovely/ui.toml b/lovely/ui.toml index a527fa718..8e34dc8cc 100644 --- a/lovely/ui.toml +++ b/lovely/ui.toml @@ -467,6 +467,23 @@ if not v.no_ui then end ''' +# Pool badges +[[patches]] +[patches.pattern] +target = "functions/UI_definitions.lua" +pattern = ''' + if AUT.info then +''' +position = "before" +payload = ''' + for k, v in pairs(SMODS.ObjectTypes) do + if card.config.center.pools and card.config.center.pools[v.key] and type(v.set_badges) == "function" then + v:set_badges(card, badges) + end + end +''' +match_indent = true + # Allow tilt_shadow in define_draw_steps [[patches]] [patches.pattern] diff --git a/lsp_def/classes/object_type.lua b/lsp_def/classes/object_type.lua index 6d82fcf6a..8e20504fc 100644 --- a/lsp_def/classes/object_type.lua +++ b/lsp_def/classes/object_type.lua @@ -21,7 +21,8 @@ ---@field take_ownership? fun(self: SMODS.ObjectType|table, key: string, obj: SMODS.ObjectType|table, silent?: boolean): nil|table|SMODS.ObjectType Takes control of vanilla objects. Child class must have get_obj for this to function ---@field get_obj? fun(self: SMODS.ObjectType|table, key: string): SMODS.ObjectType|table? Returns an object if one matches the `key`. ---@field inject_card? fun(self: SMODS.ObjectType|table, center: table) Injects the center into the ObjectType pools. ----@field remove_card? fun(self: SMODS.ObjectType|table, center: table) Removes the center from ObjectType pools. +---@field remove_card? fun(self: SMODS.ObjectType|table, center: table) Removes the center from ObjectType pools. +---@field set_badges? fun(self: SMODS.ObjectType|table, card: Card|table, badges: table) Append `badges` for additional badges on the UI display of the cards in the pool. ---@overload fun(self: SMODS.ObjectType): SMODS.ObjectType SMODS.ObjectType = setmetatable({}, { __call = function(self)