Skip to content

Commit

Permalink
Changed file paths to be Windows compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziray-a committed Jan 23, 2024
1 parent 5fb14ee commit ee89ff7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/plugin-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ OBS_MODULE_USE_DEFAULT_LOCALE(PLUGIN_NAME, "en-US")
std::vector<obs_source *> mutedItems;
bool obs_module_load(void)
{
int conftest = config_open(&pluginConfig,
"./obs-ad-slice-controler.ini",
int conftest = config_open(&pluginConfig, "obs-ad-slice-controler.ini",
CONFIG_OPEN_EXISTING);
if (conftest == CONFIG_FILENOTFOUND) {

pluginConfig = config_create("./obs-ad-slice-controler.ini");
pluginConfig = config_create("obs-ad-slice-controler.ini");

config_set_default_string(pluginConfig, "API", "API-Host",
"http://localhost:5499");
Expand All @@ -62,7 +61,7 @@ bool obs_module_load(void)

} else if (conftest == CONFIG_ERROR) {
obs_log(LOG_INFO, "Error in config file - reseting...");
pluginConfig = config_create("./obs-ad-slice-controler.ini");
pluginConfig = config_create("obs-ad-slice-controler.ini");
}

obs_log(LOG_INFO, "config found reading config");
Expand All @@ -74,8 +73,13 @@ bool obs_module_load(void)
dockWidget->setMinimumHeight(200);
dockWidget->setMinimumWidth(150);

#ifndef _WIN32
if (!obs_frontend_add_dock_by_id(pluginID, "Ad Control", dockWidget))
throw "Could not add dock for plugin";
obs_log(LOG_ERROR, "Could not load dock");
#else
if (!obs_frontend_add_dock(dockWidget))
obs_log(LOG_ERROR, "Could not load dock");
#endif
obs_log(LOG_INFO, "plugin loaded successfully (version %s)",
PLUGIN_VERSION);

Expand Down

0 comments on commit ee89ff7

Please sign in to comment.