From 91386440ef6c3f7768ad5f762e68e0e53fa7979f Mon Sep 17 00:00:00 2001 From: jbohack Date: Tue, 10 Jan 2023 14:25:44 -0500 Subject: [PATCH 1/2] remove pong notifications notifications don't clear upon app close --- applications/plugins/pong/flipper_pong.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/applications/plugins/pong/flipper_pong.c b/applications/plugins/pong/flipper_pong.c index c25e46b7b..2af3e6df4 100644 --- a/applications/plugins/pong/flipper_pong.c +++ b/applications/plugins/pong/flipper_pong.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #define SCREEN_SIZE_X 128 @@ -127,10 +126,6 @@ int32_t flipper_pong_app() Gui* gui = furi_record_open(RECORD_GUI); gui_add_view_port(gui, view_port, GuiLayerFullscreen); - NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION); - if (players.ball_X_direction == 0) notification_message(notification, &sequence_set_only_red_255); - else notification_message(notification, &sequence_set_only_blue_255); - FuriTimer* timer = furi_timer_alloc(clock_tick, FuriTimerTypePeriodic, event_queue); furi_timer_start(timer, 1000/FPS); @@ -146,7 +141,6 @@ int32_t flipper_pong_app() if(event.input.key == InputKeyBack) { release_mutex(&state_mutex, playersMutex); - notification_message(notification, &sequence_set_only_green_255); break; } else if(event.input.key == InputKeyUp) @@ -202,7 +196,6 @@ int32_t flipper_pong_app() playersMutex->ball_X -= playersMutex->ball_X_speed; playersMutex->ball_X_speed = changeSpeed(); playersMutex->ball_Y_speed = changeSpeed(); - notification_message(notification, &sequence_set_only_red_255); } else if (insidePlayer2 == true) { @@ -210,7 +203,6 @@ int32_t flipper_pong_app() playersMutex->ball_X += playersMutex->ball_X_speed; playersMutex->ball_X_speed = changeSpeed(); playersMutex->ball_Y_speed = changeSpeed(); - notification_message(notification, &sequence_set_only_blue_255); } else { @@ -229,7 +221,6 @@ int32_t flipper_pong_app() playersMutex->ball_Y_speed = 1; playersMutex->ball_X_direction = 0; playersMutex->player2_score++; - notification_message(notification, &sequence_set_only_red_255); } } else @@ -246,7 +237,6 @@ int32_t flipper_pong_app() playersMutex->ball_Y_speed = 1; playersMutex->ball_X_direction = 1; playersMutex->player1_score++; - notification_message(notification, &sequence_set_only_blue_255); } } } @@ -292,7 +282,6 @@ int32_t flipper_pong_app() view_port_free(view_port); furi_timer_free(timer); furi_record_close(RECORD_GUI); - furi_record_close(RECORD_NOTIFICATION); return 0; -} \ No newline at end of file +} From 2ea789b24bed5ad78a7df195f4e61eefabfe91b9 Mon Sep 17 00:00:00 2001 From: jbohack Date: Tue, 10 Jan 2023 16:00:58 -0500 Subject: [PATCH 2/2] added nsfw to dap link --- applications/plugins/dap_link/dap_link.c | 35 ++++++++++++++++++------ 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/applications/plugins/dap_link/dap_link.c b/applications/plugins/dap_link/dap_link.c index 156e16d05..510540588 100644 --- a/applications/plugins/dap_link/dap_link.c +++ b/applications/plugins/dap_link/dap_link.c @@ -16,6 +16,8 @@ #include #include "DAP_Link_icons.h" +#include "../../settings/desktop_settings/desktop_settings_app.h" + /***************************************************************************/ /****************************** DAP COMMON *********************************/ /***************************************************************************/ @@ -482,22 +484,37 @@ DapConfig* dap_app_get_config(DapApp* app) { int32_t dap_link_app(void* p) { UNUSED(p); + DesktopSettings* settings = malloc(sizeof(DesktopSettings)); + DESKTOP_SETTINGS_LOAD(settings); if(furi_hal_usb_is_locked()) { DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS); DialogMessage* message = dialog_message_alloc(); - dialog_message_set_header(message, "Connection\nis active!", 3, 2, AlignLeft, AlignTop); - dialog_message_set_text( - message, - "Disconnect from\nPC or phone to\nuse this function.", - 3, - 30, - AlignLeft, - AlignTop); + if (settings->sfw_mode) { + dialog_message_set_header(message, "Connection\nis active!", 3, 2, AlignLeft, AlignTop); + dialog_message_set_text( + message, + "Disconnect from\nPC or phone to\nuse this function.", + 3, + 30, + AlignLeft, + AlignTop); + } + else { + dialog_message_set_header(message, "I am not\na whore!", 3, 2, AlignLeft, AlignTop); + dialog_message_set_text( + message, + "Pull out from\nPC or phone to\nuse me like this.", + 3, + 30, + AlignLeft, + AlignTop); + } dialog_message_set_icon(message, &I_ActiveConnection_50x64, 78, 0); dialog_message_show(dialogs, message); dialog_message_free(message); furi_record_close(RECORD_DIALOGS); + free(settings); return -1; } @@ -524,4 +541,4 @@ int32_t dap_link_app(void* p) { dap_app_free(app); return 0; -} \ No newline at end of file +}