Fuzzer App: Field editor view

This commit is contained in:
gid9798
2023-06-03 22:03:20 +03:00
parent 2b677c83e3
commit 5b4bb66848
11 changed files with 337 additions and 5 deletions

View File

@@ -1,2 +1,3 @@
ADD_SCENE(fuzzer, main, Main)
ADD_SCENE(fuzzer, attack, Attack)
ADD_SCENE(fuzzer, attack, Attack)
ADD_SCENE(fuzzer, field_editor, FieldEditor)

View File

@@ -0,0 +1,42 @@
#include "../fuzzer_i.h"
#include "../helpers/fuzzer_custom_event.h"
void fuzzer_scene_field_editor_callback(FuzzerCustomEvent event, void* context) {
furi_assert(context);
PacsFuzzerApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, event);
}
void fuzzer_scene_field_editor_on_enter(void* context) {
furi_assert(context);
PacsFuzzerApp* app = context;
fuzzer_view_field_editor_set_callback(
app->field_editor_view, fuzzer_scene_field_editor_callback, app);
view_dispatcher_switch_to_view(app->view_dispatcher, FuzzerViewIDFieldEditor);
}
bool fuzzer_scene_field_editor_on_event(void* context, SceneManagerEvent event) {
furi_assert(context);
PacsFuzzerApp* app = context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == FuzzerCustomEventViewFieldEditorBack) {
if(!scene_manager_previous_scene(app->scene_manager)) {
scene_manager_stop(app->scene_manager);
view_dispatcher_stop(app->view_dispatcher);
}
consumed = true;
}
}
return consumed;
}
void fuzzer_scene_field_editor_on_exit(void* context) {
// furi_assert(context);
// PacsFuzzerApp* app = context;
UNUSED(context);
}

View File

@@ -69,6 +69,12 @@ bool fuzzer_scene_main_on_event(void* context, SceneManagerEvent event) {
}
break;
case FuzzerMainMenuIndexLoadFile:
// TODO Delete
scene_manager_next_scene(app->scene_manager, FuzzerSceneFieldEditor);
break;
case FuzzerMainMenuIndexLoadFileCustomUids:
if(!fuzzer_scene_main_load_custom_dict(app)) {
break;