Skip to content

Commit

Permalink
Change default screenshot path to a relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
crosire committed Jul 10, 2022
1 parent e75eb4e commit 269bc98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
18 changes: 5 additions & 13 deletions source/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ reshade::runtime::runtime(api::device *device, api::command_queue *graphics_queu
_texture_search_paths({ L".\\" }),
#endif
_config_path(g_reshade_base_path / L"ReShade.ini"),
_screenshot_path(g_reshade_base_path),
_screenshot_path(L".\\"),
_screenshot_name("%AppName% %Date% %Time%"),
_screenshot_post_save_command_arguments("\"%TargetPath%\""),
_screenshot_post_save_command_working_directory(g_reshade_base_path)
_screenshot_post_save_command_working_directory(L".\\")
{
assert(device != nullptr && graphics_queue != nullptr);

Expand Down Expand Up @@ -4307,21 +4307,13 @@ bool reshade::runtime::execute_screenshot_post_save_command(const std::filesyste
});
}

std::filesystem::path working_directory;
if (_screenshot_post_save_command_working_directory.empty() || !std::filesystem::is_directory(_screenshot_post_save_command_working_directory, ec))
working_directory = g_reshade_base_path;
else
working_directory = _screenshot_post_save_command_working_directory;

if (execute_command(command_line, working_directory, _screenshot_post_save_command_no_window))
{
return true;
}
else
if (!execute_command(command_line, g_reshade_base_path / _screenshot_post_save_command_working_directory, _screenshot_post_save_command_no_window))
{
LOG(ERROR) << "Failed to execute screenshot post-save command.";
return false;
}

return true;
}

bool reshade::runtime::get_texture_data(api::resource resource, api::resource_usage state, uint8_t *pixels)
Expand Down
4 changes: 0 additions & 4 deletions source/runtime_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2334,10 +2334,7 @@ void reshade::runtime::draw_gui_addons()
std::filesystem::path addon_search_path = g_reshade_base_path;
global_config().get("INSTALL", "AddonPath", addon_search_path);
if (imgui::directory_input_box("Add-on search path", addon_search_path, _file_selection_path))
{
global_config().set("INSTALL", "AddonPath", addon_search_path);
global_config().save();
}
#endif

ImGui::Spacing();
Expand Down Expand Up @@ -2380,7 +2377,6 @@ void reshade::runtime::draw_gui_addons()
disabled_addons.push_back(info.name);

global_config().set("ADDON", "DisabledAddons", disabled_addons);
global_config().save();
}

ImGui::PopStyleColor();
Expand Down

0 comments on commit 269bc98

Please sign in to comment.