Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions utilities/definitions/paperclips.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ PB_UTIL.ENABLED_PAPERCLIPS = {
if PB_UTIL.config.paperclips_enabled then
-- Table to hold all paperclip keys regardless of mod of origin for easy reference
PB_UTIL.Paperclips = {}
PB_UTIL.Paperclips_keys = {}

PB_UTIL.Paperclip = SMODS.Sticker:extend {
prefix_config = { key = true },
Expand All @@ -31,6 +32,7 @@ if PB_UTIL.config.paperclips_enabled then

inject = function(self, i)
SMODS.Sticker.inject(self, i)
PB_UTIL.Paperclips_keys[self.key] = true
table.insert(PB_UTIL.Paperclips, self.key)
end,

Expand Down
7 changes: 1 addition & 6 deletions utilities/misc_functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ end
---@param str string
---@return boolean
function PB_UTIL.is_paperclip(str)
for _, v in ipairs(PB_UTIL.Paperclips or {}) do
if v == str then
return true
end
end
return false
return PB_UTIL.Paperclips_keys[str] == true
end

---Checks if a card has a paperclip. If found, the first value returned is the key.
Expand Down