This commit is contained in:
VerstreuteSeele
2023-02-10 17:36:22 +01:00
parent 5b1fe0caa0
commit 708dd167c8
2348 changed files with 298 additions and 216 deletions

2
.gitignore vendored
View File

@@ -74,9 +74,7 @@ lib/STM32CubeWB
# Asset packs
assets/dolphin/custom/*
!assets/dolphin/custom/NSFW/
!assets/dolphin/custom/WatchDogs/
!assets/dolphin/custom/ReadMe.md
assets/resources/dolphin_custom/*
!assets/resources/dolphin_custom/NSFW/
!assets/resources/dolphin_custom/WatchDogs/

View File

@@ -457,14 +457,10 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key) {
browser->last_tab_switch_dir = key;
for(int i = 0; i < 2; i++) {
if(key == InputKeyLeft) {
tab = ((tab - 1) + ArchiveTabTotal) % ArchiveTabTotal;
} else {
tab = (tab + 1) % ArchiveTabTotal;
}
if(tab == ArchiveTabInternal && !furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) continue;
break;
if(key == InputKeyLeft) {
tab = ((tab - 1) + ArchiveTabTotal) % ArchiveTabTotal;
} else {
tab = (tab + 1) % ArchiveTabTotal;
}
browser->is_root = true;

View File

@@ -17,7 +17,6 @@ static const char* tab_default_paths[] = {
[ArchiveTabBadUsb] = ANY_PATH("badusb"),
[ArchiveTabU2f] = "/app:u2f",
[ArchiveTabApplications] = ANY_PATH("apps"),
[ArchiveTabInternal] = STORAGE_INT_PATH_PREFIX,
[ArchiveTabBrowser] = STORAGE_ANY_PATH_PREFIX,
};
@@ -45,7 +44,6 @@ static const ArchiveFileTypeEnum known_type[] = {
[ArchiveTabBadUsb] = ArchiveFileTypeBadUsb,
[ArchiveTabU2f] = ArchiveFileTypeU2f,
[ArchiveTabApplications] = ArchiveFileTypeApplication,
[ArchiveTabInternal] = ArchiveFileTypeUnknown,
[ArchiveTabBrowser] = ArchiveFileTypeUnknown,
};

View File

@@ -19,7 +19,6 @@ static const char* ArchiveTabNames[] = {
[ArchiveTabBadUsb] = "Bad USB",
[ArchiveTabU2f] = "U2F",
[ArchiveTabApplications] = "Apps",
[ArchiveTabInternal] = "Internal",
[ArchiveTabBrowser] = "Browser",
};

View File

@@ -31,7 +31,6 @@ typedef enum {
ArchiveTabBadUsb,
ArchiveTabU2f,
ArchiveTabApplications,
ArchiveTabInternal,
ArchiveTabBrowser,
ArchiveTabTotal,
} ArchiveTabEnum;

View File

@@ -1,5 +1,5 @@
#include "../bad_usb_app_i.h"
#include "../../../settings/xtreme_settings/xtreme_assets.h"
#include "../../../settings/xtreme_settings/xtreme_settings.h"
typedef enum {
BadUsbCustomEventErrorBack,
@@ -32,7 +32,7 @@ void bad_usb_scene_error_on_enter(void* context) {
app->widget, GuiButtonTypeLeft, "Back", bad_usb_scene_error_event_callback, app);
} else if(app->error == BadUsbAppErrorCloseRpc) {
widget_add_icon_element(app->widget, 78, 0, &I_ActiveConnection_50x64);
if(XTREME_ASSETS()->is_nsfw) {
if(XTREME_SETTINGS()->nsfw_mode) {
widget_add_string_multiline_element(
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "I am not\na whore!");
widget_add_string_multiline_element(

View File

@@ -3,7 +3,7 @@
#include <toolbox/path.h>
#include <gui/elements.h>
#include <assets_icons.h>
#include "../../../settings/xtreme_settings/xtreme_assets.h"
#include "../../../settings/xtreme_settings/xtreme_settings.h"
#define MAX_NAME_LEN 64
@@ -28,6 +28,7 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) {
elements_string_fit_width(canvas, disp_str, 128 - 2);
canvas_set_font(canvas, FontSecondary);
canvas_draw_str(canvas, 2, 8, furi_string_get_cstr(disp_str));
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
if(strlen(model->layout) == 0) {
furi_string_set(disp_str, "(default)");
@@ -48,7 +49,7 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) {
if((model->state.state == BadUsbStateIdle) || (model->state.state == BadUsbStateDone) ||
(model->state.state == BadUsbStateNotConnected)) {
if(XTREME_ASSETS()->is_nsfw) {
if(xtreme_settings->nsfw_mode) {
elements_button_center(canvas, "Cum");
} else {
elements_button_center(canvas, "Start");
@@ -67,7 +68,7 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) {
if(model->state.state == BadUsbStateNotConnected) {
canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18);
canvas_set_font(canvas, FontPrimary);
if(XTREME_ASSETS()->is_nsfw) {
if(xtreme_settings->nsfw_mode) {
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Plug me");
canvas_draw_str_aligned(canvas, 127, 43, AlignRight, AlignBottom, "in, Daddy");
} else {
@@ -77,7 +78,7 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) {
} else if(model->state.state == BadUsbStateWillRun) {
canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18);
canvas_set_font(canvas, FontPrimary);
if(XTREME_ASSETS()->is_nsfw) {
if(xtreme_settings->nsfw_mode) {
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Will cum");
} else {
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Will run");

View File

@@ -1,5 +1,5 @@
#include "../u2f_app_i.h"
#include "../../../settings/xtreme_settings/xtreme_assets.h"
#include "../../../settings/xtreme_settings/xtreme_settings.h"
static void u2f_scene_error_event_callback(GuiButtonType result, InputType type, void* context) {
furi_assert(context);
@@ -27,7 +27,7 @@ void u2f_scene_error_on_enter(void* context) {
app->widget, GuiButtonTypeLeft, "Back", u2f_scene_error_event_callback, app);
} else if(app->error == U2fAppErrorCloseRpc) {
widget_add_icon_element(app->widget, 78, 0, &I_ActiveConnection_50x64);
if(XTREME_ASSETS()->is_nsfw) {
if(XTREME_SETTINGS()->nsfw_mode) {
widget_add_string_multiline_element(
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "I am not\na whore!");
widget_add_string_multiline_element(

View File

@@ -21,7 +21,7 @@ static void u2f_view_draw_callback(Canvas* canvas, void* _model) {
if(model->display_msg == U2fMsgNotConnected) {
canvas_draw_icon(canvas, 22, 15, XTREME_ASSETS()->I_Connect_me_62x31);
if(XTREME_ASSETS()->is_nsfw) {
if(XTREME_SETTINGS()->nsfw_mode) {
canvas_draw_str_aligned(
canvas, 128 / 2, 3, AlignCenter, AlignTop, "Plug me in d-daddy");
} else {
@@ -32,7 +32,7 @@ static void u2f_view_draw_callback(Canvas* canvas, void* _model) {
canvas_draw_icon(canvas, 22, 15, XTREME_ASSETS()->I_Connected_62x31);
canvas_draw_str_aligned(canvas, 128 / 2, 3, AlignCenter, AlignTop, "Connected!");
} else if(model->display_msg == U2fMsgRegister) {
if(XTREME_ASSETS()->is_nsfw) {
if(XTREME_SETTINGS()->nsfw_mode) {
elements_button_center(canvas, "CUM");
canvas_draw_icon(canvas, 22, 15, XTREME_ASSETS()->I_Auth_62x31);
canvas_draw_str_aligned(
@@ -44,7 +44,7 @@ static void u2f_view_draw_callback(Canvas* canvas, void* _model) {
canvas, 128 / 2, 3, AlignCenter, AlignTop, "Press OK to register");
}
} else if(model->display_msg == U2fMsgAuth) {
if(XTREME_ASSETS()->is_nsfw) {
if(XTREME_SETTINGS()->nsfw_mode) {
elements_button_center(canvas, "CUM");
canvas_draw_icon(canvas, 22, 15, XTREME_ASSETS()->I_Auth_62x31);
canvas_draw_str_aligned(
@@ -57,7 +57,7 @@ static void u2f_view_draw_callback(Canvas* canvas, void* _model) {
}
} else if(model->display_msg == U2fMsgSuccess) {
canvas_draw_icon(canvas, 22, 15, XTREME_ASSETS()->I_Connected_62x31);
if(XTREME_ASSETS()->is_nsfw) {
if(XTREME_SETTINGS()->nsfw_mode) {
canvas_draw_str_aligned(canvas, 128 / 2, 3, AlignCenter, AlignTop, "Cum released~");
} else {
canvas_draw_str_aligned(
@@ -65,7 +65,7 @@ static void u2f_view_draw_callback(Canvas* canvas, void* _model) {
}
} else if(model->display_msg == U2fMsgError) {
canvas_draw_icon(canvas, 22, 15, XTREME_ASSETS()->I_Error_62x31);
if(XTREME_ASSETS()->is_nsfw) {
if(XTREME_SETTINGS()->nsfw_mode) {
canvas_draw_str_aligned(canvas, 128 / 2, 3, AlignCenter, AlignTop, "Unable to cum");
} else {
canvas_draw_str_aligned(

View File

@@ -10,3 +10,4 @@ App(
fap_category="Misc",
order=81,
)

View File

@@ -9,4 +9,4 @@ App(
fap_icon_assets="images",
fap_icon="flipp_pomodoro_10.png",
fap_icon_assets_symbol="flipp_pomodoro",
)
)

View File

@@ -1,6 +1,6 @@
# COMPILE ISTRUCTIONS:
# Clean the code and remove old binaries/compilation artefact
# Clean the code and remove old binaries/compilation artefact
# ./fbt -c fap_rubiks_cube_scrambler
# Compile FAP

View File

@@ -13,7 +13,7 @@
#include "animation_storage.h"
#include "animation_manager.h"
#include "../../../settings/xtreme_settings/xtreme_assets.h"
#include "../../../settings/xtreme_settings/xtreme_settings.h"
#define TAG "AnimationManager"
@@ -569,6 +569,9 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
static void animation_manager_switch_to_one_shot_view(AnimationManager* animation_manager) {
furi_assert(animation_manager);
furi_assert(!animation_manager->one_shot_view);
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
DolphinStats stats = dolphin_stats(dolphin);
furi_record_close(RECORD_DOLPHIN);
animation_manager->one_shot_view = one_shot_view_alloc();
one_shot_view_set_interact_callback(
@@ -577,8 +580,19 @@ static void animation_manager_switch_to_one_shot_view(AnimationManager* animatio
View* next_view = one_shot_view_get_view(animation_manager->one_shot_view);
view_stack_remove_view(animation_manager->view_stack, prev_view);
view_stack_add_view(animation_manager->view_stack, next_view);
one_shot_view_start_animation(
animation_manager->one_shot_view, XTREME_ASSETS()->A_Levelup_128x64);
if(XTREME_SETTINGS()->nsfw_mode) {
one_shot_view_start_animation(animation_manager->one_shot_view, &A_Levelup1_128x64);
} else {
if(stats.level <= 20) {
one_shot_view_start_animation(
animation_manager->one_shot_view, &A_Levelup1_128x64_sfw);
} else if(stats.level >= 21) {
one_shot_view_start_animation(
animation_manager->one_shot_view, &A_Levelup2_128x64_sfw);
} else {
furi_assert(0);
}
}
}
static void animation_manager_switch_to_animation_view(AnimationManager* animation_manager) {

View File

@@ -40,7 +40,7 @@ void animation_handler_select_manifest() {
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) {
FURI_LOG_I(TAG, "Custom manifest selected");
FURI_LOG_I(TAG, "Custom Manifest selected");
} else {
use_asset_pack = false;
}
@@ -48,8 +48,14 @@ void animation_handler_select_manifest() {
}
if(!use_asset_pack) {
furi_string_set(anim_dir, BASE_ANIMATION_DIR);
if(xtreme_settings->nsfw_mode) {
furi_string_cat_str(anim_dir, "/nsfw");
FURI_LOG_I(TAG, "NSFW Manifest selected");
} else {
furi_string_cat_str(anim_dir, "/sfw");
FURI_LOG_I(TAG, "SFW Manifest selected");
}
furi_string_printf(manifest, "%s/manifest.txt", furi_string_get_cstr(anim_dir));
FURI_LOG_I(TAG, "Base manifest selected");
}
strlcpy(ANIMATION_DIR, furi_string_get_cstr(anim_dir), sizeof(ANIMATION_DIR));
strlcpy(

View File

@@ -17,8 +17,6 @@
#include "helpers/pin_lock.h"
#include "helpers/slideshow_filename.h"
#include "../../settings/xtreme_settings/xtreme_assets.h"
static void desktop_auto_lock_arm(Desktop*);
static void desktop_auto_lock_inhibit(Desktop*);
static void desktop_start_auto_lock_timer(Desktop*);
@@ -307,9 +305,6 @@ static bool desktop_check_file_flag(const char* flag_path) {
int32_t desktop_srv(void* p) {
UNUSED(p);
// TODO: find a (working) way to run this at startup without hooking desktop
XTREME_ASSETS_LOAD();
if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) {
FURI_LOG_W("Desktop", "Desktop load skipped. Device is in special startup mode.");
} else {

View File

@@ -1,7 +1,7 @@
#include <furi_hal.h>
#include "../desktop_i.h"
#include "../../../settings/xtreme_settings/xtreme_assets.h"
#include "../../../settings/xtreme_settings/xtreme_settings.h"
#define DesktopFaultEventExit 0x00FF00FF
@@ -15,7 +15,7 @@ void desktop_scene_fault_on_enter(void* context) {
Popup* popup = desktop->hw_mismatch_popup;
popup_set_context(popup, desktop);
if(XTREME_ASSETS()->is_nsfw) {
if(XTREME_SETTINGS()->nsfw_mode) {
popup_set_header(
popup,
"Slut passed out\n but is now back",

View File

@@ -40,7 +40,7 @@ static void render_callback(Canvas* canvas, void* _ctx) {
const char* mood_str = NULL;
const Icon* portrait = NULL;
if(XTREME_ASSETS()->is_nsfw) {
if(XTREME_SETTINGS()->nsfw_mode) {
if(stats->butthurt <= 4) {
portrait = xtreme_assets->I_passport_happy_46x49;
mood_str = "Status: Wet";

View File

@@ -12,7 +12,7 @@ void power_settings_scene_power_off_on_enter(void* context) {
DialogEx* dialog = app->dialog;
dialog_ex_set_header(dialog, "Turn Off Device?", 64, 2, AlignCenter, AlignTop);
if(XTREME_ASSETS()->is_nsfw) {
if(XTREME_SETTINGS()->nsfw_mode) {
dialog_ex_set_text(
dialog, " I will be\nwaiting for\n you master", 78, 16, AlignLeft, AlignTop);
} else {

View File

@@ -3,6 +3,15 @@
#include <power/power_service/power.h>
#include <lib/toolbox/version.h>
static void xtreme_settings_scene_start_base_graphics_changed(VariableItem* item) {
XtremeSettingsApp* app = variable_item_get_context(item);
bool value = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, value ? "NSFW" : "SFW");
XTREME_SETTINGS()->nsfw_mode = value;
app->settings_changed = true;
app->assets_changed = true;
}
static void xtreme_settings_scene_start_asset_pack_changed(VariableItem* item) {
XtremeSettingsApp* app = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item);
@@ -163,6 +172,11 @@ void xtreme_settings_scene_start_on_enter(void* context) {
storage_file_free(folder);
furi_record_close(RECORD_STORAGE);
item = variable_item_list_add(
var_item_list, "Base Graphics", 2, xtreme_settings_scene_start_base_graphics_changed, app);
variable_item_set_current_value_index(item, xtreme_settings->nsfw_mode);
variable_item_set_current_value_text(item, xtreme_settings->nsfw_mode ? "NSFW" : "SFW");
item = variable_item_list_add(
var_item_list,
"Asset Pack",

View File

@@ -2,50 +2,175 @@
#include "assets_icons.h"
#include <core/dangerous_defines.h>
#define ICONS_FMT PACKS_DIR "/%s/Icons/%s"
XtremeAssets* xtreme_assets = NULL;
void anim(const Icon** replace, const char* name, FuriString* path, File* file) {
do {
furi_string_printf(path, ICONS_FMT "/meta", XTREME_SETTINGS()->asset_pack, name);
if(!storage_file_open(file, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING))
break;
int32_t width, height, frame_rate, frame_count;
storage_file_read(file, &width, 4);
storage_file_read(file, &height, 4);
storage_file_read(file, &frame_rate, 4);
storage_file_read(file, &frame_count, 4);
storage_file_close(file);
Icon* icon = malloc(sizeof(Icon));
FURI_CONST_ASSIGN(icon->width, width);
FURI_CONST_ASSIGN(icon->height, height);
FURI_CONST_ASSIGN(icon->frame_rate, frame_rate);
FURI_CONST_ASSIGN(icon->frame_count, frame_count);
icon->frames = malloc(sizeof(const uint8_t*) * icon->frame_count);
const char* pack = XTREME_SETTINGS()->asset_pack;
bool ok = true;
for(int i = 0; ok && i < icon->frame_count; ++i) {
ok = false;
furi_string_printf(path, ICONS_FMT "/frame_%02d.bm", pack, name, i);
if(!storage_file_open(file, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING))
break;
uint64_t size = storage_file_size(file);
FURI_CONST_ASSIGN_PTR(icon->frames[i], malloc(size));
if(storage_file_read(file, (void*)icon->frames[i], size) == size) ok = true;
storage_file_close(file);
}
if(!ok) break;
*replace = icon;
} while(false);
XtremeAssets* XTREME_ASSETS() {
if(xtreme_assets == NULL) {
XTREME_ASSETS_LOAD();
}
return xtreme_assets;
}
void icon(const Icon** replace, const char* name, FuriString* path, File* file) {
furi_string_printf(path, ICONS_FMT ".bmx", XTREME_SETTINGS()->asset_pack, name);
void XTREME_ASSETS_LOAD() {
if(xtreme_assets != NULL) return;
xtreme_assets = malloc(sizeof(XtremeAssets));
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
if(xtreme_settings->nsfw_mode) {
xtreme_assets->I_BLE_Pairing_128x64 = &I_BLE_Pairing_128x64;
xtreme_assets->I_DolphinCommon_56x48 = &I_DolphinCommon_56x48;
xtreme_assets->I_DolphinMafia_115x62 = &I_DolphinMafia_115x62;
xtreme_assets->I_DolphinNice_96x59 = &I_DolphinNice_96x59;
xtreme_assets->I_DolphinWait_61x59 = &I_DolphinWait_61x59;
xtreme_assets->I_iButtonDolphinVerySuccess_108x52 = &I_iButtonDolphinVerySuccess_108x52;
xtreme_assets->I_DolphinReadingSuccess_59x63 = &I_DolphinReadingSuccess_59x63;
xtreme_assets->I_NFC_dolphin_emulation_47x61 = &I_NFC_dolphin_emulation_47x61;
xtreme_assets->I_passport_bad_46x49 = &I_flipper;
xtreme_assets->I_passport_DB = &I_passport_DB;
xtreme_assets->I_passport_happy_46x49 = &I_flipper;
xtreme_assets->I_passport_okay_46x49 = &I_flipper;
xtreme_assets->I_RFIDDolphinReceive_97x61 = &I_RFIDDolphinReceive_97x61;
xtreme_assets->I_RFIDDolphinSend_97x61 = &I_RFIDDolphinSend_97x61;
xtreme_assets->I_RFIDDolphinSuccess_108x57 = &I_RFIDDolphinSuccess_108x57;
xtreme_assets->I_Cry_dolph_55x52 = &I_Cry_dolph_55x52;
xtreme_assets->I_Scanning_123x52 = &I_Scanning_123x52;
xtreme_assets->I_Auth_62x31 = &I_Auth_62x31;
xtreme_assets->I_Connect_me_62x31 = &I_Connect_me_62x31;
xtreme_assets->I_Connected_62x31 = &I_Connected_62x31;
xtreme_assets->I_Error_62x31 = &I_Error_62x31;
} else {
xtreme_assets->I_BLE_Pairing_128x64 = &I_BLE_Pairing_128x64_sfw;
xtreme_assets->I_DolphinCommon_56x48 = &I_DolphinCommon_56x48_sfw;
xtreme_assets->I_DolphinMafia_115x62 = &I_DolphinMafia_115x62_sfw;
xtreme_assets->I_DolphinNice_96x59 = &I_DolphinNice_96x59_sfw;
xtreme_assets->I_DolphinWait_61x59 = &I_DolphinWait_61x59_sfw;
xtreme_assets->I_iButtonDolphinVerySuccess_108x52 =
&I_iButtonDolphinVerySuccess_108x52_sfw;
xtreme_assets->I_DolphinReadingSuccess_59x63 = &I_DolphinReadingSuccess_59x63_sfw;
xtreme_assets->I_NFC_dolphin_emulation_47x61 = &I_NFC_dolphin_emulation_47x61_sfw;
xtreme_assets->I_passport_bad_46x49 = &I_passport_bad1_46x49_sfw;
xtreme_assets->I_passport_DB = &I_passport_DB_sfw;
xtreme_assets->I_passport_happy_46x49 = &I_passport_happy1_46x49_sfw;
xtreme_assets->I_passport_okay_46x49 = &I_passport_okay1_46x49_sfw;
xtreme_assets->I_RFIDDolphinReceive_97x61 = &I_RFIDDolphinReceive_97x61_sfw;
xtreme_assets->I_RFIDDolphinSend_97x61 = &I_RFIDDolphinSend_97x61_sfw;
xtreme_assets->I_RFIDDolphinSuccess_108x57 = &I_RFIDDolphinSuccess_108x57_sfw;
xtreme_assets->I_Cry_dolph_55x52 = &I_Cry_dolph_55x52_sfw;
xtreme_assets->I_Scanning_123x52 = &I_Scanning_123x52_sfw;
xtreme_assets->I_Auth_62x31 = &I_Auth_62x31_sfw;
xtreme_assets->I_Connect_me_62x31 = &I_Connect_me_62x31_sfw;
xtreme_assets->I_Connected_62x31 = &I_Connected_62x31_sfw;
xtreme_assets->I_Error_62x31 = &I_Error_62x31_sfw;
}
if(xtreme_settings->asset_pack[0] == '\0') return;
FileInfo info;
FuriString* path = furi_string_alloc();
const char* pack = xtreme_settings->asset_pack;
furi_string_printf(path, PACKS_DIR "/%s", 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_bmx_icon(
&xtreme_assets->I_BLE_Pairing_128x64, pack, "BLE/BLE_Pairing_128x64.bmx", path, file);
swap_bmx_icon(
&xtreme_assets->I_DolphinCommon_56x48,
pack,
"Dolphin/DolphinCommon_56x48.bmx",
path,
file);
swap_bmx_icon(
&xtreme_assets->I_DolphinMafia_115x62,
pack,
"iButton/DolphinMafia_115x62.bmx",
path,
file);
swap_bmx_icon(
&xtreme_assets->I_DolphinNice_96x59, pack, "iButton/DolphinNice_96x59.bmx", path, file);
swap_bmx_icon(
&xtreme_assets->I_DolphinWait_61x59, pack, "iButton/DolphinWait_61x59.bmx", path, file);
swap_bmx_icon(
&xtreme_assets->I_iButtonDolphinVerySuccess_108x52,
pack,
"iButton/iButtonDolphinVerySuccess_108x52.bmx",
path,
file);
swap_bmx_icon(
&xtreme_assets->I_DolphinReadingSuccess_59x63,
pack,
"Infrared/DolphinReadingSuccess_59x63.bmx",
path,
file);
swap_bmx_icon(
&xtreme_assets->I_NFC_dolphin_emulation_47x61,
pack,
"NFC/NFC_dolphin_emulation_47x61.bmx",
path,
file);
swap_bmx_icon(
&xtreme_assets->I_passport_bad_46x49,
pack,
"Passport/passport_bad_46x49.bmx",
path,
file);
swap_bmx_icon(&xtreme_assets->I_passport_DB, pack, "Passport/passport_DB.bmx", path, file);
swap_bmx_icon(
&xtreme_assets->I_passport_happy_46x49,
pack,
"Passport/passport_happy_46x49.bmx",
path,
file);
swap_bmx_icon(
&xtreme_assets->I_passport_okay_46x49,
pack,
"Passport/passport_okay_46x49.bmx",
path,
file);
swap_bmx_icon(
&xtreme_assets->I_RFIDDolphinReceive_97x61,
pack,
"RFID/RFIDDolphinReceive_97x61.bmx",
path,
file);
swap_bmx_icon(
&xtreme_assets->I_RFIDDolphinSend_97x61,
pack,
"RFID/RFIDDolphinSend_97x61.bmx",
path,
file);
swap_bmx_icon(
&xtreme_assets->I_RFIDDolphinSuccess_108x57,
pack,
"RFID/RFIDDolphinSuccess_108x57.bmx",
path,
file);
swap_bmx_icon(
&xtreme_assets->I_Cry_dolph_55x52, pack, "Settings/Cry_dolph_55x52.bmx", path, file);
swap_bmx_icon(
&xtreme_assets->I_Scanning_123x52, pack, "SubGhz/Scanning_123x52.bmx", path, file);
swap_bmx_icon(&xtreme_assets->I_Auth_62x31, pack, "U2F/Auth_62x31.bmx", path, file);
swap_bmx_icon(
&xtreme_assets->I_Connect_me_62x31, pack, "U2F/Connect_me_62x31.bmx", path, file);
swap_bmx_icon(
&xtreme_assets->I_Connected_62x31, pack, "U2F/Connected_62x31.bmx", path, file);
swap_bmx_icon(&xtreme_assets->I_Error_62x31, pack, "U2F/Error_62x31.bmx", path, file);
storage_file_free(file);
}
furi_record_close(RECORD_STORAGE);
furi_string_free(path);
}
void swap_bmx_icon(
const Icon** replace,
const char* pack,
const char* name,
FuriString* path,
File* file) {
furi_string_printf(path, PACKS_DIR "/%s/Icons/%s", pack, name);
if(storage_file_open(file, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) {
uint64_t size = storage_file_size(file) - 8;
int32_t width, height;
@@ -65,80 +190,3 @@ void icon(const Icon** replace, const char* name, FuriString* path, File* file)
storage_file_close(file);
}
}
void swap(XtremeAssets* x, FuriString* p, File* f) {
anim(&x->A_Levelup_128x64, "Animations/Levelup_128x64", p, f);
icon(&x->I_BLE_Pairing_128x64, "BLE/BLE_Pairing_128x64", p, f);
icon(&x->I_DolphinCommon_56x48, "Dolphin/DolphinCommon_56x48", p, f);
icon(&x->I_DolphinMafia_115x62, "iButton/DolphinMafia_115x62", p, f);
icon(&x->I_DolphinNice_96x59, "iButton/DolphinNice_96x59", p, f);
icon(&x->I_DolphinWait_61x59, "iButton/DolphinWait_61x59", p, f);
icon(&x->I_iButtonDolphinVerySuccess_108x52, "iButton/iButtonDolphinVerySuccess_108x52", p, f);
icon(&x->I_DolphinReadingSuccess_59x63, "Infrared/DolphinReadingSuccess_59x63", p, f);
icon(&x->I_NFC_dolphin_emulation_47x61, "NFC/NFC_dolphin_emulation_47x61", p, f);
icon(&x->I_passport_bad_46x49, "Passport/passport_bad_46x49", p, f);
icon(&x->I_passport_DB, "Passport/passport_DB", p, f);
icon(&x->I_passport_happy_46x49, "Passport/passport_happy_46x49", p, f);
icon(&x->I_passport_okay_46x49, "Passport/passport_okay_46x49", p, f);
icon(&x->I_RFIDDolphinReceive_97x61, "RFID/RFIDDolphinReceive_97x61", p, f);
icon(&x->I_RFIDDolphinSend_97x61, "RFID/RFIDDolphinSend_97x61", p, f);
icon(&x->I_RFIDDolphinSuccess_108x57, "RFID/RFIDDolphinSuccess_108x57", p, f);
icon(&x->I_Cry_dolph_55x52, "Settings/Cry_dolph_55x52", p, f);
icon(&x->I_Scanning_123x52, "SubGhz/Scanning_123x52", p, f);
icon(&x->I_Auth_62x31, "U2F/Auth_62x31", p, f);
icon(&x->I_Connect_me_62x31, "U2F/Connect_me_62x31", p, f);
icon(&x->I_Connected_62x31, "U2F/Connected_62x31", p, f);
icon(&x->I_Error_62x31, "U2F/Error_62x31", p, f);
}
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;
xtreme_assets->I_DolphinCommon_56x48 = &I_DolphinCommon_56x48;
xtreme_assets->I_DolphinMafia_115x62 = &I_DolphinMafia_115x62;
xtreme_assets->I_DolphinNice_96x59 = &I_DolphinNice_96x59;
xtreme_assets->I_DolphinWait_61x59 = &I_DolphinWait_61x59;
xtreme_assets->I_iButtonDolphinVerySuccess_108x52 = &I_iButtonDolphinVerySuccess_108x52;
xtreme_assets->I_DolphinReadingSuccess_59x63 = &I_DolphinReadingSuccess_59x63;
xtreme_assets->I_NFC_dolphin_emulation_47x61 = &I_NFC_dolphin_emulation_47x61;
xtreme_assets->I_passport_bad_46x49 = &I_passport_bad_46x49;
xtreme_assets->I_passport_DB = &I_passport_DB;
xtreme_assets->I_passport_happy_46x49 = &I_passport_happy_46x49;
xtreme_assets->I_passport_okay_46x49 = &I_passport_okay_46x49;
xtreme_assets->I_RFIDDolphinReceive_97x61 = &I_RFIDDolphinReceive_97x61;
xtreme_assets->I_RFIDDolphinSend_97x61 = &I_RFIDDolphinSend_97x61;
xtreme_assets->I_RFIDDolphinSuccess_108x57 = &I_RFIDDolphinSuccess_108x57;
xtreme_assets->I_Cry_dolph_55x52 = &I_Cry_dolph_55x52;
xtreme_assets->I_Scanning_123x52 = &I_Scanning_123x52;
xtreme_assets->I_Auth_62x31 = &I_Auth_62x31;
xtreme_assets->I_Connect_me_62x31 = &I_Connect_me_62x31;
xtreme_assets->I_Connected_62x31 = &I_Connected_62x31;
xtreme_assets->I_Error_62x31 = &I_Error_62x31;
if(xtreme_settings->asset_pack[0] == '\0') return;
xtreme_assets->is_nsfw = strncmp(xtreme_settings->asset_pack, "NSFW", strlen("NSFW")) == 0;
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);
}
XtremeAssets* XTREME_ASSETS() {
if(xtreme_assets == NULL) {
XTREME_ASSETS_LOAD();
}
return xtreme_assets;
}

View File

@@ -7,8 +7,6 @@
#define PACKS_DIR EXT_PATH("dolphin_custom")
typedef struct {
bool is_nsfw;
const Icon* A_Levelup_128x64;
const Icon* I_BLE_Pairing_128x64;
const Icon* I_DolphinCommon_56x48;
const Icon* I_DolphinMafia_115x62;
@@ -32,6 +30,15 @@ typedef struct {
const Icon* I_Error_62x31;
} XtremeAssets;
XtremeAssets* XTREME_ASSETS();
void XTREME_ASSETS_LOAD();
XtremeAssets* XTREME_ASSETS();
void swap_bmx_icon(
const Icon** replace,
const char* base,
const char* name,
FuriString* path,
File* file);
void free_bmx_icon(Icon* icon);

View File

@@ -18,6 +18,7 @@
typedef struct {
int32_t cycle_anims;
bool unlock_anims;
bool nsfw_mode;
char asset_pack[MAX_PACK_NAME_LEN];
BatteryStyle battery_style;
uint16_t anim_speed;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 421 B

After

Width:  |  Height:  |  Size: 421 B

View File

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 378 B

View File

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 414 B

View File

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 387 B

View File

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 383 B

View File

Before

Width:  |  Height:  |  Size: 339 B

After

Width:  |  Height:  |  Size: 339 B

View File

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 383 B

View File

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 401 B

View File

Before

Width:  |  Height:  |  Size: 343 B

After

Width:  |  Height:  |  Size: 343 B

View File

Before

Width:  |  Height:  |  Size: 322 B

After

Width:  |  Height:  |  Size: 322 B

View File

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 320 B

View File

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 397 B

View File

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 382 B

View File

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 384 B

View File

Before

Width:  |  Height:  |  Size: 394 B

After

Width:  |  Height:  |  Size: 394 B

View File

Before

Width:  |  Height:  |  Size: 399 B

After

Width:  |  Height:  |  Size: 399 B

View File

Before

Width:  |  Height:  |  Size: 369 B

After

Width:  |  Height:  |  Size: 369 B

View File

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 404 B

View File

Before

Width:  |  Height:  |  Size: 419 B

After

Width:  |  Height:  |  Size: 419 B

View File

Before

Width:  |  Height:  |  Size: 471 B

After

Width:  |  Height:  |  Size: 471 B

View File

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 477 B

View File

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 466 B

View File

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 432 B

View File

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 367 B

View File

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 406 B

View File

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 359 B

View File

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 365 B

View File

Before

Width:  |  Height:  |  Size: 379 B

After

Width:  |  Height:  |  Size: 379 B

View File

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 397 B

Some files were not shown because too many files have changed in this diff Show More