[FL-2828] Dolphin score update take 2 (#1929)
* Move DolphinDeedNfcRead * Move DolphinDeedNfcReadSuccess * Move DolphinDeedNfcSave * Move DolphinDeedNfcDetectReader * Move DolphinDeedNfcEmulate * Count DolphinDeedNfcEmulate when launched from file browser * Implement most of the score accounting for NFC * Fully update Nfc icounter handling * Move DolphinDeedSubGhzFrequencyAnalyzer * Update the rest of icounter in SubGHz * Adjust SubGHz icounter handling * Adjust LFRFID icounter handling * Adjust Infrared icounter handling * Don't count renaming RFID tags as saving * Don't count renaming SubGHz signals as saving * Don't count renaming NFC tags as saving * Adjust iButton icounter handling * Minor code refactoring * Correct formatting * Account for emulating iButton keys from file manager/rpc Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#include "../ibutton_i.h"
|
||||
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
void ibutton_scene_add_type_byte_input_callback(void* context) {
|
||||
iButton* ibutton = context;
|
||||
view_dispatcher_send_custom_event(ibutton->view_dispatcher, iButtonCustomEventByteEditResult);
|
||||
@@ -38,7 +36,6 @@ bool ibutton_scene_add_value_on_event(void* context, SceneManagerEvent event) {
|
||||
consumed = true;
|
||||
if(event.event == iButtonCustomEventByteEditResult) {
|
||||
ibutton_key_set_data(ibutton->key, new_key_data, IBUTTON_KEY_DATA_SIZE);
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonAdd);
|
||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneSaveName);
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
#include "../ibutton_i.h"
|
||||
#include <core/log.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
#include <toolbox/path.h>
|
||||
|
||||
#define EMULATE_TIMEOUT_TICKS 10
|
||||
@@ -26,8 +25,6 @@ void ibutton_scene_emulate_on_enter(void* context) {
|
||||
path_extract_filename(ibutton->file_path, key_name, true);
|
||||
}
|
||||
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
|
||||
|
||||
// check that stored key has name
|
||||
if(!furi_string_empty(key_name)) {
|
||||
ibutton_text_store_set(ibutton, "%s", furi_string_get_cstr(key_name));
|
||||
|
@@ -11,7 +11,6 @@ void ibutton_scene_read_on_enter(void* context) {
|
||||
Popup* popup = ibutton->popup;
|
||||
iButtonKey* key = ibutton->key;
|
||||
iButtonWorker* worker = ibutton->key_worker;
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonRead);
|
||||
|
||||
popup_set_header(popup, "iButton", 95, 26, AlignCenter, AlignBottom);
|
||||
popup_set_text(popup, "Waiting\nfor key ...", 95, 30, AlignCenter, AlignTop);
|
||||
@@ -54,8 +53,8 @@ bool ibutton_scene_read_on_event(void* context, SceneManagerEvent event) {
|
||||
if(success) {
|
||||
ibutton_notification_message(ibutton, iButtonNotificationMessageSuccess);
|
||||
ibutton_notification_message(ibutton, iButtonNotificationMessageGreenOn);
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonReadSuccess);
|
||||
scene_manager_next_scene(scene_manager, iButtonSceneReadSuccess);
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonReadSuccess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include "../ibutton_i.h"
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
typedef enum {
|
||||
SubmenuIndexSave,
|
||||
@@ -49,6 +50,7 @@ bool ibutton_scene_read_key_menu_on_event(void* context, SceneManagerEvent event
|
||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneSaveName);
|
||||
} else if(event.event == SubmenuIndexEmulate) {
|
||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneEmulate);
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
|
||||
} else if(event.event == SubmenuIndexWrite) {
|
||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneWrite);
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "../ibutton_i.h"
|
||||
#include <lib/toolbox/random_name.h>
|
||||
#include <toolbox/path.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
static void ibutton_scene_save_name_text_input_callback(void* context) {
|
||||
iButton* ibutton = context;
|
||||
@@ -57,6 +58,15 @@ bool ibutton_scene_save_name_on_event(void* context, SceneManagerEvent event) {
|
||||
if(event.event == iButtonCustomEventTextEditResult) {
|
||||
if(ibutton_save_key(ibutton, ibutton->text_store)) {
|
||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneSaveSuccess);
|
||||
if(scene_manager_has_previous_scene(
|
||||
ibutton->scene_manager, iButtonSceneSavedKeyMenu)) {
|
||||
// Nothing, do not count editing as saving
|
||||
} else if(scene_manager_has_previous_scene(
|
||||
ibutton->scene_manager, iButtonSceneAddType)) {
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonAdd);
|
||||
} else {
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonSave);
|
||||
}
|
||||
} else {
|
||||
const uint32_t possible_scenes[] = {
|
||||
iButtonSceneReadKeyMenu, iButtonSceneSavedKeyMenu, iButtonSceneAddType};
|
||||
|
@@ -1,5 +1,4 @@
|
||||
#include "../ibutton_i.h"
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
static void ibutton_scene_save_success_popup_callback(void* context) {
|
||||
iButton* ibutton = context;
|
||||
@@ -9,7 +8,6 @@ static void ibutton_scene_save_success_popup_callback(void* context) {
|
||||
void ibutton_scene_save_success_on_enter(void* context) {
|
||||
iButton* ibutton = context;
|
||||
Popup* popup = ibutton->popup;
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonSave);
|
||||
|
||||
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
|
||||
popup_set_header(popup, "Saved!", 5, 7, AlignLeft, AlignTop);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include "../ibutton_i.h"
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
enum SubmenuIndex {
|
||||
SubmenuIndexEmulate,
|
||||
@@ -58,6 +59,7 @@ bool ibutton_scene_saved_key_menu_on_event(void* context, SceneManagerEvent even
|
||||
consumed = true;
|
||||
if(event.event == SubmenuIndexEmulate) {
|
||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneEmulate);
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
|
||||
} else if(event.event == SubmenuIndexWrite) {
|
||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneWrite);
|
||||
} else if(event.event == SubmenuIndexEdit) {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include "../ibutton_i.h"
|
||||
#include "ibutton/scenes/ibutton_scene.h"
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
enum SubmenuIndex {
|
||||
SubmenuIndexRead,
|
||||
@@ -38,6 +39,7 @@ bool ibutton_scene_start_on_event(void* context, SceneManagerEvent event) {
|
||||
consumed = true;
|
||||
if(event.event == SubmenuIndexRead) {
|
||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneRead);
|
||||
DOLPHIN_DEED(DolphinDeedIbuttonRead);
|
||||
} else if(event.event == SubmenuIndexSaved) {
|
||||
furi_string_set(ibutton->file_path, IBUTTON_APP_FOLDER);
|
||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneSelectKey);
|
||||
|
Reference in New Issue
Block a user