[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:
Georgii Surkov
2022-10-28 10:18:41 +03:00
committed by GitHub
parent 8b7a52b97b
commit f11df49468
59 changed files with 125 additions and 72 deletions

View File

@@ -2,6 +2,7 @@
#include <lib/toolbox/random_name.h>
#include <gui/modules/validators.h>
#include <toolbox/path.h>
#include <dolphin/dolphin.h>
void nfc_scene_save_name_text_input_callback(void* context) {
Nfc* nfc = context;
@@ -63,6 +64,13 @@ bool nfc_scene_save_name_on_event(void* context, SceneManagerEvent event) {
strlcpy(nfc->dev->dev_name, nfc->text_store, strlen(nfc->text_store) + 1);
if(nfc_device_save(nfc->dev, nfc->text_store)) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneSaveSuccess);
if(!scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSavedMenu)) {
// Nothing, do not count editing as saving
} else if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
DOLPHIN_DEED(DolphinDeedNfcAddSave);
} else {
DOLPHIN_DEED(DolphinDeedNfcSave);
}
consumed = true;
} else {
consumed = scene_manager_search_and_switch_to_previous_scene(