Skip to content

Commit 8e43cda

Browse files
committed
fix hover UI bugs
1 parent 203df04 commit 8e43cda

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/ui.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,18 @@ function CardArea:init(X, Y, W, H, config)
279279
return cainit(self, X, Y, W, H, config)
280280
end
281281

282+
-- Allow highlighting in the collection
282283
local cach = CardArea.can_highlight
283284
function CardArea:can_highlight(card)
284285
if self.config.collection then
285286
return true
286287
end
287288
return cach(self)
288289
end
290+
291+
-- Prevent hover UI from being redrawn
292+
local ch = Card.hover
293+
function Card:hover()
294+
if self.children.h_popup then return end
295+
ch(self)
296+
end

lovely/lib_ui.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,13 @@ target = "functions/misc_functions.lua"
8787
pattern = "detailed_tooltip = part.control.T and (G.P_CENTERS[part.control.T] or G.P_TAGS[part.control.T]) or nil,"
8888
position = 'at'
8989
match_indent = true
90-
payload = "detailed_tooltip = part.control.T and Cryptid.get_center(part.control.T) or nil,"
90+
payload = "detailed_tooltip = part.control.T and Cryptid.get_center(part.control.T) or nil,"
91+
92+
# Remove consumable use UI in the collection
93+
[[patches]]
94+
[patches.pattern]
95+
target = "card.lua"
96+
pattern = "if self.highlighted and self.area and self.area.config.type ~= 'shop' then"
97+
position = 'at'
98+
match_indent = true
99+
payload = "if self.highlighted and self.area and self.area.config.type ~= 'shop' and not self.area.config.collection then"

0 commit comments

Comments
 (0)