提交 11c7e07e 编写于 作者: J jp9000

Add extra search path for third party plugins

The OBSBasic UI will now allow the use of a subdirectory of the user
application data directory for third-party plugins.  Though I'm not
entirely sure if this ideal or not.  Regardless, this is one of the
first (of many) steps towards a plugin manager.

On windows, this is %appdata%/obs-studio/plugins
On linux, this is ~/.obs-studio/plugins
On mac, this is ~/Library/Application Support/obs-sudio/plugins
上级 e87ed914
......@@ -57,6 +57,16 @@ Q_DECLARE_METATYPE(OBSScene);
Q_DECLARE_METATYPE(OBSSceneItem);
Q_DECLARE_METATYPE(order_movement);
static void AddExtraModulePaths()
{
BPtr<char> base_module_dir = os_get_config_path("plugins/%module%");
if (!base_module_dir)
return;
string path = (char*)base_module_dir;
obs_add_module_path((path + "/bin").c_str(), (path + "/data").c_str());
}
OBSBasic::OBSBasic(QWidget *parent)
: OBSMainWindow (parent),
ui (new Ui::OBSBasic)
......@@ -534,6 +544,7 @@ void OBSBasic::OBSInit()
InitOBSCallbacks();
AddExtraModulePaths();
obs_load_all_modules();
if (!InitOutputs())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册