Skip to content

Commit 7b26be3

Browse files
authored
spectate.lua: alternative way to make config public
1 parent 5e835fa commit 7b26be3

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

plugins/lua/spectate.lua

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,6 @@ end
8686

8787
local config, save_state = load_state()
8888

89-
-- called by gui/spectate
90-
function get_config_elem(name, key)
91-
local elem = config[name]
92-
if not elem then return end
93-
if type(elem) == 'table' then
94-
return elem[key]
95-
end
96-
return elem
97-
end
98-
9989
function refresh_cpp_config()
10090
for name,value in pairs(config) do
10191
if not name:startswith(lua_only_settings_prefix) then
@@ -624,4 +614,7 @@ OVERLAY_WIDGETS = {
624614
tooltip=TooltipOverlay,
625615
}
626616

617+
-- make public
618+
_ENV.config, _ENV.save_state = config, save_state
619+
627620
return _ENV

0 commit comments

Comments
 (0)