ImGuiManager: Log OSD messages when they're added

This commit is contained in:
Connor McLaughlin authored and refractionpcsx2 committed 2022-12-16 11:15:42 +00:00
1 parent 6a548440ea
commit dfcf9fa6aa
1 file changed
+11 -1
+11 -1
View File
@@ -41,6 +41,7 @@
#include "HostDisplay.h"
#include "IconsFontAwesome5.h"
#include "PerformanceMetrics.h"
#include "Recording/InputRecording.h"
#ifdef PCSX2_CORE
#include "Frontend/FullscreenUI.h"
@@ -48,7 +49,6 @@
#include "Frontend/InputManager.h"
#include "VMManager.h"
#endif
#include <pcsx2/Recording/InputRecording.h>
namespace ImGuiManager
{
@@ -540,6 +540,11 @@ void Host::AddOSDMessage(std::string message, float duration /*= 2.0f*/)
void Host::AddKeyedOSDMessage(std::string key, std::string message, float duration /* = 2.0f */)
{
if (!key.empty())
Console.WriteLn(Color_StrongGreen, fmt::format("OSD [{}]: {}", key, message));
else
Console.WriteLn(Color_StrongGreen, fmt::format("OSD: {}", message));
OSDMessage msg;
msg.key = std::move(key);
msg.text = std::move(message);
@@ -552,6 +557,11 @@ void Host::AddKeyedOSDMessage(std::string key, std::string message, float durati
void Host::AddIconOSDMessage(std::string key, const char* icon, const std::string_view& message, float duration /* = 2.0f */)
{
if (!key.empty())
Console.WriteLn(Color_StrongGreen, fmt::format("OSD [{}]: {}", key, message));
else
Console.WriteLn(Color_StrongGreen, fmt::format("OSD: {}", message));
OSDMessage msg;
msg.key = std::move(key);
msg.text = fmt::format("{} {}", icon, message);