Skip to content

Commit 28218a6

Browse files
Merge pull request #496 from vitellaryjr/force-popup-compat
add a way for other mods to prevent force popup
2 parents aa3476d + 0fb2c8e commit 28218a6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/ui.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ function Card:move(dt)
241241
end
242242
end
243243

244+
function Card:get_banned_force_popup_areas()
245+
return {G.pack_cards}
246+
end
244247
-- This defines when we should show a card's description even when it's not hovered
245248
function Card:force_popup()
246249
-- Must be selected
@@ -262,8 +265,10 @@ function Card:force_popup()
262265
return false
263266
end
264267
-- Other areas where it doesn't work well
265-
if self.area == G.pack_cards then
266-
return false
268+
for i, v in ipairs(self:get_banned_force_popup_areas()) do
269+
if self.area == v then
270+
return false
271+
end
267272
end
268273
return true
269274
end

0 commit comments

Comments
 (0)