Skip to content

Commit 820ebbb

Browse files
committed
fix: splash screen cards animate properly again
fixes #1136
1 parent b2d54af commit 820ebbb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lovely/easings.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ priority = -5
99
target = "engine/event.lua"
1010
pattern = "type = config.ease or 'lerp',"
1111
position = "at"
12-
payload = "type = config.type or config.ease and string.lower(config.ease) or 'lerp',"
12+
payload = "type = config.type and string.lower(config.type) or config.ease and string.lower(config.ease) or 'lerp',"
1313
match_indent = true
1414

1515
[[patches]]
@@ -31,8 +31,22 @@ payload = '''
3131
local c1 = 1.70158
3232
local c2 = c1 * 1.525
3333
local c3 = c1 + 1
34+
3435
assert(SMODS.ease_types[self.ease.type], "Event created with invalid ease type: "..self.ease.type..(self.func and SMODS.log_crash_info(debug.getinfo(self.func), true)))
3536
percent_done = SMODS.ease_types[self.ease.type](percent_done, c1, c2, c3)
3637
3738
self.ease.ref_table[self.ease.ref_value] = self.func(percent_done*self.ease.start_val + (1-percent_done)*self.ease.end_val)'''
3839
match_indent = true
40+
41+
# Fix easing type of splash screen cards (vanilla implementation is broken and always uses 'lerp')
42+
[[patches]]
43+
[patches.pattern]
44+
target = 'game.lua'
45+
match_indent = true
46+
position = 'at'
47+
pattern = '''
48+
ease_value(card.T, 'scale', -card.T.scale, nil, nil, nil, 1.*speed, 'elastic')
49+
'''
50+
payload = '''
51+
ease_value(card.T, 'scale', -card.T.scale, nil, nil, nil, 1.*speed)
52+
'''

0 commit comments

Comments
 (0)