System: Don't print whole path in save OSD messages

This commit is contained in:
Connor McLaughlin
2022-08-05 17:07:40 +10:00
parent 6bf0ad789e
commit 589785f8a0
2 changed files with 30 additions and 6 deletions

View File

@ -1,4 +1,5 @@
#include "system.h"
#include "IconsFontAwesome5.h"
#include "achievements.h"
#include "bios.h"
#include "bus.h"
@ -953,7 +954,15 @@ bool System::LoadState(const char* filename)
return false;
Log_InfoPrintf("Loading state from '%s'...", filename);
Host::AddFormattedOSDMessage(5.0f, Host::TranslateString("OSDMessage", "Loading state from '%s'..."), filename);
{
const std::string display_name(FileSystem::GetDisplayNameFromPath(filename));
Host::AddIconOSDMessage(
"load_state", ICON_FA_FOLDER_OPEN,
fmt::format(Host::TranslateString("OSDMessage", "Loading state from '{}'...").GetCharArray(),
Path::GetFileName(display_name)),
5.0f);
}
SaveUndoLoadState();