Add config items directly to root

This commit is contained in:
Maschell 2024-04-03 22:31:05 +02:00
parent 762954b043
commit ea834f3209
2 changed files with 29 additions and 33 deletions

View File

@ -1,6 +1,6 @@
FROM ghcr.io/wiiu-env/devkitppc:20231112 FROM ghcr.io/wiiu-env/devkitppc:20231112
COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:0.8.0-dev-20231221-ca17105 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:0.8.0-dev-20240329-562c749 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/librpxloader:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/librpxloader:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libsdutils:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libsdutils:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libwuhbutils:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libwuhbutils:20230621 /artifacts $DEVKITPRO

View File

@ -43,7 +43,7 @@ typedef struct ACPMetaData {
char bootlogo[28604]; char bootlogo[28604];
} ACPMetaData; } ACPMetaData;
WUPS_PLUGIN_NAME("Homebrew in Wii U menu"); WUPS_PLUGIN_NAME("Homebrew on Wii U menu");
WUPS_PLUGIN_DESCRIPTION("Allows the user to load homebrew from the Wii U menu"); WUPS_PLUGIN_DESCRIPTION("Allows the user to load homebrew from the Wii U menu");
WUPS_PLUGIN_VERSION(VERSION_FULL); WUPS_PLUGIN_VERSION(VERSION_FULL);
WUPS_PLUGIN_AUTHOR("Maschell"); WUPS_PLUGIN_AUTHOR("Maschell");
@ -52,9 +52,9 @@ WUPS_PLUGIN_LICENSE("GPL");
#define UPPER_TITLE_ID_HOMEBREW 0x0005000F #define UPPER_TITLE_ID_HOMEBREW 0x0005000F
#define TITLE_ID_HOMEBREW_MASK (((uint64_t) UPPER_TITLE_ID_HOMEBREW) << 32) #define TITLE_ID_HOMEBREW_MASK (((uint64_t) UPPER_TITLE_ID_HOMEBREW) << 32)
ACPMetaXml gLaunchXML __attribute__((section(".data"))); ACPMetaXml gLaunchXML = {};
MCPTitleListType current_launched_title_info __attribute__((section(".data"))); MCPTitleListType current_launched_title_info = {};
BOOL gHomebrewLaunched __attribute__((section(".data"))); BOOL gHomebrewLaunched = {};
std::mutex fileInfosMutex; std::mutex fileInfosMutex;
std::forward_list<std::shared_ptr<FileInfos>> fileInfos; std::forward_list<std::shared_ptr<FileInfos>> fileInfos;
@ -106,38 +106,38 @@ INITIALIZE_PLUGIN() {
gSerialId = {}; gSerialId = {};
if (!Utils::GetSerialId(gSerialId) || gSerialId.empty()) { if (!Utils::GetSerialId(gSerialId) || gSerialId.empty()) {
DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to get the serial id"); DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to get the serial id");
OSFatal("Homebrew on Menu Plugin: Failed to get the serial id"); OSFatal("Homebrew on menu plugin: Failed to get the serial id");
} }
// Use libwuhbutils. // Use libwuhbutils.
WUHBUtilsStatus error; WUHBUtilsStatus error;
if ((error = WUHBUtils_InitLibrary()) != WUHB_UTILS_RESULT_SUCCESS) { if ((error = WUHBUtils_InitLibrary()) != WUHB_UTILS_RESULT_SUCCESS) {
DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init WUHBUtils. Error %s [%d]", WUHBUtils_GetStatusStr(error), error); DEBUG_FUNCTION_LINE_ERR("Homebrew on menu plugin: Failed to init WUHBUtils. Error %s [%d]", WUHBUtils_GetStatusStr(error), error);
OSFatal("Homebrew on Menu Plugin: Failed to init WUHBUtils."); OSFatal("Homebrew on menu plugin: Failed to init WUHBUtils.");
} }
// Use libcontentredirection. // Use libcontentredirection.
ContentRedirectionStatus error2; ContentRedirectionStatus error2;
if ((error2 = ContentRedirection_InitLibrary()) != CONTENT_REDIRECTION_RESULT_SUCCESS) { if ((error2 = ContentRedirection_InitLibrary()) != CONTENT_REDIRECTION_RESULT_SUCCESS) {
DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init ContentRedirection. Error %s [%d]", ContentRedirection_GetStatusStr(error2), error2); DEBUG_FUNCTION_LINE_ERR("Homebrew on menu plugin: Failed to init ContentRedirection. Error %s [%d]", ContentRedirection_GetStatusStr(error2), error2);
OSFatal("Homebrew on Menu Plugin: Failed to init ContentRedirection."); OSFatal("Homebrew on menu plugin: Failed to init ContentRedirection.");
} }
// Use librpxloader. // Use librpxloader.
RPXLoaderStatus error3; RPXLoaderStatus error3;
if ((error3 = RPXLoader_InitLibrary()) != RPX_LOADER_RESULT_SUCCESS) { if ((error3 = RPXLoader_InitLibrary()) != RPX_LOADER_RESULT_SUCCESS) {
DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init RPXLoader. Error %s [%d]", RPXLoader_GetStatusStr(error3), error3); DEBUG_FUNCTION_LINE_ERR("Homebrew on menu plugin: Failed to init RPXLoader. Error %s [%d]", RPXLoader_GetStatusStr(error3), error3);
OSFatal("Homebrew on Menu Plugin: Failed to init RPXLoader."); OSFatal("Homebrew on menu plugin: Failed to init RPXLoader.");
} }
// Use libnotifications. // Use libnotifications.
NotificationModuleStatus error4; NotificationModuleStatus error4;
if ((error4 = NotificationModule_InitLibrary()) != NOTIFICATION_MODULE_RESULT_SUCCESS) { if ((error4 = NotificationModule_InitLibrary()) != NOTIFICATION_MODULE_RESULT_SUCCESS) {
DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init NotificationModule. Error %s [%d]", NotificationModule_GetStatusStr(error4), error4); DEBUG_FUNCTION_LINE_ERR("Homebrew on menu plugin: Failed to init NotificationModule. Error %s [%d]", NotificationModule_GetStatusStr(error4), error4);
OSFatal("Homebrew on Menu Plugin: Failed to init NotificationModule."); OSFatal("Homebrew on menu plugin: Failed to init NotificationModule.");
} }
WUPSConfigAPIOptionsV1 configOptions = {.name = "Homebrew On Menu Plugin"}; WUPSConfigAPIOptionsV1 configOptions = {.name = "Homebrew On Wii U Menu Plugin"};
if (WUPSConfigAPI_Init(configOptions, ConfigMenuOpenedCallback, ConfigMenuClosedCallback) != WUPSCONFIG_API_RESULT_SUCCESS) { if (WUPSConfigAPI_Init(configOptions, ConfigMenuOpenedCallback, ConfigMenuClosedCallback) != WUPSCONFIG_API_RESULT_SUCCESS) {
DEBUG_FUNCTION_LINE_ERR("Failed to init config api"); DEBUG_FUNCTION_LINE_ERR("Failed to init config api");
} }
@ -205,27 +205,23 @@ void hideAllRPXChanged(ConfigItemBoolean *item, bool newValue) {
WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle rootHandle) { WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle rootHandle) {
try { try {
WUPSConfigCategory root = WUPSConfigCategory(rootHandle); WUPSConfigCategory root = WUPSConfigCategory(rootHandle);
auto features = WUPSConfigCategory::Create("Features");
root.add(WUPSConfigItemBoolean::Create(HIDE_HOMEBREW_STRING,
gHomebrewLauncherExists ? "Hide all homebrew except Homebrew Launcher" : "Hide all homebrew",
DEFAULT_HIDE_HOMEBREW_VALUE, gHideHomebrew,
&hideHomebrewChanged));
features.add(WUPSConfigItemBoolean::Create(HIDE_HOMEBREW_STRING, root.add(WUPSConfigItemBoolean::Create(PREFER_WUHB_OVER_RPX_STRING,
gHomebrewLauncherExists ? "Hide all homebrew except Homebrew Launcher" : "Hide all homebrew", "Prefer .wuhb over .rpx",
DEFAULT_HIDE_HOMEBREW_VALUE, gHideHomebrew, DEFAULT_PREFER_WUHB_OVER_RPX_VALUE, gPreferWUHBOverRPX,
&hideHomebrewChanged)); &preferWUHBOverRPXChanged));
features.add(WUPSConfigItemBoolean::Create(PREFER_WUHB_OVER_RPX_STRING, root.add(WUPSConfigItemBoolean::Create(HIDE_ALL_RPX_STRING,
"Prefer .wuhb over .rpx", "Hide all .rpx",
DEFAULT_PREFER_WUHB_OVER_RPX_VALUE, gPreferWUHBOverRPX, DEFAULT_HIDE_ALL_RPX_VALUE, gHideAllRPX,
&preferWUHBOverRPXChanged)); &hideAllRPXChanged));
features.add(WUPSConfigItemBoolean::Create(HIDE_ALL_RPX_STRING,
"Hide all .rpx",
DEFAULT_HIDE_ALL_RPX_VALUE, gHideAllRPX,
&hideAllRPXChanged));
root.add(std::move(features));
} catch (std::exception &e) { } catch (std::exception &e) {
OSReport("Exception T_T : %s\n", e.what()); OSReport("Exception: %s\n", e.what());
return WUPSCONFIG_API_CALLBACK_RESULT_ERROR; return WUPSCONFIG_API_CALLBACK_RESULT_ERROR;
} }
return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS; return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS;
@ -307,7 +303,7 @@ ON_APPLICATION_START() {
// Ignore all lines that start with '#' // Ignore all lines that start with '#'
gIgnorePatterns.erase(std::remove_if(gIgnorePatterns.begin(), gIgnorePatterns.end(), [](auto &line) { return line.starts_with('#'); }), gIgnorePatterns.end()); gIgnorePatterns.erase(std::remove_if(gIgnorePatterns.begin(), gIgnorePatterns.end(), [](auto &line) { return line.starts_with('#'); }), gIgnorePatterns.end());
} else { } else {
DEBUG_FUNCTION_LINE_ERR("No ignore found"); DEBUG_FUNCTION_LINE_INFO("No ignore found");
} }
gInWiiUMenu = true; gInWiiUMenu = true;