diff --git a/.vscode/example/launch.json b/.vscode/example/launch.json index 5c46d3979..f7a9f8269 100644 --- a/.vscode/example/launch.json +++ b/.vscode/example/launch.json @@ -11,9 +11,10 @@ "args": { "useSingleResult": true, "env": { - "PATH": "${workspaceFolder};${env:PATH}" + "PATH": "${workspaceFolder};${env:PATH}", + "FBT_QUIET": 1 }, - "command": "./fbt get_blackmagic", + "command": "fbt get_blackmagic", "description": "Get Blackmagic device", } } diff --git a/ReadMe.md b/ReadMe.md index 027fb2fce..7563781fe 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -152,17 +152,21 @@ Note: This repo is always updated with OFW & Unleashed. No need to mention all t

Install:

-**NOTE: If you are coming from a different FW, it is recommended to delete / clear your "apps" folder on the SD card prior to updating. This folder houses all the .fap files, which do not update to the correct API versions by default if old ones are present (Thanks flipper devs). This does `NOT` remove any of your saved files!** +**This is the recommended install procedure. Please follow these steps EXACTLY and CAREFULLY to ensure you install correctly.** +**This process will NOT delete any saved files and simply ensures the install goes smoothly.**

-- Download the latest release (.zip) from [The releases tab](https://github.com/ClaraCrazy/Flipper-Xtreme/releases/latest) -- Extract the archive. This is now your new Firmware folder -- Open [qFlipper](https://flipperzero.one/update), head to `SD/Update` and simply move the firmware folder there -- On the Flipper, hit the `Arrow Down` button, this will get you to the file menu. Hit `Arrow Left` once, and then simply search for your updates folder -- Inside that folder, select the Firmware you just moved onto it, and run the file thats simply called `Update` +- Download the latest release (`.tgz`) from [the release page](https://github.com/ClaraCrazy/Flipper-Xtreme/releases/latest) +- Open [qFlipper](https://flipperzero.one/update) and connect your Flipper Zero +- Go to the files tab, into SD Card, and DELETE THE `apps` AND `update` FOLDERS +- Go back to the device tab +- Click `Install from file...` and select the downloaded file (`.tgz`) - Enjoy! +**If you have issues or crashes with that process, you can try to use `Settings > Storage > Factory Reset` then retry the install.** +**Doing that will NOT remove your saved files, it will only forget some settings and paired devices.** + ----

Build it yourself:

diff --git a/applications/main/archive/helpers/archive_files.h b/applications/main/archive/helpers/archive_files.h index 863a8e7da..431c701b3 100644 --- a/applications/main/archive/helpers/archive_files.h +++ b/applications/main/archive/helpers/archive_files.h @@ -84,7 +84,7 @@ static void ArchiveFile_t_clear(ArchiveFile_t* obj) { } static int ArchiveFile_t_cmp(const ArchiveFile_t* a, const ArchiveFile_t* b) { - if(!XTREME_SETTINGS()->sort_ignore_dirs) { + if(XTREME_SETTINGS()->sort_dirs_first) { if(a->type == ArchiveFileTypeFolder && b->type != ArchiveFileTypeFolder) { return -1; } diff --git a/applications/main/nfc/nfc_cli.c b/applications/main/nfc/nfc_cli.c index a6475ca68..23335e299 100644 --- a/applications/main/nfc/nfc_cli.c +++ b/applications/main/nfc/nfc_cli.c @@ -32,7 +32,7 @@ static void nfc_cli_detect(Cli* cli, FuriString* args) { while(!cmd_exit) { cmd_exit |= cli_cmd_interrupt_received(cli); if(furi_hal_nfc_detect(&dev_data, 400)) { - printf("found: %s ", nfc_get_dev_type(dev_data.type)); + printf("Found: %s ", nfc_get_dev_type(dev_data.type)); printf("UID length: %d, UID:", dev_data.uid_len); for(size_t i = 0; i < dev_data.uid_len; i++) { printf("%02X", dev_data.uid[i]); diff --git a/applications/services/application.fam b/applications/services/application.fam index 934b0b012..6c41160db 100644 --- a/applications/services/application.fam +++ b/applications/services/application.fam @@ -6,6 +6,7 @@ App( "crypto_start", "rpc_start", "bt", + "xtreme", "desktop", "loader", "power", diff --git a/applications/services/desktop/animations/animation_storage.c b/applications/services/desktop/animations/animation_storage.c index 0d09f18dd..f6181caa2 100644 --- a/applications/services/desktop/animations/animation_storage.c +++ b/applications/services/desktop/animations/animation_storage.c @@ -528,7 +528,6 @@ static BubbleAnimation* animation_storage_load_animation(const char* name) { animation->active_cycles = u32value; if(!flipper_format_read_uint32(ff, "Frame rate", &u32value, 1)) break; uint16_t anim_speed = XTREME_SETTINGS()->anim_speed; - anim_speed = (anim_speed == 0 ? 100 : 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; diff --git a/applications/services/desktop/desktop.c b/applications/services/desktop/desktop.c index 92ef13659..9ca81f29a 100644 --- a/applications/services/desktop/desktop.c +++ b/applications/services/desktop/desktop.c @@ -56,7 +56,7 @@ static bool desktop_custom_event_callback(void* context, uint32_t event) { return true; case DesktopGlobalAutoLock: if(!loader_is_locked(desktop->loader)) { - if(desktop->settings.pin_code.length > 0) { + if(desktop->settings.auto_lock_with_pin && desktop->settings.pin_code.length > 0) { desktop_pin_lock(&desktop->settings); } desktop_lock(desktop); diff --git a/applications/services/desktop/desktop_settings.h b/applications/services/desktop/desktop_settings.h index 6285f9c90..93292072f 100644 --- a/applications/services/desktop/desktop_settings.h +++ b/applications/services/desktop/desktop_settings.h @@ -54,4 +54,5 @@ typedef struct { PinCode pin_code; uint8_t is_locked; uint32_t auto_lock_delay_ms; + bool auto_lock_with_pin; } DesktopSettings; diff --git a/applications/services/dolphin/dolphin.c b/applications/services/dolphin/dolphin.c index e5b0ba52b..8421f6815 100644 --- a/applications/services/dolphin/dolphin.c +++ b/applications/services/dolphin/dolphin.c @@ -7,6 +7,7 @@ #include #include #include "furi_hal_random.h" +#include #define DOLPHIN_LOCK_EVENT_FLAG (0x1) #define TAG "Dolphin" @@ -92,8 +93,9 @@ Dolphin* dolphin_alloc() { dolphin->state = dolphin_state_alloc(); dolphin->event_queue = furi_message_queue_alloc(8, sizeof(DolphinEvent)); dolphin->pubsub = furi_pubsub_alloc(); + int32_t butthurt = XTREME_SETTINGS()->butthurt_timer; dolphin->butthurt_timer = xTimerCreate( - NULL, HOURS_IN_TICKS(2 * 24), pdTRUE, dolphin, dolphin_butthurt_timer_callback); + NULL, (butthurt > 0) ? (butthurt * 1000) : -1, pdTRUE, dolphin, dolphin_butthurt_timer_callback); dolphin->flush_timer = xTimerCreate(NULL, 30 * 1000, pdFALSE, dolphin, dolphin_flush_timer_callback); dolphin->clear_limits_timer = xTimerCreate( diff --git a/applications/services/gui/modules/file_browser.c b/applications/services/gui/modules/file_browser.c index 5477192a0..841afda50 100644 --- a/applications/services/gui/modules/file_browser.c +++ b/applications/services/gui/modules/file_browser.c @@ -91,7 +91,7 @@ static int BrowserItem_t_cmp(const BrowserItem_t* a, const BrowserItem_t* b) { if(b->type == BrowserItemTypeBack) { return 1; } - if(!XTREME_SETTINGS()->sort_ignore_dirs) { + if(XTREME_SETTINGS()->sort_dirs_first) { if(a->type == BrowserItemTypeFolder && b->type != BrowserItemTypeFolder) { return -1; } diff --git a/applications/services/power/power_service/power.h b/applications/services/power/power_service/power.h index 6e41d5c6e..1752643d1 100644 --- a/applications/services/power/power_service/power.h +++ b/applications/services/power/power_service/power.h @@ -26,14 +26,14 @@ typedef enum { } PowerEventType; typedef enum { - BatteryIconOff = 1, - BatteryIconBar = 2, - BatteryIconPercent = 3, - BatteryIconInvertedPercent = 4, - BatteryIconRetro3 = 5, - BatteryIconRetro5 = 6, - BatteryIconBarPercent = 0, - BatteryIconCount = 7, + BatteryIconOff, + BatteryIconBar, + BatteryIconPercent, + BatteryIconInvertedPercent, + BatteryIconRetro3, + BatteryIconRetro5, + BatteryIconBarPercent, + BatteryIconCount, } BatteryIcon; typedef union { diff --git a/applications/services/storage/application.fam b/applications/services/storage/application.fam index 7aa721cc3..7b106e00f 100644 --- a/applications/services/storage/application.fam +++ b/applications/services/storage/application.fam @@ -7,7 +7,7 @@ App( requires=["storage_settings"], provides=["storage_start"], stack_size=3 * 1024, - order=120, + order=44, sdk_headers=["storage.h"], ) diff --git a/applications/services/xtreme/application.fam b/applications/services/xtreme/application.fam index 2dfcab051..1b4d73058 100644 --- a/applications/services/xtreme/application.fam +++ b/applications/services/xtreme/application.fam @@ -1,10 +1,10 @@ App( appid="xtreme", - apptype=FlipperAppType.STARTUP, - entry_point="xtreme_on_system_start", + name="Xtreme", + apptype=FlipperAppType.SERVICE, + entry_point="xtreme_srv", + cdefines=["SRV_XTREME"], requires=["storage"], - order=1000, - provides=[ - "xtreme", - ], + stack_size=1 * 1024, + order=46, ) diff --git a/applications/services/xtreme/assets.c b/applications/services/xtreme/assets.c index 1862f1ec7..88a6d563d 100644 --- a/applications/services/xtreme/assets.c +++ b/applications/services/xtreme/assets.c @@ -2,6 +2,8 @@ #include #include +#define TAG "XtremeAssets" + #define ICONS_FMT PACKS_DIR "/%s/Icons/%s" XtremeAssets* xtreme_assets = NULL; @@ -111,7 +113,6 @@ void XTREME_ASSETS_LOAD() { if(xtreme_assets != NULL) return; xtreme_assets = malloc(sizeof(XtremeAssets)); - XtremeSettings* xtreme_settings = XTREME_SETTINGS(); xtreme_assets->A_Levelup_128x64 = &A_Levelup_128x64; xtreme_assets->I_BLE_Pairing_128x64 = &I_BLE_Pairing_128x64; @@ -136,20 +137,34 @@ void XTREME_ASSETS_LOAD() { xtreme_assets->I_Connected_62x31 = &I_Connected_62x31; xtreme_assets->I_Error_62x31 = &I_Error_62x31; + if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) { + FURI_LOG_W(TAG, "Load skipped. Device is in special startup mode."); + return; + } + + XtremeSettings* xtreme_settings = XTREME_SETTINGS(); if(xtreme_settings->asset_pack[0] == '\0') return; xtreme_assets->is_nsfw = strncmp(xtreme_settings->asset_pack, "NSFW", strlen("NSFW")) == 0; + + Storage* storage = furi_record_open(RECORD_STORAGE); + int32_t timeout = 5000; + while(timeout > 0) { + if(storage_sd_status(storage) == FSE_OK) break; + furi_delay_ms(250); + timeout -= 250; + } + FileInfo info; FuriString* path = furi_string_alloc(); furi_string_printf(path, PACKS_DIR "/%s", xtreme_settings->asset_pack); - Storage* storage = furi_record_open(RECORD_STORAGE); if(storage_common_stat(storage, furi_string_get_cstr(path), &info) == FSE_OK && info.flags & FSF_DIRECTORY) { File* file = storage_file_alloc(storage); swap(xtreme_assets, path, file); storage_file_free(file); } - furi_record_close(RECORD_STORAGE); furi_string_free(path); + furi_record_close(RECORD_STORAGE); } XtremeAssets* XTREME_ASSETS() { diff --git a/applications/services/xtreme/settings.c b/applications/services/xtreme/settings.c index eea68bd2b..14ef740d5 100644 --- a/applications/services/xtreme/settings.c +++ b/applications/services/xtreme/settings.c @@ -1,5 +1,7 @@ #include "settings.h" +#define TAG "XtremeSettings" + XtremeSettings* xtreme_settings = NULL; XtremeSettings* XTREME_SETTINGS() { @@ -9,28 +11,50 @@ XtremeSettings* XTREME_SETTINGS() { return xtreme_settings; } -bool XTREME_SETTINGS_LOAD() { +void XTREME_SETTINGS_LOAD() { if(xtreme_settings == NULL) { + xtreme_settings = malloc(sizeof(XtremeSettings)); - bool loaded = saved_struct_load( - XTREME_SETTINGS_PATH, - xtreme_settings, - sizeof(XtremeSettings), - XTREME_SETTINGS_MAGIC, - XTREME_SETTINGS_VERSION); + bool loaded; + + if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) { + FURI_LOG_W(TAG, "Load skipped. Device is in special startup mode."); + loaded = false; + } else { + loaded = saved_struct_load( + XTREME_SETTINGS_PATH, + xtreme_settings, + sizeof(XtremeSettings), + XTREME_SETTINGS_MAGIC, + XTREME_SETTINGS_VERSION); + } + if(!loaded) { memset(xtreme_settings, 0, sizeof(XtremeSettings)); - loaded = XTREME_SETTINGS_SAVE(); + strlcpy(xtreme_settings->asset_pack, "", MAX_PACK_NAME_LEN); // SFW + xtreme_settings->anim_speed = 100; // 100% + xtreme_settings->cycle_anims = 0; // Meta.txt + xtreme_settings->unlock_anims = false; // OFF + xtreme_settings->battery_icon = BatteryIconBarPercent; // Bar % + xtreme_settings->status_icons = true; // ON + xtreme_settings->bar_borders = true; // ON + xtreme_settings->bar_background = false; // OFF + xtreme_settings->bad_bt = false; // USB + xtreme_settings->sort_dirs_first = true; // ON + xtreme_settings->butthurt_timer = 43200; // 12 H } - return loaded; } - return true; } bool XTREME_SETTINGS_SAVE() { if(xtreme_settings == NULL) { XTREME_SETTINGS_LOAD(); } + + if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) { + return true; + } + return saved_struct_save( XTREME_SETTINGS_PATH, xtreme_settings, diff --git a/applications/services/xtreme/settings.h b/applications/services/xtreme/settings.h index b4f12b1b8..44ad37abf 100644 --- a/applications/services/xtreme/settings.h +++ b/applications/services/xtreme/settings.h @@ -11,7 +11,7 @@ #define MAX_PACK_NAME_LEN 32 -#define XTREME_SETTINGS_VERSION (2) +#define XTREME_SETTINGS_VERSION (3) #define XTREME_SETTINGS_PATH INT_PATH(XTREME_SETTINGS_FILE_NAME) #define XTREME_SETTINGS_MAGIC (0x69) @@ -28,11 +28,12 @@ typedef struct { bool bar_borders; bool bar_background; bool bad_bt; - bool sort_ignore_dirs; + bool sort_dirs_first; + int32_t butthurt_timer; } XtremeSettings; XtremeSettings* XTREME_SETTINGS(); -bool XTREME_SETTINGS_LOAD(); +void XTREME_SETTINGS_LOAD(); bool XTREME_SETTINGS_SAVE(); diff --git a/applications/services/xtreme/on_system_start.c b/applications/services/xtreme/xtreme_srv.c similarity index 61% rename from applications/services/xtreme/on_system_start.c rename to applications/services/xtreme/xtreme_srv.c index 531888f1b..fa6fb97f2 100644 --- a/applications/services/xtreme/on_system_start.c +++ b/applications/services/xtreme/xtreme_srv.c @@ -1,7 +1,11 @@ #include "settings.h" #include "assets.h" -void xtreme_on_system_start() { +int32_t xtreme_srv(void* p) { + UNUSED(p); + XTREME_SETTINGS_LOAD(); XTREME_ASSETS_LOAD(); + + return 0; } diff --git a/applications/settings/desktop_settings/scenes/desktop_settings_scene_favorite.c b/applications/settings/desktop_settings/scenes/desktop_settings_scene_favorite.c index aaca1cf70..94c5ee9f0 100644 --- a/applications/settings/desktop_settings/scenes/desktop_settings_scene_favorite.c +++ b/applications/settings/desktop_settings/scenes/desktop_settings_scene_favorite.c @@ -42,7 +42,7 @@ void desktop_settings_scene_favorite_on_enter(void* context) { submenu_reset(submenu); uint32_t primary_favorite = - scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite) == SCENE_EVENT_SELECT_FAVORITE_PRIMARY; + scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite); uint32_t pre_select_item = 0; for(size_t i = 0; i < FLIPPER_APPS_COUNT; i++) { @@ -81,7 +81,7 @@ bool desktop_settings_scene_favorite_on_event(void* context, SceneManagerEvent e FuriString* temp_path = furi_string_alloc_set_str(EXT_PATH("apps")); uint32_t primary_favorite = - scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite) == SCENE_EVENT_SELECT_FAVORITE_PRIMARY; + scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite); if(event.type == SceneManagerEventTypeCustom) { if(strcmp(FLIPPER_APPS[event.event].name, FAP_LOADER_APP_NAME) != 0) { diff --git a/applications/settings/desktop_settings/scenes/desktop_settings_scene_start.c b/applications/settings/desktop_settings/scenes/desktop_settings_scene_start.c index 6f44cb9c3..6253ddacd 100644 --- a/applications/settings/desktop_settings/scenes/desktop_settings_scene_start.c +++ b/applications/settings/desktop_settings/scenes/desktop_settings_scene_start.c @@ -39,6 +39,14 @@ static void desktop_settings_scene_start_auto_lock_delay_changed(VariableItem* i app->settings.auto_lock_delay_ms = auto_lock_delay_value[index]; } +static void desktop_settings_scene_start_auto_lock_pin_changed(VariableItem* item) { + DesktopSettingsApp* app = variable_item_get_context(item); + uint8_t value = variable_item_get_current_value_index(item); + + variable_item_set_current_value_text(item, value ? "ON" : "OFF"); + app->settings.auto_lock_with_pin = value; +} + void desktop_settings_scene_start_on_enter(void* context) { DesktopSettingsApp* app = context; VariableItemList* variable_item_list = app->variable_item_list; @@ -46,9 +54,9 @@ void desktop_settings_scene_start_on_enter(void* context) { VariableItem* item; uint8_t value_index; - variable_item_list_add(variable_item_list, "Primary Fav. App (UP)", 1, NULL, NULL); + variable_item_list_add(variable_item_list, "Primary Fav App (Up)", 1, NULL, NULL); - variable_item_list_add(variable_item_list, "Secondary Fav. App (DOWN)", 1, NULL, NULL); + variable_item_list_add(variable_item_list, "Secondary Fav App (Down)", 1, NULL, NULL); // variable_item_list_add(variable_item_list, "Favorite Game", 1, NULL, NULL); @@ -66,6 +74,16 @@ void desktop_settings_scene_start_on_enter(void* context) { variable_item_set_current_value_index(item, value_index); variable_item_set_current_value_text(item, auto_lock_delay_text[value_index]); + item = variable_item_list_add( + variable_item_list, + "Auto Lock Pin", + 2, + desktop_settings_scene_start_auto_lock_pin_changed, + app); + + variable_item_set_current_value_index(item, app->settings.auto_lock_with_pin); + variable_item_set_current_value_text(item, app->settings.auto_lock_with_pin ? "ON" : "OFF"); + variable_item_list_set_enter_callback( variable_item_list, desktop_settings_scene_start_var_list_enter_callback, app); view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewVarItemList); @@ -78,12 +96,12 @@ bool desktop_settings_scene_start_on_event(void* context, SceneManagerEvent sme) if(sme.type == SceneManagerEventTypeCustom) { switch(sme.event) { case SCENE_EVENT_SELECT_FAVORITE_PRIMARY: - scene_manager_set_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite, SCENE_EVENT_SELECT_FAVORITE_PRIMARY); + scene_manager_set_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite, true); scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite); consumed = true; break; case SCENE_EVENT_SELECT_FAVORITE_SECONDARY: - scene_manager_set_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite, SCENE_EVENT_SELECT_FAVORITE_SECONDARY); + scene_manager_set_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite, false); scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite); consumed = true; break; diff --git a/applications/settings/xtreme_app/scenes/xtreme_app_scene_config.h b/applications/settings/xtreme_app/scenes/xtreme_app_scene_config.h index 9eed63575..36d587b02 100644 --- a/applications/settings/xtreme_app/scenes/xtreme_app_scene_config.h +++ b/applications/settings/xtreme_app/scenes/xtreme_app_scene_config.h @@ -1 +1,6 @@ -ADD_SCENE(xtreme_app, main, Main) +ADD_SCENE(xtreme_app, start, Start) +ADD_SCENE(xtreme_app, graphics, Graphics) +ADD_SCENE(xtreme_app, statusbar, Statusbar) +ADD_SCENE(xtreme_app, protocols, Protocols) +ADD_SCENE(xtreme_app, dolphin, Dolphin) +ADD_SCENE(xtreme_app, misc, Misc) diff --git a/applications/settings/xtreme_app/scenes/xtreme_app_scene_dolphin.c b/applications/settings/xtreme_app/scenes/xtreme_app_scene_dolphin.c new file mode 100644 index 000000000..2926de539 --- /dev/null +++ b/applications/settings/xtreme_app/scenes/xtreme_app_scene_dolphin.c @@ -0,0 +1,78 @@ +#include "../xtreme_app.h" + +static void xtreme_app_scene_dolphin_xp_level_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + app->dolphin_level = variable_item_get_current_value_index(item) + 1; + char level_str[4]; + snprintf(level_str, 4, "%i", app->dolphin_level); + variable_item_set_current_value_text(item, level_str); + app->save_level = true; +} + +const char* const butthurt_timer_names[] = { + "OFF", + "30 M", + "1 H", + "2 H", + "4 H", + "6 H", + "8 H", + "12 H", + "24 H", + "48 H"}; +const int32_t butthurt_timer_values[COUNT_OF(butthurt_timer_names)] = + {-1, 1800, 3600, 7200, 14400, 21600, 28800, 43200, 86400, 172800}; +static void xtreme_app_scene_dolphin_butthurt_timer_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, butthurt_timer_names[index]); + XTREME_SETTINGS()->butthurt_timer = butthurt_timer_values[index]; + app->save_settings = true; + app->require_reboot = true; +} + +void xtreme_app_scene_dolphin_on_enter(void* context) { + XtremeApp* app = context; + XtremeSettings* xtreme_settings = XTREME_SETTINGS(); + VariableItemList* var_item_list = app->var_item_list; + VariableItem* item; + uint8_t value_index; + + char level_str[4]; + snprintf(level_str, 4, "%i", app->dolphin_level); + item = variable_item_list_add( + var_item_list, + "XP Level", + DOLPHIN_LEVEL_COUNT + 1, + xtreme_app_scene_dolphin_xp_level_changed, + app); + variable_item_set_current_value_index(item, app->dolphin_level - 1); + variable_item_set_current_value_text(item, level_str); + + item = variable_item_list_add( + var_item_list, + "Butthurt Timer", + COUNT_OF(butthurt_timer_names), + xtreme_app_scene_dolphin_butthurt_timer_changed, + app); + value_index = value_index_int32( + xtreme_settings->butthurt_timer, butthurt_timer_values, COUNT_OF(butthurt_timer_names)); + variable_item_set_current_value_index(item, value_index); + variable_item_set_current_value_text(item, butthurt_timer_names[value_index]); + + variable_item_list_set_selected_item(var_item_list, 0); + + view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewVarItemList); +} + +bool xtreme_app_scene_dolphin_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); + bool consumed = false; + return consumed; +} + +void xtreme_app_scene_dolphin_on_exit(void* context) { + XtremeApp* app = context; + variable_item_list_reset(app->var_item_list); +} diff --git a/applications/settings/xtreme_app/scenes/xtreme_app_scene_graphics.c b/applications/settings/xtreme_app/scenes/xtreme_app_scene_graphics.c new file mode 100644 index 000000000..9d3b20dd2 --- /dev/null +++ b/applications/settings/xtreme_app/scenes/xtreme_app_scene_graphics.c @@ -0,0 +1,120 @@ +#include "../xtreme_app.h" + +static void xtreme_app_scene_graphics_asset_pack_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + variable_item_set_current_value_text( + item, index == 0 ? "SFW" : *asset_packs_get(app->asset_packs, index - 1)); + strlcpy( + XTREME_SETTINGS()->asset_pack, + index == 0 ? "" : *asset_packs_get(app->asset_packs, index - 1), + MAX_PACK_NAME_LEN); + app->asset_pack = index; + app->save_settings = true; + app->require_reboot = true; +} + +const char* const anim_speed_names[] = + {"25%", "50%", "75%", "100%", "125%", "150%", "175%", "200%", "225%", "250%", "275%", "300%"}; +const int32_t anim_speed_values[COUNT_OF(anim_speed_names)] = + {25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300}; +static void xtreme_app_scene_graphics_anim_speed_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, anim_speed_names[index]); + XTREME_SETTINGS()->anim_speed = anim_speed_values[index]; + app->save_settings = true; +} + +const char* const cycle_anims_names[] = { + "OFF", + "Meta.txt", + "30 S", + "1 M", + "5 M", + "10 M", + "15 M", + "30 M", + "1 H", + "2 H", + "6 H", + "12 H", + "24 H"}; +const int32_t cycle_anims_values[COUNT_OF(cycle_anims_names)] = + {-1, 0, 30, 60, 300, 600, 900, 1800, 3600, 7200, 21600, 43200, 86400}; +static void xtreme_app_scene_graphics_cycle_anims_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, cycle_anims_names[index]); + XTREME_SETTINGS()->cycle_anims = cycle_anims_values[index]; + app->save_settings = true; +} + +static void xtreme_app_scene_graphics_unlock_anims_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + bool value = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, value ? "ON" : "OFF"); + XTREME_SETTINGS()->unlock_anims = value; + app->save_settings = true; +} + +void xtreme_app_scene_graphics_on_enter(void* context) { + XtremeApp* app = context; + XtremeSettings* xtreme_settings = XTREME_SETTINGS(); + VariableItemList* var_item_list = app->var_item_list; + VariableItem* item; + uint8_t value_index; + + item = variable_item_list_add( + var_item_list, + "Asset Pack", + asset_packs_size(app->asset_packs) + 1, + xtreme_app_scene_graphics_asset_pack_changed, + app); + variable_item_set_current_value_index(item, app->asset_pack); + variable_item_set_current_value_text( + item, app->asset_pack == 0 ? "SFW" : *asset_packs_get(app->asset_packs, app->asset_pack - 1)); + + item = variable_item_list_add( + var_item_list, + "Anim Speed", + COUNT_OF(anim_speed_names), + xtreme_app_scene_graphics_anim_speed_changed, + app); + value_index = value_index_int32( + xtreme_settings->anim_speed, anim_speed_values, COUNT_OF(anim_speed_names)); + variable_item_set_current_value_index(item, value_index); + variable_item_set_current_value_text(item, anim_speed_names[value_index]); + + item = variable_item_list_add( + var_item_list, + "Cycle Anims", + COUNT_OF(cycle_anims_names), + xtreme_app_scene_graphics_cycle_anims_changed, + app); + value_index = value_index_int32( + xtreme_settings->cycle_anims, cycle_anims_values, COUNT_OF(cycle_anims_names)); + variable_item_set_current_value_index(item, value_index); + variable_item_set_current_value_text(item, cycle_anims_names[value_index]); + + item = variable_item_list_add( + var_item_list, "Unlock Anims", 2, xtreme_app_scene_graphics_unlock_anims_changed, app); + variable_item_set_current_value_index(item, xtreme_settings->unlock_anims); + variable_item_set_current_value_text(item, xtreme_settings->unlock_anims ? "ON" : "OFF"); + + variable_item_list_set_selected_item(var_item_list, 0); + + view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewVarItemList); +} + +bool xtreme_app_scene_graphics_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); + bool consumed = false; + return consumed; +} + +void xtreme_app_scene_graphics_on_exit(void* context) { + XtremeApp* app = context; + variable_item_list_reset(app->var_item_list); +} diff --git a/applications/settings/xtreme_app/scenes/xtreme_app_scene_main.c b/applications/settings/xtreme_app/scenes/xtreme_app_scene_main.c deleted file mode 100644 index 03602bb58..000000000 --- a/applications/settings/xtreme_app/scenes/xtreme_app_scene_main.c +++ /dev/null @@ -1,319 +0,0 @@ -#include "../xtreme_app.h" -#include -#include -#include - -static void xtreme_app_scene_main_asset_pack_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - uint8_t index = variable_item_get_current_value_index(item); - variable_item_set_current_value_text( - item, index == 0 ? "SFW" : *asset_packs_get(app->asset_packs, index - 1)); - strlcpy( - XTREME_SETTINGS()->asset_pack, - index == 0 ? "" : *asset_packs_get(app->asset_packs, index - 1), - MAX_PACK_NAME_LEN); - app->settings_changed = true; - app->assets_changed = true; -} - -const char* const anim_speed_names[] = - {"25%", "50%", "75%", "100%", "125%", "150%", "175%", "200%", "225%", "250%", "275%", "300%"}; -const int32_t anim_speed_values[COUNT_OF(anim_speed_names)] = - {25, 50, 75, 0, 125, 150, 175, 200, 225, 250, 275, 300}; -static void xtreme_app_scene_main_anim_speed_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - uint8_t index = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, anim_speed_names[index]); - XTREME_SETTINGS()->anim_speed = anim_speed_values[index]; - app->settings_changed = true; -} - -const char* const cycle_anims_names[] = { - "OFF", - "Meta.txt", - "30 S", - "1 M", - "5 M", - "10 M", - "15 M", - "30 M", - "1 H", - "2 H", - "6 H", - "12 H", - "24 H"}; -const int32_t cycle_anims_values[COUNT_OF(cycle_anims_names)] = - {-1, 0, 30, 60, 300, 600, 900, 1800, 3600, 7200, 21600, 43200, 86400}; -static void xtreme_app_scene_main_cycle_anims_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - uint8_t index = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, cycle_anims_names[index]); - XTREME_SETTINGS()->cycle_anims = cycle_anims_values[index]; - app->settings_changed = true; -} - -static void xtreme_app_scene_main_unlock_anims_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - bool value = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, value ? "ON" : "OFF"); - XTREME_SETTINGS()->unlock_anims = value; - app->settings_changed = true; -} - -const char* const battery_icon_names[] = - {"OFF", "Bar", "%", "Inv. %", "Retro 3", "Retro 5", "Bar %"}; -static void xtreme_app_scene_main_battery_icon_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - uint8_t index = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, battery_icon_names[index]); - XTREME_SETTINGS()->battery_icon = (index + 1) % BatteryIconCount; - app->settings_changed = true; -} - -static void xtreme_app_scene_main_status_icons_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - bool value = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, value ? "ON" : "OFF"); - XTREME_SETTINGS()->status_icons = value; - app->settings_changed = true; -} - -static void xtreme_app_scene_main_bar_borders_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - bool value = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, value ? "ON" : "OFF"); - XTREME_SETTINGS()->bar_borders = value; - app->settings_changed = true; -} - -static void xtreme_app_scene_main_bar_background_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - bool value = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, value ? "ON" : "OFF"); - XTREME_SETTINGS()->bar_background = value; - app->settings_changed = true; -} - -static void xtreme_app_scene_main_bad_bk_mode_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - bool value = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, value ? "BT" : "USB"); - XTREME_SETTINGS()->bad_bt = value; - app->settings_changed = true; -} - -static void xtreme_app_scene_main_subghz_extend_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - app->subghz_extend = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, app->subghz_extend ? "ON" : "OFF"); - app->subghz_changed = true; -} - -static void xtreme_app_scene_main_subghz_bypass_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - app->subghz_bypass = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, app->subghz_bypass ? "ON" : "OFF"); - app->subghz_changed = true; -} - -static void xtreme_app_scene_main_sort_folders_before_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - bool value = variable_item_get_current_value_index(item); - variable_item_set_current_value_text(item, value ? "ON" : "OFF"); - XTREME_SETTINGS()->sort_ignore_dirs = !value; - app->settings_changed = true; -} - -static void xtreme_app_scene_main_xp_level_changed(VariableItem* item) { - XtremeApp* app = variable_item_get_context(item); - app->dolphin_level = variable_item_get_current_value_index(item) + 1; - char level_str[4]; - snprintf(level_str, 4, "%i", app->dolphin_level); - variable_item_set_current_value_text(item, level_str); - app->level_changed = true; -} - -void xtreme_app_scene_main_on_enter(void* context) { - XtremeApp* app = context; - XtremeSettings* xtreme_settings = XTREME_SETTINGS(); - VariableItemList* var_item_list = app->var_item_list; - VariableItem* item; - uint8_t value_index; - - Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN); - DolphinStats stats = dolphin_stats(dolphin); - furi_record_close(RECORD_DOLPHIN); - app->dolphin_level = stats.level; - - Storage* storage = furi_record_open(RECORD_STORAGE); - FlipperFormat* subghz_range = flipper_format_file_alloc(storage); - app->subghz_extend = false; - app->subghz_bypass = false; - if(flipper_format_file_open_existing(subghz_range, "/ext/subghz/assets/extend_range.txt")) { - flipper_format_read_bool( - subghz_range, "use_ext_range_at_own_risk", &app->subghz_extend, 1); - flipper_format_read_bool(subghz_range, "ignore_default_tx_region", &app->subghz_bypass, 1); - } - flipper_format_free(subghz_range); - - uint current_pack = 0; - asset_packs_init(app->asset_packs); - File* folder = storage_file_alloc(storage); - FileInfo info; - char* name = malloc(MAX_PACK_NAME_LEN); - if(storage_dir_open(folder, PACKS_DIR)) { - while(storage_dir_read(folder, &info, name, MAX_PACK_NAME_LEN)) { - if(info.flags & FSF_DIRECTORY) { - char* copy = malloc(MAX_PACK_NAME_LEN); - strlcpy(copy, name, MAX_PACK_NAME_LEN); - uint idx = 0; - if(strcmp(copy, "NSFW") != 0) { - for(; idx < asset_packs_size(app->asset_packs); idx++) { - char* comp = *asset_packs_get(app->asset_packs, idx); - if(strcasecmp(copy, comp) < 0 && strcmp(comp, "NSFW") != 0) { - break; - } - } - } - asset_packs_push_at(app->asset_packs, idx, copy); - if(current_pack != 0) { - if(idx < current_pack) current_pack++; - } else { - if(strcmp(copy, xtreme_settings->asset_pack) == 0) current_pack = idx + 1; - } - } - } - } - free(name); - storage_file_free(folder); - furi_record_close(RECORD_STORAGE); - - item = variable_item_list_add( - var_item_list, - "Asset Pack", - asset_packs_size(app->asset_packs) + 1, - xtreme_app_scene_main_asset_pack_changed, - app); - variable_item_set_current_value_index(item, current_pack); - variable_item_set_current_value_text( - item, current_pack == 0 ? "SFW" : *asset_packs_get(app->asset_packs, current_pack - 1)); - - item = variable_item_list_add( - var_item_list, - "Anim Speed", - COUNT_OF(anim_speed_names), - xtreme_app_scene_main_anim_speed_changed, - app); - value_index = value_index_int32( - xtreme_settings->anim_speed, anim_speed_values, COUNT_OF(anim_speed_names)); - variable_item_set_current_value_index(item, value_index); - variable_item_set_current_value_text(item, anim_speed_names[value_index]); - - item = variable_item_list_add( - var_item_list, - "Cycle Anims", - COUNT_OF(cycle_anims_names), - xtreme_app_scene_main_cycle_anims_changed, - app); - value_index = value_index_int32( - xtreme_settings->cycle_anims, cycle_anims_values, COUNT_OF(cycle_anims_names)); - variable_item_set_current_value_index(item, value_index); - variable_item_set_current_value_text(item, cycle_anims_names[value_index]); - - item = variable_item_list_add( - var_item_list, "Unlock Anims", 2, xtreme_app_scene_main_unlock_anims_changed, app); - variable_item_set_current_value_index(item, xtreme_settings->unlock_anims); - variable_item_set_current_value_text(item, xtreme_settings->unlock_anims ? "ON" : "OFF"); - - - variable_item_list_add(var_item_list, " = Status Bar =", 0, NULL, app); - - item = variable_item_list_add( - var_item_list, - "Battery Icon", - BatteryIconCount, - xtreme_app_scene_main_battery_icon_changed, - app); - value_index = (xtreme_settings->battery_icon + BatteryIconCount - 1) % BatteryIconCount; - variable_item_set_current_value_index(item, value_index); - variable_item_set_current_value_text(item, battery_icon_names[value_index]); - - item = variable_item_list_add( - var_item_list, "Status Icons", 2, xtreme_app_scene_main_status_icons_changed, app); - variable_item_set_current_value_index(item, xtreme_settings->status_icons); - variable_item_set_current_value_text(item, xtreme_settings->status_icons ? "ON" : "OFF"); - - item = variable_item_list_add( - var_item_list, "Bar Borders", 2, xtreme_app_scene_main_bar_borders_changed, app); - variable_item_set_current_value_index(item, xtreme_settings->bar_borders); - variable_item_set_current_value_text(item, xtreme_settings->bar_borders ? "ON" : "OFF"); - - item = variable_item_list_add( - var_item_list, "Bar Background", 2, xtreme_app_scene_main_bar_background_changed, app); - variable_item_set_current_value_index(item, xtreme_settings->bar_background); - variable_item_set_current_value_text(item, xtreme_settings->bar_background ? "ON" : "OFF"); - - - variable_item_list_add(var_item_list, " = Protocols =", 0, NULL, app); - - item = variable_item_list_add( - var_item_list, "Bad KB Mode", 2, xtreme_app_scene_main_bad_bk_mode_changed, app); - variable_item_set_current_value_index(item, xtreme_settings->bad_bt); - variable_item_set_current_value_text(item, xtreme_settings->bad_bt ? "BT" : "USB"); - - item = variable_item_list_add( - var_item_list, "SubGHz Extend", 2, xtreme_app_scene_main_subghz_extend_changed, app); - variable_item_set_current_value_index(item, app->subghz_extend); - variable_item_set_current_value_text(item, app->subghz_extend ? "ON" : "OFF"); - - item = variable_item_list_add( - var_item_list, "SubGHz Bypass", 2, xtreme_app_scene_main_subghz_bypass_changed, app); - variable_item_set_current_value_index(item, app->subghz_bypass); - variable_item_set_current_value_text(item, app->subghz_bypass ? "ON" : "OFF"); - - - variable_item_list_add(var_item_list, " = Misc =", 0, NULL, app); - - item = variable_item_list_add( - var_item_list, - "Sort Dirs First", - 2, - xtreme_app_scene_main_sort_folders_before_changed, - app); - variable_item_set_current_value_index(item, !xtreme_settings->sort_ignore_dirs); - variable_item_set_current_value_text(item, !xtreme_settings->sort_ignore_dirs ? "ON" : "OFF"); - - char level_str[4]; - snprintf(level_str, 4, "%i", app->dolphin_level); - item = variable_item_list_add( - var_item_list, - "XP Level", - DOLPHIN_LEVEL_COUNT + 1, - xtreme_app_scene_main_xp_level_changed, - app); - variable_item_set_current_value_index(item, app->dolphin_level - 1); - variable_item_set_current_value_text(item, level_str); - - FuriString* version_tag = furi_string_alloc_printf( - "%s %s", version_get_gitbranchnum(NULL), version_get_builddate(NULL)); - variable_item_list_add(var_item_list, furi_string_get_cstr(version_tag), 0, NULL, app); - - view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewVarItemList); -} - -bool xtreme_app_scene_main_on_event(void* context, SceneManagerEvent event) { - UNUSED(context); - UNUSED(event); - bool consumed = false; - return consumed; -} - -void xtreme_app_scene_main_on_exit(void* context) { - XtremeApp* app = context; - asset_packs_it_t it; - for(asset_packs_it(it, app->asset_packs); !asset_packs_end_p(it); asset_packs_next(it)) { - free(*asset_packs_cref(it)); - } - asset_packs_clear(app->asset_packs); - variable_item_list_reset(app->var_item_list); -} diff --git a/applications/settings/xtreme_app/scenes/xtreme_app_scene_misc.c b/applications/settings/xtreme_app/scenes/xtreme_app_scene_misc.c new file mode 100644 index 000000000..13a703879 --- /dev/null +++ b/applications/settings/xtreme_app/scenes/xtreme_app_scene_misc.c @@ -0,0 +1,41 @@ +#include "../xtreme_app.h" + +static void xtreme_app_scene_misc_sort_folders_before_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + bool value = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, value ? "ON" : "OFF"); + XTREME_SETTINGS()->sort_dirs_first = value; + app->save_settings = true; +} + +void xtreme_app_scene_misc_on_enter(void* context) { + XtremeApp* app = context; + XtremeSettings* xtreme_settings = XTREME_SETTINGS(); + VariableItemList* var_item_list = app->var_item_list; + VariableItem* item; + + item = variable_item_list_add( + var_item_list, + "Sort Dirs First", + 2, + xtreme_app_scene_misc_sort_folders_before_changed, + app); + variable_item_set_current_value_index(item, xtreme_settings->sort_dirs_first); + variable_item_set_current_value_text(item, xtreme_settings->sort_dirs_first ? "ON" : "OFF"); + + variable_item_list_set_selected_item(var_item_list, 0); + + view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewVarItemList); +} + +bool xtreme_app_scene_misc_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); + bool consumed = false; + return consumed; +} + +void xtreme_app_scene_misc_on_exit(void* context) { + XtremeApp* app = context; + variable_item_list_reset(app->var_item_list); +} diff --git a/applications/settings/xtreme_app/scenes/xtreme_app_scene_protocols.c b/applications/settings/xtreme_app/scenes/xtreme_app_scene_protocols.c new file mode 100644 index 000000000..0350785e7 --- /dev/null +++ b/applications/settings/xtreme_app/scenes/xtreme_app_scene_protocols.c @@ -0,0 +1,61 @@ +#include "../xtreme_app.h" + +static void xtreme_app_scene_protocols_bad_bk_mode_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + bool value = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, value ? "BT" : "USB"); + XTREME_SETTINGS()->bad_bt = value; + app->save_settings = true; +} + +static void xtreme_app_scene_protocols_subghz_extend_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + app->subghz_extend = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, app->subghz_extend ? "ON" : "OFF"); + app->save_subghz = true; +} + +static void xtreme_app_scene_protocols_subghz_bypass_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + app->subghz_bypass = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, app->subghz_bypass ? "ON" : "OFF"); + app->save_subghz = true; +} + +void xtreme_app_scene_protocols_on_enter(void* context) { + XtremeApp* app = context; + XtremeSettings* xtreme_settings = XTREME_SETTINGS(); + VariableItemList* var_item_list = app->var_item_list; + VariableItem* item; + + item = variable_item_list_add( + var_item_list, "Bad KB Mode", 2, xtreme_app_scene_protocols_bad_bk_mode_changed, app); + variable_item_set_current_value_index(item, xtreme_settings->bad_bt); + variable_item_set_current_value_text(item, xtreme_settings->bad_bt ? "BT" : "USB"); + + item = variable_item_list_add( + var_item_list, "SubGHz Extend", 2, xtreme_app_scene_protocols_subghz_extend_changed, app); + variable_item_set_current_value_index(item, app->subghz_extend); + variable_item_set_current_value_text(item, app->subghz_extend ? "ON" : "OFF"); + + item = variable_item_list_add( + var_item_list, "SubGHz Bypass", 2, xtreme_app_scene_protocols_subghz_bypass_changed, app); + variable_item_set_current_value_index(item, app->subghz_bypass); + variable_item_set_current_value_text(item, app->subghz_bypass ? "ON" : "OFF"); + + variable_item_list_set_selected_item(var_item_list, 0); + + view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewVarItemList); +} + +bool xtreme_app_scene_protocols_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); + bool consumed = false; + return consumed; +} + +void xtreme_app_scene_protocols_on_exit(void* context) { + XtremeApp* app = context; + variable_item_list_reset(app->var_item_list); +} diff --git a/applications/settings/xtreme_app/scenes/xtreme_app_scene_start.c b/applications/settings/xtreme_app/scenes/xtreme_app_scene_start.c new file mode 100644 index 000000000..e39ce00c8 --- /dev/null +++ b/applications/settings/xtreme_app/scenes/xtreme_app_scene_start.c @@ -0,0 +1,69 @@ +#include "../xtreme_app.h" + +enum VarItemListIndex { + VarItemListIndexGraphics, + VarItemListIndexStatusbar, + VarItemListIndexProtocols, + VarItemListIndexDolphin, + VarItemListIndexMisc, +}; + +void xtreme_app_scene_start_var_item_list_callback(void* context, uint32_t index) { + XtremeApp* app = context; + view_dispatcher_send_custom_event(app->view_dispatcher, index); +} + +void xtreme_app_scene_start_on_enter(void* context) { + XtremeApp* app = context; + VariableItemList* var_item_list = app->var_item_list; + + variable_item_list_add(var_item_list, "Graphics", 0, NULL, app); + variable_item_list_add(var_item_list, "Statusbar", 0, NULL, app); + variable_item_list_add(var_item_list, "Protocols", 0, NULL, app); + variable_item_list_add(var_item_list, "Dolphin", 0, NULL, app); + variable_item_list_add(var_item_list, "Misc", 0, NULL, app); + + variable_item_list_add(var_item_list, furi_string_get_cstr(app->version_tag), 0, NULL, app); + + variable_item_list_set_enter_callback(var_item_list, xtreme_app_scene_start_var_item_list_callback, app); + + variable_item_list_set_selected_item(var_item_list, scene_manager_get_scene_state(app->scene_manager, XtremeAppSceneStart)); + + view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewVarItemList); +} + +bool xtreme_app_scene_start_on_event(void* context, SceneManagerEvent event) { + XtremeApp* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + scene_manager_set_scene_state(app->scene_manager, XtremeAppSceneStart, event.event); + consumed = true; + switch(event.event) { + case VarItemListIndexGraphics: + scene_manager_next_scene(app->scene_manager, XtremeAppSceneGraphics); + break; + case VarItemListIndexStatusbar: + scene_manager_next_scene(app->scene_manager, XtremeAppSceneStatusbar); + break; + case VarItemListIndexProtocols: + scene_manager_next_scene(app->scene_manager, XtremeAppSceneProtocols); + break; + case VarItemListIndexDolphin: + scene_manager_next_scene(app->scene_manager, XtremeAppSceneDolphin); + break; + case VarItemListIndexMisc: + scene_manager_next_scene(app->scene_manager, XtremeAppSceneMisc); + break; + default: + break; + } + } + + return consumed; +} + +void xtreme_app_scene_start_on_exit(void* context) { + XtremeApp* app = context; + variable_item_list_reset(app->var_item_list); +} diff --git a/applications/settings/xtreme_app/scenes/xtreme_app_scene_statusbar.c b/applications/settings/xtreme_app/scenes/xtreme_app_scene_statusbar.c new file mode 100644 index 000000000..07f542be8 --- /dev/null +++ b/applications/settings/xtreme_app/scenes/xtreme_app_scene_statusbar.c @@ -0,0 +1,82 @@ +#include "../xtreme_app.h" + +const char* const battery_icon_names[] = + {"OFF", "Bar", "%", "Inv. %", "Retro 3", "Retro 5", "Bar %"}; +static void xtreme_app_scene_statusbar_battery_icon_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, battery_icon_names[index]); + XTREME_SETTINGS()->battery_icon = index; + app->save_settings = true; +} + +static void xtreme_app_scene_statusbar_status_icons_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + bool value = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, value ? "ON" : "OFF"); + XTREME_SETTINGS()->status_icons = value; + app->save_settings = true; +} + +static void xtreme_app_scene_statusbar_bar_borders_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + bool value = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, value ? "ON" : "OFF"); + XTREME_SETTINGS()->bar_borders = value; + app->save_settings = true; +} + +static void xtreme_app_scene_statusbar_bar_background_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + bool value = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, value ? "ON" : "OFF"); + XTREME_SETTINGS()->bar_background = value; + app->save_settings = true; +} + +void xtreme_app_scene_statusbar_on_enter(void* context) { + XtremeApp* app = context; + XtremeSettings* xtreme_settings = XTREME_SETTINGS(); + VariableItemList* var_item_list = app->var_item_list; + VariableItem* item; + + item = variable_item_list_add( + var_item_list, + "Battery Icon", + BatteryIconCount, + xtreme_app_scene_statusbar_battery_icon_changed, + app); + variable_item_set_current_value_index(item, xtreme_settings->battery_icon); + variable_item_set_current_value_text(item, battery_icon_names[xtreme_settings->battery_icon]); + + item = variable_item_list_add( + var_item_list, "Status Icons", 2, xtreme_app_scene_statusbar_status_icons_changed, app); + variable_item_set_current_value_index(item, xtreme_settings->status_icons); + variable_item_set_current_value_text(item, xtreme_settings->status_icons ? "ON" : "OFF"); + + item = variable_item_list_add( + var_item_list, "Bar Borders", 2, xtreme_app_scene_statusbar_bar_borders_changed, app); + variable_item_set_current_value_index(item, xtreme_settings->bar_borders); + variable_item_set_current_value_text(item, xtreme_settings->bar_borders ? "ON" : "OFF"); + + item = variable_item_list_add( + var_item_list, "Bar Background", 2, xtreme_app_scene_statusbar_bar_background_changed, app); + variable_item_set_current_value_index(item, xtreme_settings->bar_background); + variable_item_set_current_value_text(item, xtreme_settings->bar_background ? "ON" : "OFF"); + + variable_item_list_set_selected_item(var_item_list, 0); + + view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewVarItemList); +} + +bool xtreme_app_scene_statusbar_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); + bool consumed = false; + return consumed; +} + +void xtreme_app_scene_statusbar_on_exit(void* context) { + XtremeApp* app = context; + variable_item_list_reset(app->var_item_list); +} diff --git a/applications/settings/xtreme_app/xtreme_app.c b/applications/settings/xtreme_app/xtreme_app.c index c6d67b915..a10485855 100644 --- a/applications/settings/xtreme_app/xtreme_app.c +++ b/applications/settings/xtreme_app/xtreme_app.c @@ -15,36 +15,37 @@ static bool xtreme_app_back_event_callback(void* context) { furi_assert(context); XtremeApp* app = context; - if(app->level_changed) { - Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN); - DolphinStats stats = dolphin_stats(dolphin); - if(app->dolphin_level != stats.level) { + if(!scene_manager_has_previous_scene(app->scene_manager, XtremeAppSceneStart)) { + + if(app->save_level) { + Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN); int xp = app->dolphin_level > 1 ? dolphin_get_levels()[app->dolphin_level - 2] : 0; dolphin->state->data.icounter = xp + 1; dolphin->state->dirty = true; dolphin_state_save(dolphin->state); + furi_record_close(RECORD_DOLPHIN); } - furi_record_close(RECORD_DOLPHIN); - } - if(app->subghz_changed) { - Storage* storage = furi_record_open(RECORD_STORAGE); - FlipperFormat* subghz_range = flipper_format_file_alloc(storage); - if(flipper_format_file_open_existing(subghz_range, "/ext/subghz/assets/extend_range.txt")) { - flipper_format_insert_or_update_bool( - subghz_range, "use_ext_range_at_own_risk", &app->subghz_extend, 1); - flipper_format_insert_or_update_bool( - subghz_range, "ignore_default_tx_region", &app->subghz_bypass, 1); + if(app->save_subghz) { + Storage* storage = furi_record_open(RECORD_STORAGE); + FlipperFormat* subghz_range = flipper_format_file_alloc(storage); + if(flipper_format_file_open_existing(subghz_range, "/ext/subghz/assets/extend_range.txt")) { + flipper_format_insert_or_update_bool( + subghz_range, "use_ext_range_at_own_risk", &app->subghz_extend, 1); + flipper_format_insert_or_update_bool( + subghz_range, "ignore_default_tx_region", &app->subghz_bypass, 1); + } + flipper_format_free(subghz_range); + furi_record_close(RECORD_STORAGE); } - flipper_format_free(subghz_range); - furi_record_close(RECORD_STORAGE); - } - if(app->settings_changed) { - XTREME_SETTINGS_SAVE(); - if(app->assets_changed) { + if(app->save_settings) { + XTREME_SETTINGS_SAVE(); + } + + if(app->require_reboot) { popup_set_header(app->popup, "Rebooting...", 64, 26, AlignCenter, AlignCenter); - popup_set_text(app->popup, "Swapping assets...", 64, 40, AlignCenter, AlignCenter); + popup_set_text(app->popup, "Applying changes...", 64, 40, AlignCenter, AlignCenter); popup_set_callback(app->popup, xtreme_app_reboot); popup_set_context(app->popup, app); popup_set_timeout(app->popup, 1000); @@ -52,6 +53,7 @@ static bool xtreme_app_back_event_callback(void* context) { view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewPopup); return true; } + } return scene_manager_handle_back_event(app->scene_manager); @@ -84,6 +86,59 @@ XtremeApp* xtreme_app_alloc() { app->popup = popup_alloc(); view_dispatcher_add_view(app->view_dispatcher, XtremeAppViewPopup, popup_get_view(app->popup)); + // Settings init + + XtremeSettings* xtreme_settings = XTREME_SETTINGS(); + + Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN); + DolphinStats stats = dolphin_stats(dolphin); + app->dolphin_level = stats.level; + furi_record_close(RECORD_DOLPHIN); + + Storage* storage = furi_record_open(RECORD_STORAGE); + FlipperFormat* subghz_range = flipper_format_file_alloc(storage); + app->subghz_extend = false; + app->subghz_bypass = false; + if(flipper_format_file_open_existing(subghz_range, "/ext/subghz/assets/extend_range.txt")) { + flipper_format_read_bool(subghz_range, "use_ext_range_at_own_risk", &app->subghz_extend, 1); + flipper_format_read_bool(subghz_range, "ignore_default_tx_region", &app->subghz_bypass, 1); + } + flipper_format_free(subghz_range); + + app->asset_pack = 0; + asset_packs_init(app->asset_packs); + File* folder = storage_file_alloc(storage); + FileInfo info; + char* name = malloc(MAX_PACK_NAME_LEN); + if(storage_dir_open(folder, PACKS_DIR)) { + while(storage_dir_read(folder, &info, name, MAX_PACK_NAME_LEN)) { + if(info.flags & FSF_DIRECTORY) { + char* copy = malloc(MAX_PACK_NAME_LEN); + strlcpy(copy, name, MAX_PACK_NAME_LEN); + uint idx = 0; + if(strcmp(copy, "NSFW") != 0) { + for(; idx < asset_packs_size(app->asset_packs); idx++) { + char* comp = *asset_packs_get(app->asset_packs, idx); + if(strcasecmp(copy, comp) < 0 && strcmp(comp, "NSFW") != 0) { + break; + } + } + } + asset_packs_push_at(app->asset_packs, idx, copy); + if(app->asset_pack != 0) { + if(idx < app->asset_pack) app->asset_pack++; + } else { + if(strcmp(copy, xtreme_settings->asset_pack) == 0) app->asset_pack = idx + 1; + } + } + } + } + free(name); + storage_file_free(folder); + furi_record_close(RECORD_STORAGE); + + app->version_tag = furi_string_alloc_printf("%s %s", version_get_gitbranchnum(NULL), version_get_builddate(NULL)); + return app; } @@ -100,6 +155,16 @@ void xtreme_app_free(XtremeApp* app) { view_dispatcher_free(app->view_dispatcher); scene_manager_free(app->scene_manager); + // Settings deinit + + asset_packs_it_t it; + for(asset_packs_it(it, app->asset_packs); !asset_packs_end_p(it); asset_packs_next(it)) { + free(*asset_packs_cref(it)); + } + asset_packs_clear(app->asset_packs); + + furi_string_free(app->version_tag); + // Records furi_record_close(RECORD_GUI); free(app); @@ -108,7 +173,7 @@ void xtreme_app_free(XtremeApp* app) { extern int32_t xtreme_app(void* p) { UNUSED(p); XtremeApp* app = xtreme_app_alloc(); - scene_manager_next_scene(app->scene_manager, XtremeAppSceneMain); + scene_manager_next_scene(app->scene_manager, XtremeAppSceneStart); view_dispatcher_run(app->view_dispatcher); xtreme_app_free(app); return 0; diff --git a/applications/settings/xtreme_app/xtreme_app.h b/applications/settings/xtreme_app/xtreme_app.h index 23adbf5ac..7f2d1a5bc 100644 --- a/applications/settings/xtreme_app/xtreme_app.h +++ b/applications/settings/xtreme_app/xtreme_app.h @@ -8,6 +8,7 @@ #include #include #include +#include #include "scenes/xtreme_app_scene.h" #include "dolphin/helpers/dolphin_state.h" #include "dolphin/dolphin.h" @@ -28,11 +29,13 @@ typedef struct { int dolphin_level; bool subghz_extend; bool subghz_bypass; - bool settings_changed; - bool assets_changed; - bool subghz_changed; - bool level_changed; + bool save_settings; + bool require_reboot; + bool save_subghz; + bool save_level; + uint asset_pack; asset_packs_t asset_packs; + FuriString* version_tag; } XtremeApp; typedef enum { diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_0.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_0.png deleted file mode 100644 index 909cc3303..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_0.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_1.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_1.png deleted file mode 100644 index fdc1805d1..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_1.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_10.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_10.png deleted file mode 100644 index 3a43c6b84..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_10.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_11.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_11.png deleted file mode 100644 index 20ea12eb0..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_11.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_12.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_12.png deleted file mode 100644 index a05abd80f..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_12.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_2.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_2.png deleted file mode 100644 index fc7e0364a..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_2.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_3.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_3.png deleted file mode 100644 index 06f08ae67..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_3.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_4.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_4.png deleted file mode 100644 index bcc7f28a9..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_4.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_5.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_5.png deleted file mode 100644 index 7d945dd06..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_5.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_6.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_6.png deleted file mode 100644 index c0b1a4fe2..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_6.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_7.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_7.png deleted file mode 100644 index 19c8181d0..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_7.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_8.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_8.png deleted file mode 100644 index c0b316950..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_8.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_9.png b/assets/dolphin/external/L1_Happy_holidays_128x64/frame_9.png deleted file mode 100644 index 929a207ef..000000000 Binary files a/assets/dolphin/external/L1_Happy_holidays_128x64/frame_9.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Happy_holidays_128x64/meta.txt b/assets/dolphin/external/L1_Happy_holidays_128x64/meta.txt deleted file mode 100644 index ad883525e..000000000 --- a/assets/dolphin/external/L1_Happy_holidays_128x64/meta.txt +++ /dev/null @@ -1,23 +0,0 @@ -Filetype: Flipper Animation -Version: 1 - -Width: 128 -Height: 64 -Passive frames: 10 -Active frames: 18 -Frames order: 0 1 2 1 0 1 2 1 0 1 2 3 4 5 6 5 4 7 2 8 9 10 11 10 9 10 11 12 -Active cycles: 1 -Frame rate: 2 -Duration: 360 -Active cooldown: 7 - -Bubble slots: 1 - -Slot: 0 -X: 11 -Y: 19 -Text: HAPPY\nHOLIDAYS! -AlignH: Right -AlignV: Center -StartFrame: 22 -EndFrame: 27 diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_0.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_0.png deleted file mode 100644 index 340ceb47f..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_0.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_1.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_1.png deleted file mode 100644 index f401d60a8..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_1.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_10.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_10.png deleted file mode 100644 index 890ea5d70..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_10.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_11.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_11.png deleted file mode 100644 index 0b331e4b7..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_11.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_12.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_12.png deleted file mode 100644 index 145eaa314..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_12.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_13.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_13.png deleted file mode 100644 index 6eda42b5d..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_13.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_14.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_14.png deleted file mode 100644 index b1eb38da5..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_14.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_15.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_15.png deleted file mode 100644 index 554a177a9..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_15.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_16.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_16.png deleted file mode 100644 index ad032f411..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_16.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_17.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_17.png deleted file mode 100644 index 971e8f55b..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_17.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_18.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_18.png deleted file mode 100644 index 4026dc373..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_18.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_19.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_19.png deleted file mode 100644 index b8cfa50ce..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_19.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_2.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_2.png deleted file mode 100644 index 0c380ca41..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_2.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_20.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_20.png deleted file mode 100644 index 59ec9627c..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_20.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_21.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_21.png deleted file mode 100644 index d0e44937c..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_21.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_22.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_22.png deleted file mode 100644 index fd800b8b9..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_22.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_23.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_23.png deleted file mode 100644 index 41615b613..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_23.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_24.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_24.png deleted file mode 100644 index 05c5e969d..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_24.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_25.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_25.png deleted file mode 100644 index 79fa45753..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_25.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_26.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_26.png deleted file mode 100644 index edb038666..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_26.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_27.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_27.png deleted file mode 100644 index 7696f9ce8..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_27.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_28.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_28.png deleted file mode 100644 index 052ff2848..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_28.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_29.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_29.png deleted file mode 100644 index c6caf88d9..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_29.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_3.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_3.png deleted file mode 100644 index c69ac8012..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_3.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_30.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_30.png deleted file mode 100644 index 8710e1a0a..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_30.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_31.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_31.png deleted file mode 100644 index 7abad6b33..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_31.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_32.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_32.png deleted file mode 100644 index 0a0882a9d..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_32.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_33.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_33.png deleted file mode 100644 index 94b79d2ed..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_33.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_34.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_34.png deleted file mode 100644 index ce0e210f4..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_34.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_35.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_35.png deleted file mode 100644 index aba999f6d..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_35.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_36.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_36.png deleted file mode 100644 index 1aac85583..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_36.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_4.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_4.png deleted file mode 100644 index ef5e2fc53..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_4.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_5.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_5.png deleted file mode 100644 index 44d566b15..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_5.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_6.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_6.png deleted file mode 100644 index 789eebdfa..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_6.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_7.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_7.png deleted file mode 100644 index cc4f5cbff..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_7.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_8.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_8.png deleted file mode 100644 index 1a1fe5d2d..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_8.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_9.png b/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_9.png deleted file mode 100644 index a19da7382..000000000 Binary files a/assets/dolphin/external/L1_Sleigh_ride_128x64/frame_9.png and /dev/null differ diff --git a/assets/dolphin/external/L1_Sleigh_ride_128x64/meta.txt b/assets/dolphin/external/L1_Sleigh_ride_128x64/meta.txt deleted file mode 100644 index eed81079d..000000000 --- a/assets/dolphin/external/L1_Sleigh_ride_128x64/meta.txt +++ /dev/null @@ -1,23 +0,0 @@ -Filetype: Flipper Animation -Version: 1 - -Width: 128 -Height: 64 -Passive frames: 18 -Active frames: 19 -Frames order: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 -Active cycles: 1 -Frame rate: 2 -Duration: 360 -Active cooldown: 7 - -Bubble slots: 1 - -Slot: 0 -X: 21 -Y: 25 -Text: AAAAaAAAAHHh!! -AlignH: Right -AlignV: Bottom -StartFrame: 30 -EndFrame: 32 diff --git a/assets/dolphin/external/manifest.txt b/assets/dolphin/external/manifest.txt index fbc438c00..bd344074d 100644 --- a/assets/dolphin/external/manifest.txt +++ b/assets/dolphin/external/manifest.txt @@ -15,13 +15,6 @@ Min level: 2 Max level: 30 Weight: 3 -Name: L1_Sleigh_ride_128x64 -Min butthurt: 0 -Max butthurt: 14 -Min level: 4 -Max level: 30 -Weight: 4 - Name: L1_Sleep_128x64 Min butthurt: 0 Max butthurt: 10 @@ -36,13 +29,6 @@ Min level: 7 Max level: 30 Weight: 3 -Name: L1_Happy_holidays_128x64 -Min butthurt: 0 -Max butthurt: 14 -Min level: 8 -Max level: 30 -Weight: 4 - Name: L1_Furippa1_128x64 Min butthurt: 0 Max butthurt: 6 @@ -53,7 +39,7 @@ Weight: 3 Name: L1_Read_books_128x64 Min butthurt: 0 Max butthurt: 8 -Min level: 11 +Min level: 8 Max level: 30 Weight: 3 @@ -67,21 +53,21 @@ Weight: 3 Name: L1_Boxing_128x64 Min butthurt: 10 Max butthurt: 13 -Min level: 14 +Min level: 3 Max level: 30 Weight: 3 Name: L1_Mad_fist_128x64 Min butthurt: 9 Max butthurt: 13 -Min level: 15 +Min level: 4 Max level: 30 Weight: 3 Name: L1_Mods_128x64 Min butthurt: 0 Max butthurt: 9 -Min level: 17 +Min level: 15 Max level: 30 Weight: 4 @@ -92,13 +78,6 @@ Min level: 18 Max level: 30 Weight: 3 -Name: L2_Furippa2_128x64 -Min butthurt: 0 -Max butthurt: 6 -Min level: 20 -Max level: 30 -Weight: 3 - Name: L1_Leaving_sad_128x64 Min butthurt: 14 Max butthurt: 14 @@ -113,6 +92,13 @@ Min level: 22 Max level: 30 Weight: 4 +Name: L2_Furippa2_128x64 +Min butthurt: 0 +Max butthurt: 6 +Min level: 20 +Max level: 30 +Weight: 3 + Name: L2_Hacking_pc_128x64 Min butthurt: 0 Max butthurt: 8 @@ -127,10 +113,10 @@ Min level: 25 Max level: 30 Weight: 3 -Name: L3_Lab_research_128x54 +Name: L3_Furippa3_128x64 Min butthurt: 0 -Max butthurt: 10 -Min level: 27 +Max butthurt: 6 +Min level: 30 Max level: 30 Weight: 3 @@ -141,9 +127,9 @@ Min level: 28 Max level: 30 Weight: 3 -Name: L3_Furippa3_128x64 +Name: L3_Lab_research_128x54 Min butthurt: 0 -Max butthurt: 6 -Min level: 30 +Max butthurt: 10 +Min level: 27 Max level: 30 Weight: 3 diff --git a/assets/resources/dolphin/manifest.txt b/assets/resources/dolphin/manifest.txt index fbc438c00..bd344074d 100644 --- a/assets/resources/dolphin/manifest.txt +++ b/assets/resources/dolphin/manifest.txt @@ -15,13 +15,6 @@ Min level: 2 Max level: 30 Weight: 3 -Name: L1_Sleigh_ride_128x64 -Min butthurt: 0 -Max butthurt: 14 -Min level: 4 -Max level: 30 -Weight: 4 - Name: L1_Sleep_128x64 Min butthurt: 0 Max butthurt: 10 @@ -36,13 +29,6 @@ Min level: 7 Max level: 30 Weight: 3 -Name: L1_Happy_holidays_128x64 -Min butthurt: 0 -Max butthurt: 14 -Min level: 8 -Max level: 30 -Weight: 4 - Name: L1_Furippa1_128x64 Min butthurt: 0 Max butthurt: 6 @@ -53,7 +39,7 @@ Weight: 3 Name: L1_Read_books_128x64 Min butthurt: 0 Max butthurt: 8 -Min level: 11 +Min level: 8 Max level: 30 Weight: 3 @@ -67,21 +53,21 @@ Weight: 3 Name: L1_Boxing_128x64 Min butthurt: 10 Max butthurt: 13 -Min level: 14 +Min level: 3 Max level: 30 Weight: 3 Name: L1_Mad_fist_128x64 Min butthurt: 9 Max butthurt: 13 -Min level: 15 +Min level: 4 Max level: 30 Weight: 3 Name: L1_Mods_128x64 Min butthurt: 0 Max butthurt: 9 -Min level: 17 +Min level: 15 Max level: 30 Weight: 4 @@ -92,13 +78,6 @@ Min level: 18 Max level: 30 Weight: 3 -Name: L2_Furippa2_128x64 -Min butthurt: 0 -Max butthurt: 6 -Min level: 20 -Max level: 30 -Weight: 3 - Name: L1_Leaving_sad_128x64 Min butthurt: 14 Max butthurt: 14 @@ -113,6 +92,13 @@ Min level: 22 Max level: 30 Weight: 4 +Name: L2_Furippa2_128x64 +Min butthurt: 0 +Max butthurt: 6 +Min level: 20 +Max level: 30 +Weight: 3 + Name: L2_Hacking_pc_128x64 Min butthurt: 0 Max butthurt: 8 @@ -127,10 +113,10 @@ Min level: 25 Max level: 30 Weight: 3 -Name: L3_Lab_research_128x54 +Name: L3_Furippa3_128x64 Min butthurt: 0 -Max butthurt: 10 -Min level: 27 +Max butthurt: 6 +Min level: 30 Max level: 30 Weight: 3 @@ -141,9 +127,9 @@ Min level: 28 Max level: 30 Weight: 3 -Name: L3_Furippa3_128x64 +Name: L3_Lab_research_128x54 Min butthurt: 0 -Max butthurt: 6 -Min level: 30 +Max butthurt: 10 +Min level: 27 Max level: 30 Weight: 3 diff --git a/assets/slideshow/first_start/frame_02.png b/assets/slideshow/first_start/frame_02.png index dc1080aba..adff6af66 100644 Binary files a/assets/slideshow/first_start/frame_02.png and b/assets/slideshow/first_start/frame_02.png differ diff --git a/fbt b/fbt index e576f37ac..f80e802b6 100755 --- a/fbt +++ b/fbt @@ -6,16 +6,21 @@ set -eu; # private variables SCRIPT_PATH="$(cd "$(dirname "$0")" && pwd -P)"; -SCONS_DEFAULT_FLAGS="-Q --warn=target-not-built"; -SCONS_EP="python3 -m SCons" +SCONS_DEFAULT_FLAGS="--warn=target-not-built"; +SCONS_EP="python3 -m SCons"; # public variables FBT_NOENV="${FBT_NOENV:-""}"; FBT_NO_SYNC="${FBT_NO_SYNC:-""}"; FBT_TOOLCHAIN_PATH="${FBT_TOOLCHAIN_PATH:-$SCRIPT_PATH}"; +FBT_VERBOSE="${FBT_VERBOSE:-""}"; if [ -z "$FBT_NOENV" ]; then - . "$SCRIPT_PATH/scripts/toolchain/fbtenv.sh"; + FBT_VERBOSE="$FBT_VERBOSE" . "$SCRIPT_PATH/scripts/toolchain/fbtenv.sh"; +fi + +if [ -z "$FBT_VERBOSE" ]; then + SCONS_DEFAULT_FLAGS="$SCONS_DEFAULT_FLAGS -Q"; fi if [ -z "$FBT_NO_SYNC" ]; then diff --git a/fbt.cmd b/fbt.cmd index 197f2359c..92c734860 100644 --- a/fbt.cmd +++ b/fbt.cmd @@ -12,5 +12,10 @@ if [%FBT_NO_SYNC%] == [] ( ) ) -set "SCONS_DEFAULT_FLAGS=-Q --warn=target-not-built" +set "SCONS_DEFAULT_FLAGS=--warn=target-not-built" + +if not defined FBT_VERBOSE ( + set "SCONS_DEFAULT_FLAGS=%SCONS_DEFAULT_FLAGS% -Q" +) + %SCONS_EP% %SCONS_DEFAULT_FLAGS% %* diff --git a/scripts/flipper/assets/dolphin.py b/scripts/flipper/assets/dolphin.py index 45ed3e19f..1863cd2bb 100644 --- a/scripts/flipper/assets/dolphin.py +++ b/scripts/flipper/assets/dolphin.py @@ -23,7 +23,6 @@ def _convert_image(source_filename: str): class DolphinBubbleAnimation: - FILE_TYPE = "Flipper Animation" FILE_VERSION = 1 @@ -251,7 +250,6 @@ class DolphinBubbleAnimation: class DolphinManifest: - FILE_TYPE = "Flipper Animation Manifest" FILE_VERSION = 1 diff --git a/scripts/flipper/utils/cdc.py b/scripts/flipper/utils/cdc.py index 7047db2a6..7c7351670 100644 --- a/scripts/flipper/utils/cdc.py +++ b/scripts/flipper/utils/cdc.py @@ -1,5 +1,6 @@ import serial.tools.list_ports as list_ports + # Returns a valid port or None, if it cannot be found def resolve_port(logger, portname: str = "auto"): if portname != "auto": diff --git a/scripts/flipper/utils/templite.py b/scripts/flipper/utils/templite.py index 8af57d7f8..2d958bd77 100644 --- a/scripts/flipper/utils/templite.py +++ b/scripts/flipper/utils/templite.py @@ -173,12 +173,14 @@ class Templite: """Renders the template according to the given namespace.""" stack = [] namespace["__file__"] = self.file + # add write method def write(*args): for value in args: stack.append(str(value)) namespace["write"] = write + # add include method def include(file): if not os.path.isabs(file): diff --git a/scripts/toolchain/fbtenv.cmd b/scripts/toolchain/fbtenv.cmd index 9fbd8fd9b..dce5f37c4 100644 --- a/scripts/toolchain/fbtenv.cmd +++ b/scripts/toolchain/fbtenv.cmd @@ -31,7 +31,13 @@ if not exist "%FBT_TOOLCHAIN_VERSION_FILE%" ( set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_VERSION_FILE%" if not "%REAL_TOOLCHAIN_VERSION%" == "%FLIPPER_TOOLCHAIN_VERSION%" ( + echo FBT: starting toolchain upgrade process.. powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%" + set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_VERSION_FILE%" +) + +if defined FBT_VERBOSE ( + echo FBT: using toolchain version %REAL_TOOLCHAIN_VERSION% ) set "HOME=%USERPROFILE%" diff --git a/scripts/toolchain/fbtenv.sh b/scripts/toolchain/fbtenv.sh index 5eef5bfa8..c65d68ea4 100755 --- a/scripts/toolchain/fbtenv.sh +++ b/scripts/toolchain/fbtenv.sh @@ -7,13 +7,14 @@ DEFAULT_SCRIPT_PATH="$(pwd -P)"; SCRIPT_PATH="${SCRIPT_PATH:-$DEFAULT_SCRIPT_PATH}"; FBT_TOOLCHAIN_VERSION="${FBT_TOOLCHAIN_VERSION:-"19"}"; FBT_TOOLCHAIN_PATH="${FBT_TOOLCHAIN_PATH:-$SCRIPT_PATH}"; +FBT_VERBOSE="${FBT_VERBOSE:-""}"; fbtenv_show_usage() { echo "Running this script manually is wrong, please source it"; echo "Example:"; printf "\tsource scripts/toolchain/fbtenv.sh\n"; - echo "To restore your environment source fbtenv.sh with '--restore'." + echo "To restore your environment, source fbtenv.sh with '--restore'." echo "Example:"; printf "\tsource scripts/toolchain/fbtenv.sh --restore\n"; } @@ -35,15 +36,16 @@ fbtenv_restore_env() PATH="$(echo "$PATH" | /usr/bin/sed "s/$TOOLCHAIN_ARCH_DIR_SED\/bin://g")"; PATH="$(echo "$PATH" | /usr/bin/sed "s/$TOOLCHAIN_ARCH_DIR_SED\/protobuf\/bin://g")"; PATH="$(echo "$PATH" | /usr/bin/sed "s/$TOOLCHAIN_ARCH_DIR_SED\/openocd\/bin://g")"; + PATH="$(echo "$PATH" | /usr/bin/sed "s/$TOOLCHAIN_ARCH_DIR_SED\/openssl\/bin://g")"; if [ -n "${PS1:-""}" ]; then PS1="$(echo "$PS1" | sed 's/\[fbt\]//g')"; elif [ -n "${PROMPT:-""}" ]; then PROMPT="$(echo "$PROMPT" | sed 's/\[fbt\]//g')"; fi - PYTHONNOUSERSITE="$SAVED_PYTHONNOUSERSITE"; - PYTHONPATH="$SAVED_PYTHONPATH"; - PYTHONHOME="$SAVED_PYTHONHOME"; + export PYTHONNOUSERSITE="$SAVED_PYTHONNOUSERSITE"; + export PYTHONPATH="$SAVED_PYTHONPATH"; + export PYTHONHOME="$SAVED_PYTHONHOME"; unset SAVED_PYTHONNOUSERSITE; unset SAVED_PYTHONPATH; @@ -131,7 +133,7 @@ fbtenv_get_kernel_type() TOOLCHAIN_URL=$FBT_TOOLS_CUSTOM_LINK; fi elif echo "$SYS_TYPE" | grep -q "MINGW"; then - echo "In MinGW shell use \"[u]fbt.cmd\" instead of \"[u]fbt\""; + echo "In MinGW shell, use \"[u]fbt.cmd\" instead of \"[u]fbt\""; return 1; else echo "Your system configuration is not supported. Sorry.. Please report us your configuration."; @@ -258,6 +260,7 @@ fbtenv_check_download_toolchain() elif [ ! -f "$TOOLCHAIN_ARCH_DIR/VERSION" ]; then fbtenv_download_toolchain || return 1; elif [ "$(cat "$TOOLCHAIN_ARCH_DIR/VERSION")" -ne "$FBT_TOOLCHAIN_VERSION" ]; then + echo "FBT: starting toolchain upgrade process.." fbtenv_download_toolchain || return 1; fi return 0; @@ -279,6 +282,13 @@ fbtenv_download_toolchain() return 0; } +fbtenv_print_version() +{ + if [ -n "$FBT_VERBOSE" ]; then + echo "FBT: using toolchain version $(cat "$TOOLCHAIN_ARCH_DIR/VERSION")"; + fi +} + fbtenv_main() { fbtenv_check_sourced || return 1; @@ -291,18 +301,21 @@ fbtenv_main() fbtenv_check_script_path || return 1; fbtenv_check_download_toolchain || return 1; fbtenv_set_shell_prompt; + fbtenv_print_version; PATH="$TOOLCHAIN_ARCH_DIR/python/bin:$PATH"; PATH="$TOOLCHAIN_ARCH_DIR/bin:$PATH"; PATH="$TOOLCHAIN_ARCH_DIR/protobuf/bin:$PATH"; PATH="$TOOLCHAIN_ARCH_DIR/openocd/bin:$PATH"; + PATH="$TOOLCHAIN_ARCH_DIR/openssl/bin:$PATH"; + export PATH; - SAVED_PYTHONNOUSERSITE="${PYTHONNOUSERSITE:-""}"; - SAVED_PYTHONPATH="${PYTHONPATH:-""}"; - SAVED_PYTHONHOME="${PYTHONHOME:-""}"; + export SAVED_PYTHONNOUSERSITE="${PYTHONNOUSERSITE:-""}"; + export SAVED_PYTHONPATH="${PYTHONPATH:-""}"; + export SAVED_PYTHONHOME="${PYTHONHOME:-""}"; - PYTHONNOUSERSITE=1; - PYTHONPATH=; - PYTHONHOME=; + export PYTHONNOUSERSITE=1; + export PYTHONPATH=; + export PYTHONHOME=; } fbtenv_main "${1:-""}";