Skip to content

Commit aceee93

Browse files
committed
Better UI
1 parent 9f71963 commit aceee93

File tree

5 files changed

+36
-7
lines changed

5 files changed

+36
-7
lines changed

items/spooky.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ local choco_dice = {
117117
no_dbl = true,
118118
loc_vars = function(self, info_queue, center)
119119
if not center then --tooltip
120-
elseif not center.added_to_deck then
121-
for i = 1, 10 do
122-
info_queue[#info_queue + 1] = { set = "Other", key = "ev_cry_choco" .. i }
123-
end
124120
else
125121
SMODS.Events["ev_cry_choco" .. center.ability.extra.roll]:loc_vars(info_queue, center)
126122
end

lib/event.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SMODS.Event = SMODS.GameObject:extend({
99
"key",
1010
},
1111
inject = function() end,
12-
set = "Event",
12+
set = "Other",
1313
class_prefix = "ev",
1414
-- This should be called to start an event.
1515
start = function(self)

lib/ui.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,17 @@ SMODS.DrawStep({
222222
conditions = { vortex = false, facing = "front" },
223223
})
224224
SMODS.draw_ignore_keys.floating_sprite2 = true
225+
226+
227+
-- Make hover UI collidable - so we can detect collision and display tooltips
228+
local m = Card.move
229+
function Card:move(dt)
230+
m(self, dt)
231+
if self.children.h_popup then
232+
self.children.h_popup.states.collide.can = true
233+
if not self.highlighted and not self.states.hover.is then
234+
self.children.h_popup:remove()
235+
self.children.h_popup = nil
236+
end
237+
end
238+
end

localization/en-us.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3924,8 +3924,9 @@ return {
39243924
ev_cry_choco0 = {
39253925
name = "",
39263926
text = {
3927-
"Details of an active",
3928-
"{C:cry_ascendant,E:1}event{} will appear here",
3927+
"Possible events:",
3928+
"{T:ev_cry_choco1}1{} {T:ev_cry_choco2}2{} {T:ev_cry_choco3}3{} {T:ev_cry_choco4}4{} {T:ev_cry_choco5}5{}",
3929+
"{T:ev_cry_choco6}6{} {T:ev_cry_choco7}7{} {T:ev_cry_choco8}8{} {T:ev_cry_choco9}9{} {T:ev_cry_choco10}10{}",
39293930
},
39303931
},
39313932
ev_cry_choco1 = {

lovely/lib_ui.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,21 @@ pattern = "if (self.edition and self.edition.negative) or (self.ability.name ==
7070
position = 'at'
7171
match_indent = true
7272
payload = "if (self.edition and (self.edition.negative or self.edition.cry_oversat)) or (self.ability.name == 'Antimatter' and (self.config.center.discovered or self.bypass_discovery_center)) then"
73+
74+
# Make description UI always appear if card is highlighted
75+
[[patches]]
76+
[patches.pattern]
77+
target = "engine/node.lua"
78+
pattern = "if self.children.h_popup then"
79+
position = 'at'
80+
match_indent = true
81+
payload = "if self.children.h_popup and not self.highlighted then"
82+
83+
# Let description tooltips work for any object
84+
[[patches]]
85+
[patches.pattern]
86+
target = "functions/misc_functions.lua"
87+
pattern = "detailed_tooltip = part.control.T and (G.P_CENTERS[part.control.T] or G.P_TAGS[part.control.T]) or nil,"
88+
position = 'at'
89+
match_indent = true
90+
payload = "detailed_tooltip = part.control.T and Cryptid.get_center(part.control.T) or nil,"

0 commit comments

Comments
 (0)