-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.lua
More file actions
35 lines (31 loc) · 1.23 KB
/
common.lua
File metadata and controls
35 lines (31 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-- description tab loc vars in mods menu
SMODS.current_mod.description_loc_vars = function()
-- shadow is still awaiting PR as of 2025/02/02, see https://github.com/Steamodded/smods/pull/433
return { background_colour = G.C.CLEAR, text_colour = G.C.WHITE, scale = 1.2, shadow = true }
end
-- add clickable link in description tab
SMODS.current_mod.custom_ui = function(nodes)
local title, description = unpack(nodes)
local twitch_deepfind = SMODS.deepfind(description, "twitch.tv/calexil", true)[1]
if twitch_deepfind then
-- hacky, maybe there's a better way than this?
local twitch_link_table = twitch_deepfind.objtree[#twitch_deepfind.objtree-2]
twitch_link_table.config.button = "go_to_calexil_twitch"
twitch_link_table.config.tooltip = {text = {localize('b_open_link')}}
end
end
G.FUNCS.go_to_calexil_twitch = function(e)
love.system.openURL("https://twitch.tv/calexil")
end
local old_loc_colour = loc_colour
function loc_colour(_c, _default)
-- hook for custom colours
local custom_colours = {
neat_lia = HEX("A7C7E7"),
neat_lars = HEX("1F62CA")
}
if custom_colours[_c] then
return custom_colours[_c]
end
return old_loc_colour(_c, _default)
end