local defaults = { pitch = -3.9, yaw = 2, roll = -3, right = -0.01, up = -0.01, forwards = 0, fire_timeout = 30, aim_timeout = 5, recover_length = 2, droop_rate = 2, droop_rate_ads = 3.5, } ID = "lual_dynamic_viewmodel" op = { id = ID, sh = true, gr = { { id = "pitch", type = "track", val = 2, min = -45, max = 45, step = 0.1 }, { id = "yaw", type = "track", val = 2, min = -45, max = 45, step = 0.1 }, { id = "roll", type = "track", val = 2, min = -45, max = 45, step = 0.1 }, { id = "right", type = "track", val = 2, min = -0.5, max = 0.5, step = 0.01 }, { id = "up", type = "track", val = 2, min = -0.5, max = 0.5, step = 0.01 }, { id = "forwards", type = "track", val = 2, min = -0.5, max = 0.5, step = 0.01 }, { id = "fire_timeout", type = "track", val = 2, min = 0, max = 120, step = 0.1 }, { id = "aim_timeout", type = "track", val = 2, min = 0, max = 120, step = 0.1 }, { id = "recover_length", type = "track", val = 2, min = 0, max = 10, step = 0.1 }, { id = "droop_rate", type = "track", val = 2, min = 0, max = 10, step = 0.1 }, { id = "droop_rate_ads", type = "track", val = 2, min = 0, max = 10, step = 0.1 }, } } for _, entry in ipairs(op.gr) do entry.def = assert(defaults[entry.id], "No default MCM value set for '" .. entry.id .. "'!") end function get_config(key) if ui_mcm then return ui_mcm.get(ID .. "/" .. key) else return defaults[key] end end function on_mcm_load() return op end