mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-10-26 18:09:20 +00:00
PatchEngine: OSD message showing number of enabled patches and cheats
This commit is contained in:
parent
ab8a02566d
commit
64a20c74fc
5 changed files with 33 additions and 0 deletions
|
|
@ -35,6 +35,7 @@
|
|||
#include "Core/PowerPC/MMU.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/System.h"
|
||||
#include "VideoCommon/OnScreenDisplay.h"
|
||||
|
||||
namespace PatchEngine
|
||||
{
|
||||
|
|
@ -200,6 +201,18 @@ void LoadPatches()
|
|||
ActionReplay::LoadAndApplyCodes(globalIni, localIni, sconfig.GetGameID(),
|
||||
sconfig.GetRevision());
|
||||
}
|
||||
|
||||
const size_t enabled_patch_count =
|
||||
std::ranges::count_if(s_on_frame, [](Patch patch) { return patch.enabled; });
|
||||
if (enabled_patch_count > 0)
|
||||
{
|
||||
OSD::AddMessage(fmt::format("{} game patch(es) enabled", enabled_patch_count),
|
||||
OSD::Duration::NORMAL);
|
||||
}
|
||||
|
||||
const size_t enabled_cheat_count = ActionReplay::CountEnabledCodes() + Gecko::CountEnabledCodes();
|
||||
if (enabled_cheat_count > 0)
|
||||
OSD::AddMessage(fmt::format("{} cheat(s) enabled", enabled_cheat_count), OSD::Duration::NORMAL);
|
||||
}
|
||||
|
||||
static void ApplyPatches(const Core::CPUThreadGuard& guard, const std::vector<Patch>& patches)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue