Speed up animation when many tags exist

This commit is contained in:
Emik 2025-06-29 00:09:03 +02:00
parent 8cf3988bcc
commit e1e0ce0661
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
2 changed files with 15 additions and 12 deletions

View file

@ -6,7 +6,7 @@
"author": [ "author": [
"Emik" "Emik"
], ],
"version": "1.4.2", "version": "1.4.3",
"badge_colour": "8BE9FD", "badge_colour": "8BE9FD",
"main_file": "src/main.lua", "main_file": "src/main.lua",
"badge_text_colour": "44475A", "badge_text_colour": "44475A",

View file

@ -169,10 +169,13 @@ SMODS.Joker {
end end
) )
local trigger = #G.GAME.tags >= 30 and "immediate" or "before"
local delay = #G.GAME.tags >= 30 and 0 or 1 / #G.GAME.tags
F.foreach( F.foreach(
G.GAME.tags, G.GAME.tags,
function(v) function(v)
G.E_MANAGER:add_event(Event({trigger = "immediate", func = fast_delete(v)})) G.E_MANAGER:add_event(Event { trigger = trigger, blocking = #G.GAME.tags < 30, delay = delay, func = fast_delete(v) })
end end
) )