1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Overlays: Add screenshot message to queue

This commit is contained in:
Megamouse 2022-05-24 22:51:30 +02:00
parent 478b6b53a9
commit 345bda69ec
3 changed files with 11 additions and 2 deletions

View File

@ -6,7 +6,8 @@ namespace rsx
{
namespace overlays
{
message_item::message_item(localized_string_id msg_id)
template <typename T>
message_item::message_item(T msg_id)
{
m_expiration_time = get_system_time() + 5'000'000;
@ -20,6 +21,8 @@ namespace rsx
m_fade_animation.duration = 2.f;
m_fade_animation.active = true;
}
template message_item::message_item(std::string msg_id);
template message_item::message_item(localized_string_id msg_id);
u64 message_item::get_expiration() const
{

View File

@ -10,7 +10,8 @@ namespace rsx
class message_item
{
public:
message_item(localized_string_id msg_id);
template <typename T>
message_item(T msg_id);
void update(usz index, u64 time);
u64 get_expiration() const;

View File

@ -12,6 +12,7 @@
#include "Emu/Cell/Modules/cellScreenshot.h"
#include "Emu/Cell/Modules/cellVideoOut.h"
#include "Emu/RSX/rsx_utils.h"
#include "Emu/RSX/Overlays/overlay_message.h"
#include <QApplication>
#include <QDateTime>
@ -770,6 +771,10 @@ void gs_frame::take_screenshot(std::vector<u8> data, const u32 sshot_width, cons
}
});
ensure(filename.find(fs::get_config_dir()) != filename.npos);
const std::string shortpath = filename.substr(fs::get_config_dir().size() - 1); // -1 for /
rsx::overlays::queue_message(tr("Screenshot saved: %0").arg(QString::fromStdString(shortpath)).toStdString());
return;
},
std::move(data))