Divergent/mods/Toggle Scope/gamedata/scripts/ish_toggle_scope_mcm.script

33 lines
899 B
Plaintext
Raw Permalink Normal View History

2024-03-17 20:18:03 -04:00
--
-- ToggleScope v1.9.1
-- Last modified: 2022.01.24
-- https://github.com/Ishmaeel/toggle-scope
--
KEY_TOGGLE_SCOPE = DIK_keys.DIK_ADD -- KeyPad Plus
local mcm_keybinds = ui_mcm and ui_mcm.key_hold
function on_game_start()
RegisterScriptCallback("on_option_change", on_option_change)
on_option_change(mcm_keybinds)
end
function on_mcm_load()
return {
id = "toggle_scope",
sh = true,
gr = {
-- LuaFormatter off
{id = "title", type = "slide", link = "ui_options_slider_player", text = "ui_mcm_menu_toggle_scope", size = {512, 50}, spacing = 20},
{id = "key_bind_toggle", type = "key_bind", val = 2, def = KEY_TOGGLE_SCOPE}
-- LuaFormatter on
}
}
end
function on_option_change(mcm)
if mcm then
KEY_TOGGLE_SCOPE = ui_mcm.get("toggle_scope/key_bind_toggle") or KEY_TOGGLE_SCOPE
end
end