From a846f53da6f25362fb4ac1fb5c2c5ca6dff4eefc Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 23 Sep 2022 17:00:53 +0200 Subject: [PATCH] Change order of config items --- README.md | 4 ++-- src/main.cpp | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 6e82e53..80f2456 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ Via the plugin config menu (press L, DPAD Down and Minus on the GamePad, Pro Con - **Settings**: - Enabled: (Default is true) - Enables or disables the screenshot plugin. - - Output format: (Default is JPEG) - - Determines which file is used. Currently saving screens as .jpg, .png and .bmp is supported. - Screen: (Default is TV and GamePad) - Determines from which screen a screenshot should be taken. Possible options: TV & GamePad, TV only, GamePad only. + - Output format: (Default is JPEG) + - Determines which file is used. Currently saving screens as .jpg, .png and .bmp is supported. - JPEG quality: (Default is 90) - Determines the quality when saving as JPEG. Lowest possible quality is 10, highest 100. diff --git a/src/main.cpp b/src/main.cpp index 00bff02..3ae0fc9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -152,29 +152,6 @@ WUPS_GET_CONFIG() { WUPSConfigItemBoolean_AddToCategoryHandled(config, setting, ENABLED_CONFIG_STRING, "Enabled", gEnabled, &enabledChanged); - ConfigItemMultipleValuesPair fileFormat[3]; - fileFormat[0].value = IMAGE_OUTPUT_FORMAT_JPEG; - fileFormat[0].valueName = (char *) "JPEG"; - - fileFormat[1].value = IMAGE_OUTPUT_FORMAT_PNG; - fileFormat[1].valueName = (char *) "PNG"; - - fileFormat[2].value = IMAGE_OUTPUT_FORMAT_BMP; - fileFormat[2].valueName = (char *) "BMP"; - - uint32_t defaultIndex = 0; - uint32_t curIndex = 0; - for (auto &cur : fileFormat) { - if (cur.value == gOutputFormat) { - defaultIndex = curIndex; - break; - } - curIndex++; - } - - WUPSConfigItemMultipleValues_AddToCategoryHandled(config, setting, FORMAT_CONFIG_STRING, "Output format", defaultIndex, fileFormat, - sizeof(fileFormat) / sizeof(fileFormat[0]), &formatChanged); - ConfigItemMultipleValuesPair source[3]; source[0].value = IMAGE_SOURCE_TV_AND_DRC; @@ -186,8 +163,8 @@ WUPS_GET_CONFIG() { source[2].value = IMAGE_SOURCE_DRC; source[2].valueName = (char *) "GamePad only"; - defaultIndex = 0; - curIndex = 0; + uint32_t defaultIndex = 0; + uint32_t curIndex = 0; for (auto &cur : source) { if (cur.value == gImageSource) { defaultIndex = curIndex; @@ -199,6 +176,29 @@ WUPS_GET_CONFIG() { WUPSConfigItemMultipleValues_AddToCategoryHandled(config, setting, SCREEN_CONFIG_STRING, "Screen", defaultIndex, source, sizeof(source) / sizeof(source[0]), &imageSourceChanged); + ConfigItemMultipleValuesPair fileFormat[3]; + fileFormat[0].value = IMAGE_OUTPUT_FORMAT_JPEG; + fileFormat[0].valueName = (char *) "JPEG"; + + fileFormat[1].value = IMAGE_OUTPUT_FORMAT_PNG; + fileFormat[1].valueName = (char *) "PNG"; + + fileFormat[2].value = IMAGE_OUTPUT_FORMAT_BMP; + fileFormat[2].valueName = (char *) "BMP"; + + defaultIndex = 0; + curIndex = 0; + for (auto &cur : fileFormat) { + if (cur.value == gOutputFormat) { + defaultIndex = curIndex; + break; + } + curIndex++; + } + + WUPSConfigItemMultipleValues_AddToCategoryHandled(config, setting, FORMAT_CONFIG_STRING, "Output format", defaultIndex, fileFormat, + sizeof(fileFormat) / sizeof(fileFormat[0]), &formatChanged); + WUPSConfigItemIntegerRange_AddToCategoryHandled(config, setting, QUALITY_CONFIG_STRING, "JPEG quality", gQuality, 10, 100, &qualityChanged);