Rename the config item to just "Hide all homebrew" if no homebrew_launcher.wuhb exists on the sd card.

This commit is contained in:
Maschell 2023-03-21 13:14:00 +01:00
parent dc80552d5f
commit 84958ee3a3
2 changed files with 15 additions and 2 deletions

View File

@ -20,8 +20,9 @@ Place your homebrew (`.rpx` or `.wuhb`) in `sd:/wiiu/apps` or any subdirectory i
Via the plugin config menu (press L, DPAD Down and Minus on the gamepad) you can configure the plugin. The available options are the following:
- **Features**:
- Hide all homebrew except Homebrew Launcher: (Default is false)
- Hide all homebrew [except Homebrew Launcher]: (Default is false)
- Hides all homebrew from the Wii U Menu except the `sd:/wiiu/apps/homebrew_launcher.wuhb` and `sd:/wiiu/apps/homebrew_launcher/homebrew_launcher.wuhb`
- This config item is called "Hide all homebrew" when no `homebrew_launcher.wuhb` is present.
- Prefer .wuhb over .rpx (Default is true)
- Hides a `.rpx` from the Wii U Menu if a `.wuhb` with the same name exists in the same directory.
- Hide all .rpx (Default is false)

View File

@ -80,6 +80,8 @@ bool prevHideValue = false;
bool prevPreferWUHBOverRPXValue = false;
bool prevHideAllRPX = false;
bool gHomebrewLauncherExists = false;
INITIALIZE_PLUGIN() {
memset((void *) &current_launched_title_info, 0, sizeof(current_launched_title_info));
memset((void *) &gLaunchXML, 0, sizeof(gLaunchXML));
@ -205,7 +207,10 @@ WUPS_GET_CONFIG() {
WUPSConfigCategoryHandle cat;
WUPSConfig_AddCategoryByNameHandled(config, "Features", &cat);
WUPSConfigItemBoolean_AddToCategoryHandled(config, cat, HIDE_HOMEBREW_STRING, "Hide all homebrew except Homebrew Launcher", gHideHomebrew, &hideHomebrewChanged);
WUPSConfigItemBoolean_AddToCategoryHandled(config, cat, HIDE_HOMEBREW_STRING,
gHomebrewLauncherExists ? "Hide all homebrew except Homebrew Launcher" : "Hide all homebrew",
gHideHomebrew, &hideHomebrewChanged);
WUPSConfigItemBoolean_AddToCategoryHandled(config, cat, PREFER_WUHB_OVER_RPX_STRING, "Prefer .wuhb over .rpx", gPreferWUHBOverRPX, &preferWUHBOverRPXChanged);
WUPSConfigItemBoolean_AddToCategoryHandled(config, cat, HIDE_ALL_RPX_STRING, "Hide all .rpx", gHideAllRPX, &hideAllRPXChanged);
@ -266,6 +271,13 @@ ON_APPLICATION_START() {
OSGetTitleID() == 0x0005001010040200L) { // Wii U Menu EUR
gInWiiUMenu = true;
struct stat st {};
if (stat(HOMEBREW_LAUNCHER_PATH, &st) >= 0 || stat(HOMEBREW_LAUNCHER_PATH2, &st) >= 0) {
gHomebrewLauncherExists = true;
} else {
gHomebrewLauncherExists = false;
}
if (SDUtils_InitLibrary() == SDUTILS_RESULT_SUCCESS) {
sSDUtilsInitDone = true;
sTitleRebooting = false;