mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 14:38:35 -07:00
Merge branch 'dev' of https://github.com/ClaraCrazy/Flipper-Xtreme into dev
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include <furi_hal.h>
|
#include <furi_hal.h>
|
||||||
|
|
||||||
#include "../desktop_i.h"
|
#include "../desktop_i.h"
|
||||||
|
#include "../../../settings/desktop_settings/desktop_settings_app.h"
|
||||||
|
|
||||||
#define DesktopFaultEventExit 0x00FF00FF
|
#define DesktopFaultEventExit 0x00FF00FF
|
||||||
|
|
||||||
@@ -12,20 +13,36 @@ void desktop_scene_fault_callback(void* context) {
|
|||||||
void desktop_scene_fault_on_enter(void* context) {
|
void desktop_scene_fault_on_enter(void* context) {
|
||||||
Desktop* desktop = (Desktop*)context;
|
Desktop* desktop = (Desktop*)context;
|
||||||
|
|
||||||
|
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
|
||||||
|
DESKTOP_SETTINGS_LOAD(settings);
|
||||||
|
|
||||||
Popup* popup = desktop->hw_mismatch_popup;
|
Popup* popup = desktop->hw_mismatch_popup;
|
||||||
popup_set_context(popup, desktop);
|
popup_set_context(popup, desktop);
|
||||||
popup_set_header(
|
if (settings->sfw_mode) {
|
||||||
popup,
|
popup_set_header(
|
||||||
"Slut passed out\n but is now back",
|
popup,
|
||||||
60,
|
"Flipper crashed\n but has been rebooted",
|
||||||
14 + STATUS_BAR_Y_SHIFT,
|
60,
|
||||||
AlignCenter,
|
14 + STATUS_BAR_Y_SHIFT,
|
||||||
AlignCenter);
|
AlignCenter,
|
||||||
|
AlignCenter);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
popup_set_header(
|
||||||
|
popup,
|
||||||
|
"Slut passed out\n but is now back",
|
||||||
|
60,
|
||||||
|
14 + STATUS_BAR_Y_SHIFT,
|
||||||
|
AlignCenter,
|
||||||
|
AlignCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
char* message = (char*)furi_hal_rtc_get_fault_data();
|
char* message = (char*)furi_hal_rtc_get_fault_data();
|
||||||
popup_set_text(popup, message, 60, 37 + STATUS_BAR_Y_SHIFT, AlignCenter, AlignCenter);
|
popup_set_text(popup, message, 60, 37 + STATUS_BAR_Y_SHIFT, AlignCenter, AlignCenter);
|
||||||
popup_set_callback(popup, desktop_scene_fault_callback);
|
popup_set_callback(popup, desktop_scene_fault_callback);
|
||||||
view_dispatcher_switch_to_view(desktop->view_dispatcher, DesktopViewIdHwMismatch);
|
view_dispatcher_switch_to_view(desktop->view_dispatcher, DesktopViewIdHwMismatch);
|
||||||
|
free(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool desktop_scene_fault_on_event(void* context, SceneManagerEvent event) {
|
bool desktop_scene_fault_on_event(void* context, SceneManagerEvent event) {
|
||||||
|
|||||||
@@ -47,32 +47,30 @@ static void render_callback(Canvas* canvas, void* ctx) {
|
|||||||
char mood_str[32];
|
char mood_str[32];
|
||||||
uint8_t mood = 0;
|
uint8_t mood = 0;
|
||||||
|
|
||||||
if(settings->sfw_mode)
|
if(settings->sfw_mode) {
|
||||||
{
|
if(stats->butthurt <= 4) {
|
||||||
if(stats->butthurt <= 4) {
|
mood = 0;
|
||||||
mood = 0;
|
snprintf(mood_str, 20, "Mood: Happy");
|
||||||
snprintf(mood_str, 20, "Mood: Happy");
|
} else if(stats->butthurt <= 9) {
|
||||||
} else if(stats->butthurt <= 9) {
|
mood = 1;
|
||||||
mood = 1;
|
snprintf(mood_str, 20, "Mood: Okay");
|
||||||
snprintf(mood_str, 20, "Mood: Okay");
|
} else {
|
||||||
} else {
|
mood = 2;
|
||||||
mood = 2;
|
snprintf(mood_str, 20, "Mood: Angry");
|
||||||
snprintf(mood_str, 20, "Mood: Angry");
|
}
|
||||||
}}
|
} else {
|
||||||
else
|
if(stats->butthurt <= 4) {
|
||||||
{
|
mood = 0;
|
||||||
if(stats->butthurt <= 4) {
|
snprintf(mood_str, 20, "Status: Wet");
|
||||||
mood = 0;
|
} else if(stats->butthurt <= 9) {
|
||||||
snprintf(mood_str, 20, "Status: Wet");
|
mood = 1;
|
||||||
} else if(stats->butthurt <= 9) {
|
snprintf(mood_str, 20, "Status: Horny");
|
||||||
mood = 1;
|
} else {
|
||||||
snprintf(mood_str, 20, "Status: Horny");
|
mood = 2;
|
||||||
} else {
|
snprintf(mood_str, 20, "Status: Desperate");
|
||||||
mood = 2;
|
}
|
||||||
snprintf(mood_str, 20, "Status: Desperate");
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
}
|
||||||
uint32_t xp_progress = 0;
|
uint32_t xp_progress = 0;
|
||||||
uint32_t xp_to_levelup = dolphin_state_xp_to_levelup(stats->icounter);
|
uint32_t xp_to_levelup = dolphin_state_xp_to_levelup(stats->icounter);
|
||||||
uint32_t xp_above_last_levelup = dolphin_state_xp_above_last_levelup(stats->icounter);
|
uint32_t xp_above_last_levelup = dolphin_state_xp_above_last_levelup(stats->icounter);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "../power_settings_app.h"
|
#include "../power_settings_app.h"
|
||||||
|
#include "../../desktop_settings/desktop_settings_app.h"
|
||||||
|
|
||||||
void power_settings_scene_power_off_dialog_callback(DialogExResult result, void* context) {
|
void power_settings_scene_power_off_dialog_callback(DialogExResult result, void* context) {
|
||||||
furi_assert(context);
|
furi_assert(context);
|
||||||
@@ -10,9 +11,16 @@ void power_settings_scene_power_off_on_enter(void* context) {
|
|||||||
PowerSettingsApp* app = context;
|
PowerSettingsApp* app = context;
|
||||||
DialogEx* dialog = app->dialog;
|
DialogEx* dialog = app->dialog;
|
||||||
|
|
||||||
|
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
|
||||||
|
DESKTOP_SETTINGS_LOAD(settings);
|
||||||
|
|
||||||
dialog_ex_set_header(dialog, "Turn Off Device?", 64, 2, AlignCenter, AlignTop);
|
dialog_ex_set_header(dialog, "Turn Off Device?", 64, 2, AlignCenter, AlignTop);
|
||||||
dialog_ex_set_text(
|
if (settings->sfw_mode) {
|
||||||
dialog, " I will be\nwaiting for\n you master", 78, 16, AlignLeft, AlignTop);
|
dialog_ex_set_text(dialog, " I will be\nwaiting for\n you here", 78, 16, AlignLeft, AlignTop);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dialog_ex_set_text(dialog, " I will be\nwaiting for\n you master", 78, 16, AlignLeft, AlignTop);
|
||||||
|
}
|
||||||
dialog_ex_set_icon(dialog, 21, 13, &I_Cry_dolph_55x52);
|
dialog_ex_set_icon(dialog, 21, 13, &I_Cry_dolph_55x52);
|
||||||
dialog_ex_set_left_button_text(dialog, "Back");
|
dialog_ex_set_left_button_text(dialog, "Back");
|
||||||
dialog_ex_set_right_button_text(dialog, "OFF");
|
dialog_ex_set_right_button_text(dialog, "OFF");
|
||||||
@@ -20,6 +28,7 @@ void power_settings_scene_power_off_on_enter(void* context) {
|
|||||||
dialog_ex_set_context(dialog, app);
|
dialog_ex_set_context(dialog, app);
|
||||||
|
|
||||||
view_dispatcher_switch_to_view(app->view_dispatcher, PowerSettingsAppViewDialog);
|
view_dispatcher_switch_to_view(app->view_dispatcher, PowerSettingsAppViewDialog);
|
||||||
|
free(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool power_settings_scene_power_off_on_event(void* context, SceneManagerEvent event) {
|
bool power_settings_scene_power_off_on_event(void* context, SceneManagerEvent event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user