Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore button combo if plugin is disabled #47

Merged
merged 2 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/wiiu-env/devkitppc:20241128

COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:0.8.2-dev-20250105-d195b0b /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:0.8.2-dev-20250125-f8faa9f /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libmappedmemory:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libnotifications:20240426 /artifacts $DEVKITPRO

Expand Down
8 changes: 6 additions & 2 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,13 @@ void InitConfig() {
WUPSButtonCombo_ComboStatus comboStatus;
WUPSButtonCombo_Error comboError = WUPS_BUTTON_COMBO_ERROR_UNKNOWN_ERROR;
auto buttonComboOpt = WUPSButtonComboAPI::CreateComboPressDown(
"Screenshot button combo", static_cast<WUPSButtonCombo_Buttons>(gButtonCombo), [](WUPSButtonCombo_ControllerTypes, WUPSButtonCombo_ComboHandle, void *) { RequestScreenshot(); }, nullptr, comboStatus, comboError);
"Screenshot button combo", static_cast<WUPSButtonCombo_Buttons>(gButtonCombo),
[](WUPSButtonCombo_ControllerTypes, WUPSButtonCombo_ComboHandle, void *) { RequestScreenshot(); },
nullptr,
comboStatus,
comboError);
if (!buttonComboOpt || comboError != WUPS_BUTTON_COMBO_ERROR_SUCCESS) {
const auto errorMsg = string_format("Failed to register button combo for screenshots. %s", WUPSButtonComboAPI::GetStatusStr(comboError).data());
const auto errorMsg = string_format("Failed to register button combo for screenshots. %s", WUPSButtonComboAPI::GetStatusStr(comboError));
DEBUG_FUNCTION_LINE_ERR("%s", errorMsg.c_str());
NotificationModule_AddErrorNotification(errorMsg.c_str());
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/screenshot_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ namespace {
} // namespace

void RequestScreenshot() {
if (!gEnabled) {
return;
}
NotificationModuleStatus err;
if (gBlockScreenshots) {
if (!gNotAvailableNotificationDisplayed) {
Expand Down