From e3dc4e122a6ba822c860c09290925f98cc623532 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Mon, 3 Jun 2019 17:01:53 +0200 Subject: [PATCH] use OSD for some actual purposes --- src/libui_sdl/OSD.cpp | 2 +- src/libui_sdl/main.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/libui_sdl/OSD.cpp b/src/libui_sdl/OSD.cpp index 851f9c54..c8d5f83e 100644 --- a/src/libui_sdl/OSD.cpp +++ b/src/libui_sdl/OSD.cpp @@ -205,7 +205,7 @@ void RenderText(u32 color, const char* text, Item* item) u32 rainbowinc = (text[0] * 17) % 600; color |= 0xFF000000; - const u32 shadow = 0xFE000000; + const u32 shadow = 0xE0000000; LayoutText(text, &w, &h, breaks); diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 073c8acd..cb932948 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -1591,6 +1591,11 @@ void LoadState(int slot) if (!Platform::FileExists(filename)) { + char msg[64]; + if (slot > 0) sprintf(msg, "State slot %d is empty", slot); + else sprintf(msg, "State file does not exist"); + OSD::AddMessage(0xFFA0A0, msg); + EmuRunning = prevstatus; return; } @@ -1631,6 +1636,11 @@ void LoadState(int slot) NDS::RelocateSave(SRAMPath, false); } + char msg[64]; + if (slot > 0) sprintf(msg, "State loaded from slot %d", slot); + else sprintf(msg, "State loaded from file"); + OSD::AddMessage(0, msg); + SavestateLoaded = true; uiMenuItemEnable(MenuItem_UndoStateLoad); } @@ -1690,6 +1700,11 @@ void SaveState(int slot) } } + char msg[64]; + if (slot > 0) sprintf(msg, "State saved to slot %d", slot); + else sprintf(msg, "State saved to file"); + OSD::AddMessage(0, msg); + EmuRunning = prevstatus; } @@ -1714,6 +1729,8 @@ void UndoStateLoad() NDS::RelocateSave(SRAMPath, false); } + OSD::AddMessage(0, "State load undone"); + EmuRunning = prevstatus; }