Skip to content

Commit fa1d26f

Browse files
committed
Update settings.c
1 parent 32e27c9 commit fa1d26f

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

scences/settings.c

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ void nfc_playlist_settings_options_change_callback(VariableItem* item) {
1111

1212
uint8_t current_option = variable_item_list_get_selected_item_index(nfc_playlist->variable_item_list);
1313
uint8_t option_value_index = variable_item_get_current_value_index(item);
14-
FuriString* temp_str = furi_string_alloc();
14+
FuriString* tmp_str = furi_string_alloc();
1515
switch(current_option) {
1616
case NfcPlaylistSettings_Timeout:
1717
nfc_playlist->settings.emulate_timeout = option_value_index;
18-
furi_string_printf(temp_str, "%ds", options_emulate_timeout[nfc_playlist->settings.emulate_timeout]);
19-
variable_item_set_current_value_text(item, furi_string_get_cstr(temp_str));
18+
furi_string_printf(tmp_str, "%ds", options_emulate_timeout[nfc_playlist->settings.emulate_timeout]);
19+
variable_item_set_current_value_text(item, furi_string_get_cstr(tmp_str));
2020
break;
2121
case NfcPlaylistSettings_Delay:
2222
nfc_playlist->settings.emulate_delay = option_value_index;
23-
furi_string_printf(temp_str, "%ds", options_emulate_delay[nfc_playlist->settings.emulate_delay]);
24-
variable_item_set_current_value_text(item, furi_string_get_cstr(temp_str));
23+
furi_string_printf(tmp_str, "%ds", options_emulate_delay[nfc_playlist->settings.emulate_delay]);
24+
variable_item_set_current_value_text(item, furi_string_get_cstr(tmp_str));
2525
break;
2626
case NfcPlaylistSettings_LedIndicator:
2727
nfc_playlist->settings.emulate_led_indicator = option_value_index;
@@ -30,12 +30,12 @@ void nfc_playlist_settings_options_change_callback(VariableItem* item) {
3030
default:
3131
break;
3232
}
33-
furi_string_free(temp_str);
33+
furi_string_free(tmp_str);
3434
}
3535

3636
void nfc_playlist_settings_scene_on_enter(void* context) {
3737
NfcPlaylist* nfc_playlist = context;
38-
FuriString* temp_str = furi_string_alloc();
38+
FuriString* tmp_str = furi_string_alloc();
3939

4040
variable_item_list_set_header(nfc_playlist->variable_item_list, "Settings");
4141

@@ -46,8 +46,8 @@ void nfc_playlist_settings_scene_on_enter(void* context) {
4646
nfc_playlist_settings_options_change_callback,
4747
nfc_playlist);
4848
variable_item_set_current_value_index(emulation_timeout_settings, nfc_playlist->settings.emulate_timeout);
49-
furi_string_printf(temp_str, "%ds", options_emulate_timeout[nfc_playlist->settings.emulate_timeout]);
50-
variable_item_set_current_value_text(emulation_timeout_settings, furi_string_get_cstr(temp_str));
49+
furi_string_printf(tmp_str, "%ds", options_emulate_timeout[nfc_playlist->settings.emulate_timeout]);
50+
variable_item_set_current_value_text(emulation_timeout_settings, furi_string_get_cstr(tmp_str));
5151

5252
VariableItem* emulation_delay_settings = variable_item_list_add(
5353
nfc_playlist->variable_item_list,
@@ -56,8 +56,8 @@ void nfc_playlist_settings_scene_on_enter(void* context) {
5656
nfc_playlist_settings_options_change_callback,
5757
nfc_playlist);
5858
variable_item_set_current_value_index(emulation_delay_settings, nfc_playlist->settings.emulate_delay);
59-
furi_string_printf(temp_str, "%ds", options_emulate_delay[nfc_playlist->settings.emulate_delay]);
60-
variable_item_set_current_value_text(emulation_delay_settings, furi_string_get_cstr(temp_str));
59+
furi_string_printf(tmp_str, "%ds", options_emulate_delay[nfc_playlist->settings.emulate_delay]);
60+
variable_item_set_current_value_text(emulation_delay_settings, furi_string_get_cstr(tmp_str));
6161

6262
VariableItem* emulation_led_indicator_settings = variable_item_list_add(
6363
nfc_playlist->variable_item_list,
@@ -72,10 +72,13 @@ void nfc_playlist_settings_scene_on_enter(void* context) {
7272

7373
VariableItem* credits = variable_item_list_add(nfc_playlist->variable_item_list, "acegoal07", 1, NULL, NULL);
7474
variable_item_set_current_value_text(credits, "Credits");
75+
76+
furi_string_printf(tmp_str, "\ev%s\e", FAP_VERSION);
77+
variable_item_list_add(nfc_playlist->variable_item_list, furi_string_get_cstr(tmp_str), 1, NULL, NULL);
7578

7679
variable_item_list_set_enter_callback(nfc_playlist->variable_item_list, nfc_playlist_settings_menu_callback, nfc_playlist);
7780

78-
furi_string_free(temp_str);
81+
furi_string_free(tmp_str);
7982

8083
view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Settings);
8184
}
@@ -86,26 +89,26 @@ bool nfc_playlist_settings_scene_on_event(void* context, SceneManagerEvent event
8689
if (event.type == SceneManagerEventTypeCustom) {
8790
switch(event.event) {
8891
case NfcPlaylistSettings_Reset:
89-
FuriString* temp_str = furi_string_alloc();
92+
FuriString* tmp_str = furi_string_alloc();
9093

9194
nfc_playlist->settings.emulate_timeout = default_emulate_timeout;
9295
VariableItem* emulation_timeout_settings = variable_item_list_get(nfc_playlist->variable_item_list, NfcPlaylistSettings_Timeout);
9396
variable_item_set_current_value_index(emulation_timeout_settings, nfc_playlist->settings.emulate_timeout);
94-
furi_string_printf(temp_str, "%ds", options_emulate_timeout[nfc_playlist->settings.emulate_timeout]);
95-
variable_item_set_current_value_text(emulation_timeout_settings, furi_string_get_cstr(temp_str));
97+
furi_string_printf(tmp_str, "%ds", options_emulate_timeout[nfc_playlist->settings.emulate_timeout]);
98+
variable_item_set_current_value_text(emulation_timeout_settings, furi_string_get_cstr(tmp_str));
9699

97100
nfc_playlist->settings.emulate_delay = default_emulate_delay;
98101
VariableItem* emulation_delay_settings = variable_item_list_get(nfc_playlist->variable_item_list, NfcPlaylistSettings_Delay);
99102
variable_item_set_current_value_index(emulation_delay_settings, nfc_playlist->settings.emulate_delay);
100-
furi_string_printf(temp_str, "%ds", options_emulate_delay[nfc_playlist->settings.emulate_delay]);
101-
variable_item_set_current_value_text(emulation_delay_settings, furi_string_get_cstr(temp_str));
103+
furi_string_printf(tmp_str, "%ds", options_emulate_delay[nfc_playlist->settings.emulate_delay]);
104+
variable_item_set_current_value_text(emulation_delay_settings, furi_string_get_cstr(tmp_str));
102105

103106
nfc_playlist->settings.emulate_led_indicator = default_emulate_led_indicator;
104107
VariableItem* emulation_led_indicator_settings = variable_item_list_get(nfc_playlist->variable_item_list, NfcPlaylistSettings_LedIndicator);
105108
variable_item_set_current_value_index(emulation_led_indicator_settings, nfc_playlist->settings.emulate_led_indicator);
106109
variable_item_set_current_value_text(emulation_led_indicator_settings, nfc_playlist->settings.emulate_led_indicator ? "ON" : "OFF");
107110

108-
furi_string_free(temp_str);
111+
furi_string_free(tmp_str);
109112
consumed = true;
110113
break;
111114
default:

0 commit comments

Comments
 (0)