This commit is contained in:
Willy-JL
2023-02-26 01:44:32 +00:00
parent 3296cf3b79
commit 991d49733f
17 changed files with 264 additions and 560 deletions

View File

@@ -9,17 +9,8 @@ static void xtreme_app_scene_dolphin_xp_level_changed(VariableItem* item) {
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 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) {

View File

@@ -73,7 +73,8 @@ void xtreme_app_scene_graphics_on_enter(void* context) {
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,
app->asset_pack == 0 ? "SFW" : *asset_packs_get(app->asset_packs, app->asset_pack - 1));
item = variable_item_list_add(
var_item_list,

View File

@@ -35,9 +35,11 @@ void xtreme_app_scene_misc_on_enter(void* context) {
variable_item_list_add(var_item_list, "Change Device Name", 0, NULL, app);
variable_item_list_set_enter_callback(var_item_list, xtreme_app_scene_misc_var_item_list_callback, app);
variable_item_list_set_enter_callback(
var_item_list, xtreme_app_scene_misc_var_item_list_callback, app);
variable_item_list_set_selected_item(var_item_list, scene_manager_get_scene_state(app->scene_manager, XtremeAppSceneMisc));
variable_item_list_set_selected_item(
var_item_list, scene_manager_get_scene_state(app->scene_manager, XtremeAppSceneMisc));
view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewVarItemList);
}
@@ -50,11 +52,11 @@ bool xtreme_app_scene_misc_on_event(void* context, SceneManagerEvent event) {
scene_manager_set_scene_state(app->scene_manager, XtremeAppSceneMisc, event.event);
consumed = true;
switch(event.event) {
case VarItemListIndexChangeDeviceName:
scene_manager_next_scene(app->scene_manager, XtremeAppSceneMiscRename);
break;
default:
break;
case VarItemListIndexChangeDeviceName:
scene_manager_next_scene(app->scene_manager, XtremeAppSceneMiscRename);
break;
default:
break;
}
}

View File

@@ -9,8 +9,7 @@ static void xtreme_app_scene_misc_rename_text_input_callback(void* context) {
app->save_name = true;
app->require_reboot = true;
view_dispatcher_send_custom_event(
app->view_dispatcher, TextInputIndexResult);
view_dispatcher_send_custom_event(app->view_dispatcher, TextInputIndexResult);
}
void xtreme_app_scene_misc_rename_on_enter(void* context) {
@@ -37,11 +36,11 @@ bool xtreme_app_scene_misc_rename_on_event(void* context, SceneManagerEvent even
if(event.type == SceneManagerEventTypeCustom) {
consumed = true;
switch(event.event) {
case TextInputIndexResult:
scene_manager_previous_scene(app->scene_manager);
break;
default:
break;
case TextInputIndexResult:
scene_manager_previous_scene(app->scene_manager);
break;
default:
break;
}
}

View File

@@ -25,9 +25,11 @@ void xtreme_app_scene_start_on_enter(void* context) {
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_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));
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);
}
@@ -40,23 +42,23 @@ bool xtreme_app_scene_start_on_event(void* context, SceneManagerEvent event) {
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;
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;
}
}

View File

@@ -20,7 +20,8 @@ static bool xtreme_app_back_event_callback(void* context) {
if(app->save_subghz) {
FlipperFormat* subghz_range = flipper_format_file_alloc(storage);
if(flipper_format_file_open_existing(subghz_range, "/ext/subghz/assets/extend_range.txt")) {
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(
@@ -49,9 +50,17 @@ static bool xtreme_app_back_event_callback(void* context) {
if(!flipper_format_write_header_cstr(file, NAMECHANGER_HEADER, 1)) break;
if(!flipper_format_write_comment_cstr(file, "Changing the value below will change your FlipperZero device name.")) break;
if(!flipper_format_write_comment_cstr(file, "Note: This is limited to 8 characters using the following: a-z, A-Z, 0-9, and _")) break;
if(!flipper_format_write_comment_cstr(file, "It cannot contain any other characters.")) break;
if(!flipper_format_write_comment_cstr(
file,
"Changing the value below will change your FlipperZero device name."))
break;
if(!flipper_format_write_comment_cstr(
file,
"Note: This is limited to 8 characters using the following: a-z, A-Z, 0-9, and _"))
break;
if(!flipper_format_write_comment_cstr(
file, "It cannot contain any other characters."))
break;
if(!flipper_format_write_string_cstr(file, "Name", app->device_name)) break;
@@ -108,9 +117,7 @@ XtremeApp* xtreme_app_alloc() {
app->text_input = text_input_alloc();
view_dispatcher_add_view(
app->view_dispatcher,
XtremeAppViewTextInput,
text_input_get_view(app->text_input));
app->view_dispatcher, XtremeAppViewTextInput, text_input_get_view(app->text_input));
app->popup = popup_alloc();
view_dispatcher_add_view(app->view_dispatcher, XtremeAppViewPopup, popup_get_view(app->popup));
@@ -124,7 +131,8 @@ XtremeApp* xtreme_app_alloc() {
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, "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);
@@ -168,7 +176,8 @@ XtremeApp* xtreme_app_alloc() {
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));
app->version_tag = furi_string_alloc_printf(
"%s %s", version_get_gitbranchnum(NULL), version_get_builddate(NULL));
return app;
}