mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 03:58:36 -07:00
Small bump in the road
- Update assets and references for new project - Revert DFU image and CLI motd - Remove NSFW text and flag - Remove credits animation (will be replaced with a setting menu soon) - New EvilPortal example HTML and better error message - Initial standalone naming for asset packs and mainmenu apps - File migration fixes/improvements - Remove hotfix workflow
This commit is contained in:
@@ -13,14 +13,13 @@
|
||||
#include "animation_storage.h"
|
||||
#include "animation_manager.h"
|
||||
|
||||
#include <xtreme/xtreme.h>
|
||||
#include <momentum/momentum.h>
|
||||
|
||||
#define TAG "AnimationManager"
|
||||
|
||||
#define HARDCODED_ANIMATION_NAME "L1_AnimationError_128x64"
|
||||
#define NO_SD_ANIMATION_NAME "L1_NoSd_128x49"
|
||||
#define BAD_BATTERY_ANIMATION_NAME "L1_BadBattery_128x47"
|
||||
#define CREDITS_ANIMATION_NAME "Credits_128x64"
|
||||
|
||||
#define NO_DB_ANIMATION_NAME "L0_NoDb_128x51"
|
||||
#define BAD_SD_ANIMATION_NAME "L0_SdBad_128x51"
|
||||
@@ -148,7 +147,7 @@ void animation_manager_check_blocking_process(AnimationManager* animation_manage
|
||||
const StorageAnimationManifestInfo* manifest_info =
|
||||
animation_storage_get_meta(animation_manager->current_animation);
|
||||
bool valid = animation_manager_is_valid_idle_animation(
|
||||
manifest_info, &stats, xtreme_settings.unlock_anims);
|
||||
manifest_info, &stats, momentum_settings.unlock_anims);
|
||||
|
||||
if(!valid) {
|
||||
animation_manager_start_new_idle(animation_manager);
|
||||
@@ -203,8 +202,8 @@ static void animation_manager_start_new_idle(AnimationManager* animation_manager
|
||||
const BubbleAnimation* bubble_animation =
|
||||
animation_storage_get_bubble_animation(animation_manager->current_animation);
|
||||
animation_manager->state = AnimationManagerStateIdle;
|
||||
int32_t duration = (xtreme_settings.cycle_anims == 0) ? (bubble_animation->duration) :
|
||||
(xtreme_settings.cycle_anims);
|
||||
int32_t duration = (momentum_settings.cycle_anims == 0) ? (bubble_animation->duration) :
|
||||
(momentum_settings.cycle_anims);
|
||||
furi_timer_start(
|
||||
animation_manager->idle_animation_timer, (duration > 0) ? (duration * 1000) : 0);
|
||||
}
|
||||
@@ -389,8 +388,7 @@ static StorageAnimation*
|
||||
uint32_t whole_weight = 0;
|
||||
|
||||
// Filter valid animations
|
||||
bool skip_credits = !xtreme_settings.credits_anim && xtreme_settings.asset_pack[0] == '\0';
|
||||
bool unlock = xtreme_settings.unlock_anims;
|
||||
bool unlock = momentum_settings.unlock_anims;
|
||||
StorageAnimationList_it_t it;
|
||||
for(StorageAnimationList_it(it, animation_list); !StorageAnimationList_end_p(it);) {
|
||||
StorageAnimation* storage_animation = *StorageAnimationList_ref(it);
|
||||
@@ -401,9 +399,6 @@ static StorageAnimation*
|
||||
if(strcmp(manifest_info->name, HARDCODED_ANIMATION_NAME) == 0) {
|
||||
// Dont pick error anim randomly
|
||||
valid = false;
|
||||
} else if(skip_credits && strcmp(manifest_info->name, CREDITS_ANIMATION_NAME) == 0) {
|
||||
// Dont pick credits anim if disabled
|
||||
valid = false;
|
||||
}
|
||||
|
||||
if(valid) {
|
||||
@@ -546,7 +541,7 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
|
||||
const StorageAnimationManifestInfo* manifest_info =
|
||||
animation_storage_get_meta(restore_animation);
|
||||
bool valid = animation_manager_is_valid_idle_animation(
|
||||
manifest_info, &stats, xtreme_settings.unlock_anims);
|
||||
manifest_info, &stats, momentum_settings.unlock_anims);
|
||||
// Restore only if anim is valid and not the error anim
|
||||
if(valid && strcmp(manifest_info->name, HARDCODED_ANIMATION_NAME) != 0) {
|
||||
animation_manager_replace_current_animation(
|
||||
@@ -561,9 +556,9 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
|
||||
const BubbleAnimation* bubble_animation =
|
||||
animation_storage_get_bubble_animation(
|
||||
animation_manager->current_animation);
|
||||
int32_t duration = (xtreme_settings.cycle_anims == 0) ?
|
||||
int32_t duration = (momentum_settings.cycle_anims == 0) ?
|
||||
(bubble_animation->duration) :
|
||||
(xtreme_settings.cycle_anims);
|
||||
(momentum_settings.cycle_anims);
|
||||
furi_timer_start(
|
||||
animation_manager->idle_animation_timer,
|
||||
(duration > 0) ? (duration * 1000) : 0);
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
#include "animation_storage_i.h"
|
||||
#include <assets_dolphin_internal.h>
|
||||
#include <assets_dolphin_blocking.h>
|
||||
#include <xtreme/xtreme.h>
|
||||
#include <momentum/momentum.h>
|
||||
#define ANIMATION_META_FILE "meta.txt"
|
||||
#define TAG "AnimationStorage"
|
||||
char ANIMATION_DIR[23 /*"/ext/asset_packs//Anims"*/ + XTREME_ASSETS_PACK_NAME_LEN + 1];
|
||||
char ANIMATION_DIR[23 /* /ext/asset_packs//Anims */ + ASSET_PACKS_NAME_LEN + 1];
|
||||
char ANIMATION_MANIFEST_FILE[sizeof(ANIMATION_DIR) + 13 /*"/manifest.txt"*/];
|
||||
|
||||
static void animation_storage_free_bubbles(BubbleAnimation* animation);
|
||||
@@ -25,10 +25,10 @@ static BubbleAnimation* animation_storage_load_animation(const char* name);
|
||||
void animation_handler_select_manifest() {
|
||||
FuriString* anim_dir = furi_string_alloc();
|
||||
FuriString* manifest = furi_string_alloc();
|
||||
bool use_asset_pack = xtreme_settings.asset_pack[0] != '\0';
|
||||
bool use_asset_pack = momentum_settings.asset_pack[0] != '\0';
|
||||
if(use_asset_pack) {
|
||||
furi_string_printf(
|
||||
anim_dir, "%s/%s/Anims", XTREME_ASSETS_PATH, xtreme_settings.asset_pack);
|
||||
anim_dir, "%s/%s/Anims", ASSET_PACKS_PATH, momentum_settings.asset_pack);
|
||||
furi_string_printf(manifest, "%s/manifest.txt", furi_string_get_cstr(anim_dir));
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
if(storage_common_stat(storage, furi_string_get_cstr(manifest), NULL) == FSE_OK) {
|
||||
@@ -513,7 +513,7 @@ static BubbleAnimation* animation_storage_load_animation(const char* name) {
|
||||
if(!flipper_format_read_uint32(ff, "Active cycles", &u32value, 1)) break; //-V779
|
||||
animation->active_cycles = u32value;
|
||||
if(!flipper_format_read_uint32(ff, "Frame rate", &u32value, 1)) break;
|
||||
uint32_t anim_speed = xtreme_settings.anim_speed;
|
||||
uint32_t anim_speed = momentum_settings.anim_speed;
|
||||
u32value = (u32value * anim_speed) / 100;
|
||||
FURI_CONST_ASSIGN(animation->icon_animation.frame_rate, u32value < 1 ? 1 : u32value);
|
||||
if(!flipper_format_read_uint32(ff, "Duration", &u32value, 1)) break;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <cli/cli_vcp.h>
|
||||
#include <locale/locale.h>
|
||||
#include <applications/main/archive/helpers/archive_helpers_ext.h>
|
||||
#include <xtreme/xtreme.h>
|
||||
#include <momentum/momentum.h>
|
||||
|
||||
#include "animations/animation_manager.h"
|
||||
#include "desktop/scenes/desktop_scene.h"
|
||||
@@ -66,13 +66,13 @@ static void desktop_clock_reconfigure(Desktop* desktop) {
|
||||
|
||||
desktop_clock_update(desktop);
|
||||
|
||||
if(xtreme_settings.statusbar_clock) {
|
||||
if(momentum_settings.statusbar_clock) {
|
||||
furi_timer_start(desktop->update_clock_timer, furi_ms_to_ticks(1000));
|
||||
} else {
|
||||
furi_timer_stop(desktop->update_clock_timer);
|
||||
}
|
||||
|
||||
view_port_enabled_set(desktop->clock_viewport, xtreme_settings.statusbar_clock);
|
||||
view_port_enabled_set(desktop->clock_viewport, momentum_settings.statusbar_clock);
|
||||
}
|
||||
|
||||
static void desktop_clock_draw_callback(Canvas* canvas, void* context) {
|
||||
@@ -217,7 +217,7 @@ void desktop_lock(Desktop* desktop, bool pin_lock) {
|
||||
Cli* cli = furi_record_open(RECORD_CLI);
|
||||
cli_session_close(cli);
|
||||
furi_record_close(RECORD_CLI);
|
||||
if(!xtreme_settings.allow_locked_rpc_commands) {
|
||||
if(!momentum_settings.allow_locked_rpc_commands) {
|
||||
Bt* bt = furi_record_open(RECORD_BT);
|
||||
bt_close_rpc_connection(bt);
|
||||
furi_record_close(RECORD_BT);
|
||||
@@ -491,7 +491,7 @@ int32_t desktop_srv(void* p) {
|
||||
|
||||
scene_manager_next_scene(desktop->scene_manager, DesktopSceneMain);
|
||||
|
||||
if(xtreme_settings.lock_on_boot || furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock)) {
|
||||
if(momentum_settings.lock_on_boot || furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock)) {
|
||||
desktop_lock(desktop, true);
|
||||
} else {
|
||||
if(!loader_is_locked(desktop->loader)) {
|
||||
|
||||
@@ -6,12 +6,10 @@
|
||||
#include <toolbox/saved_struct.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
#define DESKTOP_SETTINGS_OLD_PATH CFG_PATH("desktop.settings")
|
||||
#define DESKTOP_SETTINGS_PATH INT_PATH(".desktop.settings")
|
||||
#define DESKTOP_SETTINGS_MAGIC (0x17)
|
||||
#define DESKTOP_SETTINGS_VER (11)
|
||||
|
||||
#define DESKTOP_KEYBINDS_OLD_PATH CFG_PATH(".desktop.keybinds")
|
||||
#define DESKTOP_KEYBINDS_PATH CFG_PATH("desktop.keybinds")
|
||||
#define DESKTOP_KEYBINDS_MAGIC (0x14)
|
||||
#define DESKTOP_KEYBINDS_VER (1)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <furi_hal.h>
|
||||
|
||||
#include "../desktop_i.h"
|
||||
#include <xtreme/xtreme.h>
|
||||
#include <momentum/momentum.h>
|
||||
|
||||
#define DesktopFaultEventExit 0x00FF00FF
|
||||
|
||||
@@ -15,23 +15,13 @@ void desktop_scene_fault_on_enter(void* context) {
|
||||
|
||||
Popup* popup = desktop->hw_mismatch_popup;
|
||||
popup_set_context(popup, desktop);
|
||||
if(xtreme_assets.is_nsfw) {
|
||||
popup_set_header(
|
||||
popup,
|
||||
"Slut passed out\n but is now back",
|
||||
60,
|
||||
14 + STATUS_BAR_Y_SHIFT,
|
||||
AlignCenter,
|
||||
AlignCenter);
|
||||
} else {
|
||||
popup_set_header(
|
||||
popup,
|
||||
"Flipper crashed\n but has been rebooted",
|
||||
60,
|
||||
14 + STATUS_BAR_Y_SHIFT,
|
||||
AlignCenter,
|
||||
AlignCenter);
|
||||
}
|
||||
popup_set_header(
|
||||
popup,
|
||||
"Flipper crashed\n but has been rebooted",
|
||||
60,
|
||||
14 + STATUS_BAR_Y_SHIFT,
|
||||
AlignCenter,
|
||||
AlignCenter);
|
||||
|
||||
char* message = (char*)furi_hal_rtc_get_fault_data();
|
||||
popup_set_text(popup, message, 60, 37 + STATUS_BAR_Y_SHIFT, AlignCenter, AlignCenter);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <toolbox/saved_struct.h>
|
||||
#include <stdbool.h>
|
||||
#include <loader/loader.h>
|
||||
#include <xtreme/xtreme.h>
|
||||
#include <momentum/momentum.h>
|
||||
|
||||
#include "../desktop_i.h"
|
||||
#include <desktop/desktop_settings.h>
|
||||
@@ -43,9 +43,9 @@ void desktop_scene_lock_menu_save_settings(Desktop* desktop) {
|
||||
notification_message_save_settings(desktop->lock_menu->notification);
|
||||
desktop->lock_menu->save_notification = false;
|
||||
}
|
||||
if(desktop->lock_menu->save_xtreme) {
|
||||
xtreme_settings_save();
|
||||
desktop->lock_menu->save_xtreme = false;
|
||||
if(desktop->lock_menu->save_momentum) {
|
||||
momentum_settings_save();
|
||||
desktop->lock_menu->save_momentum = false;
|
||||
}
|
||||
if(desktop->lock_menu->save_bt) {
|
||||
bt_settings_save(&desktop->lock_menu->bt->bt_settings);
|
||||
@@ -120,9 +120,9 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
|
||||
}
|
||||
consumed = true;
|
||||
break;
|
||||
case DesktopLockMenuEventXtreme:
|
||||
case DesktopLockMenuEventMomentum:
|
||||
desktop_scene_lock_menu_save_settings(desktop);
|
||||
loader_start_detached_with_gui_error(desktop->loader, "Xtreme", NULL);
|
||||
loader_start_detached_with_gui_error(desktop->loader, "Momentum", NULL);
|
||||
consumed = true;
|
||||
break;
|
||||
case DesktopLockMenuEventStealthModeOn:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "../views/desktop_view_locked.h"
|
||||
#include "desktop_scene.h"
|
||||
#include "desktop_scene_i.h"
|
||||
#include <xtreme/xtreme.h>
|
||||
#include <momentum/momentum.h>
|
||||
|
||||
#define TAG "DesktopSrv"
|
||||
|
||||
@@ -85,7 +85,7 @@ bool desktop_scene_locked_on_event(void* context, SceneManagerEvent event) {
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
switch(event.event) {
|
||||
case DesktopLockedEventOpenPowerOff: {
|
||||
if(xtreme_settings.lockscreen_poweroff) {
|
||||
if(momentum_settings.lockscreen_poweroff) {
|
||||
loader_start(desktop->loader, "Power", "off", NULL);
|
||||
}
|
||||
consumed = true;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <stdint.h>
|
||||
#include <notification/notification.h>
|
||||
#include <notification/notification_messages.h>
|
||||
#include <xtreme/xtreme.h>
|
||||
#include <momentum/momentum.h>
|
||||
|
||||
#include "../desktop.h"
|
||||
#include "../desktop_i.h"
|
||||
@@ -57,7 +57,7 @@ static void desktop_scene_pin_input_done_callback(const PinCode* pin_code, void*
|
||||
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopPinInputEventUnlocked);
|
||||
} else {
|
||||
uint32_t pin_fails = furi_hal_rtc_get_pin_fails() + 1;
|
||||
if(pin_fails >= 10 && xtreme_settings.bad_pins_format) {
|
||||
if(pin_fails >= 10 && momentum_settings.bad_pins_format) {
|
||||
furi_hal_rtc_reset_registers();
|
||||
furi_hal_rtc_set_flag(FuriHalRtcFlagStorageFormatInternal);
|
||||
storage_sd_format(furi_record_open(RECORD_STORAGE));
|
||||
|
||||
@@ -58,5 +58,5 @@ typedef enum {
|
||||
DesktopLockMenuEventSettings,
|
||||
DesktopLockMenuEventLockKeypad,
|
||||
DesktopLockMenuEventLockPinOff,
|
||||
DesktopLockMenuEventXtreme,
|
||||
DesktopLockMenuEventMomentum,
|
||||
} DesktopEvent;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <furi.h>
|
||||
#include <gui/elements.h>
|
||||
#include <assets_icons.h>
|
||||
#include <xtreme/xtreme.h>
|
||||
#include <momentum/momentum.h>
|
||||
#include <furi_hal_rtc.h>
|
||||
|
||||
#include "../desktop_i.h"
|
||||
@@ -20,7 +20,7 @@ typedef enum {
|
||||
DesktopLockMenuIndexDarkMode,
|
||||
DesktopLockMenuIndexLock,
|
||||
DesktopLockMenuIndexBluetooth,
|
||||
DesktopLockMenuIndexXtreme,
|
||||
DesktopLockMenuIndexMomentum,
|
||||
DesktopLockMenuIndexBrightness,
|
||||
DesktopLockMenuIndexVolume,
|
||||
|
||||
@@ -101,7 +101,7 @@ void desktop_lock_menu_draw_callback(Canvas* canvas, void* model) {
|
||||
break;
|
||||
case DesktopLockMenuIndexDarkMode:
|
||||
icon = &I_CC_DarkMode_16x16;
|
||||
enabled = xtreme_settings.dark_mode;
|
||||
enabled = momentum_settings.dark_mode;
|
||||
break;
|
||||
case DesktopLockMenuIndexLock:
|
||||
icon = &I_CC_Lock_16x16;
|
||||
@@ -110,8 +110,8 @@ void desktop_lock_menu_draw_callback(Canvas* canvas, void* model) {
|
||||
icon = &I_CC_Bluetooth_16x16;
|
||||
enabled = m->lock_menu->bt->bt_settings.enabled;
|
||||
break;
|
||||
case DesktopLockMenuIndexXtreme:
|
||||
icon = &I_CC_Xtreme_16x16;
|
||||
case DesktopLockMenuIndexMomentum:
|
||||
icon = &I_CC_Momentum_16x16;
|
||||
break;
|
||||
case DesktopLockMenuIndexBrightness:
|
||||
icon = &I_Pin_star_7x7;
|
||||
@@ -287,8 +287,8 @@ bool desktop_lock_menu_input_callback(InputEvent* event, void* context) {
|
||||
desktop_event = DesktopLockMenuEventSettings;
|
||||
break;
|
||||
case DesktopLockMenuIndexDarkMode:
|
||||
xtreme_settings.dark_mode = !xtreme_settings.dark_mode;
|
||||
lock_menu->save_xtreme = true;
|
||||
momentum_settings.dark_mode = !momentum_settings.dark_mode;
|
||||
lock_menu->save_momentum = true;
|
||||
break;
|
||||
case DesktopLockMenuIndexBluetooth:
|
||||
lock_menu->bt->bt_settings.enabled = !lock_menu->bt->bt_settings.enabled;
|
||||
@@ -299,8 +299,8 @@ bool desktop_lock_menu_input_callback(InputEvent* event, void* context) {
|
||||
}
|
||||
lock_menu->save_bt = true;
|
||||
break;
|
||||
case DesktopLockMenuIndexXtreme:
|
||||
desktop_event = DesktopLockMenuEventXtreme;
|
||||
case DesktopLockMenuIndexMomentum:
|
||||
desktop_event = DesktopLockMenuEventMomentum;
|
||||
break;
|
||||
case DesktopLockMenuIndexVolume:
|
||||
desktop_event = stealth_mode ? DesktopLockMenuEventStealthModeOff :
|
||||
|
||||
@@ -19,7 +19,7 @@ struct DesktopLockMenuView {
|
||||
NotificationApp* notification;
|
||||
Bt* bt;
|
||||
bool save_notification;
|
||||
bool save_xtreme;
|
||||
bool save_momentum;
|
||||
bool save_bt;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <gui/view.h>
|
||||
#include <assets_icons.h>
|
||||
#include <locale/locale.h>
|
||||
#include <xtreme/xtreme.h>
|
||||
#include <momentum/momentum.h>
|
||||
|
||||
#include <desktop/desktop_settings.h>
|
||||
#include "../desktop_i.h"
|
||||
@@ -92,14 +92,14 @@ void desktop_view_locked_draw_lockscreen(Canvas* canvas, void* m) {
|
||||
snprintf(date_str, 14, "%.2d-%.2d-%.4d", datetime.day, datetime.month, datetime.year);
|
||||
}
|
||||
|
||||
if(!xtreme_settings.lockscreen_transparent) {
|
||||
if(!momentum_settings.lockscreen_transparent) {
|
||||
canvas_draw_icon(canvas, 0, 0 + y, &I_Lockscreen);
|
||||
}
|
||||
if(xtreme_settings.lockscreen_time) {
|
||||
if(momentum_settings.lockscreen_time) {
|
||||
canvas_set_font(canvas, FontBigNumbers);
|
||||
canvas_draw_str(canvas, 0, 64 + y, time_str);
|
||||
int offset = canvas_string_width(canvas, time_str) + 2;
|
||||
if(xtreme_settings.lockscreen_seconds) {
|
||||
if(momentum_settings.lockscreen_seconds) {
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
canvas_draw_str(canvas, 0 + offset, 64 + y, second_str);
|
||||
offset += canvas_string_width(canvas, ":00") + 2;
|
||||
@@ -109,12 +109,12 @@ void desktop_view_locked_draw_lockscreen(Canvas* canvas, void* m) {
|
||||
canvas_draw_str(canvas, 0 + offset, 64 + y, meridian_str);
|
||||
}
|
||||
}
|
||||
if(xtreme_settings.lockscreen_date) {
|
||||
if(momentum_settings.lockscreen_date) {
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
canvas_draw_str(canvas, 0, 48 + y + 16 * !xtreme_settings.lockscreen_time, date_str);
|
||||
canvas_draw_str(canvas, 0, 48 + y + 16 * !momentum_settings.lockscreen_time, date_str);
|
||||
}
|
||||
if(model->view_state == DesktopViewLockedStateLockedHintShown &&
|
||||
xtreme_settings.lockscreen_prompt) {
|
||||
momentum_settings.lockscreen_prompt) {
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
if(model->pin_locked) {
|
||||
elements_bubble_str(
|
||||
|
||||
Reference in New Issue
Block a user