mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 22:05:06 +00:00
gfx-shader: Add default path for file selection
This commit is contained in:
parent
6c603795db
commit
a19e8d1e00
1 changed files with 9 additions and 1 deletions
|
@ -200,8 +200,16 @@ void gfx::shader::shader::properties(obs_properties_t* pr)
|
||||||
obs_properties_add_group(pr, ST_SHADER, D_TRANSLATE(ST_SHADER), OBS_GROUP_NORMAL, grp);
|
obs_properties_add_group(pr, ST_SHADER, D_TRANSLATE(ST_SHADER), OBS_GROUP_NORMAL, grp);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
std::string path = "";
|
||||||
|
if (_shader_file.has_parent_path()) {
|
||||||
|
path = _shader_file.parent_path().string();
|
||||||
|
} else {
|
||||||
|
char* vp = obs_module_file("examples");
|
||||||
|
path = vp;
|
||||||
|
bfree(vp);
|
||||||
|
}
|
||||||
auto p = obs_properties_add_path(grp, ST_SHADER_FILE, D_TRANSLATE(ST_SHADER_FILE), OBS_PATH_FILE, "*.*",
|
auto p = obs_properties_add_path(grp, ST_SHADER_FILE, D_TRANSLATE(ST_SHADER_FILE), OBS_PATH_FILE, "*.*",
|
||||||
nullptr);
|
path.c_str());
|
||||||
obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_SHADER_FILE)));
|
obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_SHADER_FILE)));
|
||||||
/*obs_property_set_modified_callback2(
|
/*obs_property_set_modified_callback2(
|
||||||
p,
|
p,
|
||||||
|
|
Loading…
Reference in a new issue