Add option to disable plugins completely

This commit is contained in:
Henrik Rydgård 2024-04-09 13:13:02 +02:00
parent e903287f4c
commit 4b34e4cfb4
4 changed files with 8 additions and 0 deletions

View file

@ -213,6 +213,7 @@ static const ConfigSetting generalSettings[] = {
ConfigSetting("DisableHTTPS", &g_Config.bDisableHTTPS, false, CfgFlag::DONT_SAVE),
ConfigSetting("AutoLoadSaveState", &g_Config.iAutoLoadSaveState, 0, CfgFlag::PER_GAME),
ConfigSetting("EnableCheats", &g_Config.bEnableCheats, false, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("EnablePlugins", &g_Config.bEnablePlugins, true, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("CwCheatRefreshRate", &g_Config.iCwCheatRefreshIntervalMs, 77, CfgFlag::PER_GAME),
ConfigSetting("CwCheatScrollPosition", &g_Config.fCwCheatScrollPosition, 0.0f, CfgFlag::PER_GAME),
ConfigSetting("GameListScrollPosition", &g_Config.fGameListScrollPosition, 0.0f, CfgFlag::DEFAULT),

View file

@ -237,6 +237,7 @@ public:
int iAutoLoadSaveState; // 0 = off, 1 = oldest, 2 = newest, >2 = slot number + 3
bool bEnableCheats;
bool bReloadCheats;
bool bEnablePlugins;
int iCwCheatRefreshIntervalMs;
float fCwCheatScrollPosition;
float fGameListScrollPosition;

View file

@ -178,6 +178,11 @@ bool Load() {
auto sy = GetI18NCategory(I18NCat::SYSTEM);
for (const std::string &filename : prxPlugins) {
if (!g_Config.bEnablePlugins) {
WARN_LOG(SYSTEM, "Plugins are disabled, ignoring enabled plugin %s", filename.c_str());
continue;
}
std::string error_string = "";
SceUID module = KernelLoadModule(filename, &error_string);
if (!error_string.empty() || module < 0) {

View file

@ -1208,6 +1208,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
enableReportsCheckbox_->SetEnabled(Reporting::IsSupported());
return UI::EVENT_CONTINUE;
});
systemSettings->Add(new CheckBox(&g_Config.bEnablePlugins, sy->T("Enable plugins")));
systemSettings->Add(new ItemHeader(sy->T("PSP Settings")));