Add base settings to the root of the config

This commit is contained in:
Maschell 2024-03-03 17:44:56 +01:00
parent fa1421f33b
commit 19fa1e0fe2

View File

@ -59,18 +59,15 @@ WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle ro
try {
WUPSConfigCategory root = WUPSConfigCategory(rootHandle);
auto settings = WUPSConfigCategory::Create("Settings");
settings.add(WUPSConfigItemBoolean::Create(ENABLED_CONFIG_STRING,
root.add(WUPSConfigItemBoolean::Create(ENABLED_CONFIG_STRING,
"Plugin enabled",
DEFAULT_ENABLED_CONFIG_VALUE, gEnabled,
&boolItemChangedConfig));
settings.add(WUPSConfigItemBoolean::Create(ENABLE_NOTIFICATIONS_CONFIG_STRING,
root.add(WUPSConfigItemBoolean::Create(ENABLE_NOTIFICATIONS_CONFIG_STRING,
"Show notifications",
DEFAULT_ENABLE_NOTIFICATIONS_CONFIG_VALUE, gShowNotifications,
&boolItemChangedConfig));
settings.add(WUPSConfigItemBoolean::Create(SWAP_SCREENS_CONFIG_STRING,
root.add(WUPSConfigItemBoolean::Create(SWAP_SCREENS_CONFIG_STRING,
"Swap screens",
DEFAULT_SWAP_SCREENS_CONFIG_VALUE, gDoScreenSwap,
&boolItemChangedConfig));
@ -82,14 +79,12 @@ WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle ro
{AUDIO_MODE_COMBINE, "Combine TV and GamePad sound"},
{AUDIO_MODE_LEFT_TV_RIGHT_DRC, "Left: TV; Right: GamePad"}};
settings.add(WUPSConfigItemMultipleValues::CreateFromValue(AUDIO_MODE_CONFIG_STRING,
root.add(WUPSConfigItemMultipleValues::CreateFromValue(AUDIO_MODE_CONFIG_STRING,
"Audio mode:",
DEFAULT_AUDIO_MODE_CONFIG_VALUE, gCurAudioMode,
audioModeMap,
&default_audio_mode_changed));
root.add(std::move(settings));
auto buttonCombos = WUPSConfigCategory::Create("Button Combos");
buttonCombos.add(WUPSConfigItemBoolean::Create(ENABLED_SWAP_SCREENS_COMBO_CONFIG_STRING,
@ -113,7 +108,7 @@ WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle ro
&buttonComboItemChanged));
root.add(std::move(buttonCombos));
} catch (std::exception &e) {
OSReport("Exception T_T : %s\n", e.what());
OSReport("Exception: %s\n", e.what());
return WUPSCONFIG_API_CALLBACK_RESULT_ERROR;
}