derskythe hace 3 años
padre
commit
112ad271eb
Se han modificado 2 ficheros con 11 adiciones y 11 borrados
  1. 4 4
      scenes/subbrute_scene_run_attack.c
  2. 7 7
      scenes/subbrute_scene_setup_attack.c

+ 4 - 4
scenes/subbrute_scene_run_attack.c

@@ -45,7 +45,7 @@ void subbrute_scene_run_attack_on_enter(void* context) {
         instance->worker, subbrute_scene_run_attack_device_state_changed, instance);
 
     if(!subbrute_worker_is_running(instance->worker)) {
-        subbrute_worker_set_step(instance->worker, instance->device->key_index);
+        subbrute_worker_set_step(instance->worker, instance->device->current_step);
         if(!subbrute_worker_start(instance->worker)) {
             view_dispatcher_send_custom_event(
                 instance->view_dispatcher, SubBruteCustomEventTypeError);
@@ -64,7 +64,7 @@ bool subbrute_scene_run_attack_on_event(void* context, SceneManagerEvent event)
 
     if(event.type == SceneManagerEventTypeCustom) {
         uint64_t step = subbrute_worker_get_step(instance->worker);
-        instance->device->key_index = step;
+        instance->device->current_step = step;
         subbrute_attack_view_set_current_step(view, step);
 
         if(event.event == SubBruteCustomEventTypeTransmitFinished) {
@@ -89,12 +89,12 @@ bool subbrute_scene_run_attack_on_event(void* context, SceneManagerEvent event)
             scene_manager_search_and_switch_to_previous_scene(
                 instance->scene_manager, SubBruteSceneSetupAttack);
         } else if(event.event == SubBruteCustomEventTypeUpdateView) {
-            //subbrute_attack_view_set_current_step(view, instance->device->key_index);
+            //subbrute_attack_view_set_current_step(view, instance->device->current_step);
         }
         consumed = true;
     } else if(event.type == SceneManagerEventTypeTick) {
         uint64_t step = subbrute_worker_get_step(instance->worker);
-        instance->device->key_index = step;
+        instance->device->current_step = step;
         subbrute_attack_view_set_current_step(view, step);
 
         consumed = true;

+ 7 - 7
scenes/subbrute_scene_setup_attack.c

@@ -37,14 +37,14 @@ void subbrute_scene_setup_attack_on_enter(void* context) {
         instance->worker, subbrute_scene_setup_attack_device_state_changed, context);
     if(subbrute_worker_is_running(instance->worker)) {
         subbrute_worker_stop(instance->worker);
-        instance->device->key_index = subbrute_worker_get_step(instance->worker);
+        instance->device->current_step = subbrute_worker_get_step(instance->worker);
     }
 
     subbrute_attack_view_init_values(
         view,
         instance->device->attack,
         instance->device->max_value,
-        instance->device->key_index,
+        instance->device->current_step,
         false,
         instance->device->extra_repeats);
 
@@ -77,7 +77,7 @@ bool subbrute_scene_setup_attack_on_event(void* context, SceneManagerEvent event
                 view,
                 instance->device->attack,
                 instance->device->max_value,
-                instance->device->key_index,
+                instance->device->current_step,
                 false,
                 instance->device->extra_repeats);
             scene_manager_next_scene(instance->scene_manager, SubBruteSceneSaveName);
@@ -86,7 +86,7 @@ bool subbrute_scene_setup_attack_on_event(void* context, SceneManagerEvent event
                 view,
                 instance->device->attack,
                 instance->device->max_value,
-                instance->device->key_index,
+                instance->device->current_step,
                 false,
                 instance->device->extra_repeats);
             scene_manager_next_scene(instance->scene_manager, SubBruteSceneStart);
@@ -99,7 +99,7 @@ bool subbrute_scene_setup_attack_on_event(void* context, SceneManagerEvent event
                 // Blink
                 notification_message(instance->notifications, &sequence_blink_green_100);
                 subbrute_worker_transmit_current_key(
-                    instance->worker, instance->device->key_index);
+                    instance->worker, instance->device->current_step);
                 // Stop
                 notification_message(instance->notifications, &sequence_blink_stop);
             }
@@ -128,9 +128,9 @@ bool subbrute_scene_setup_attack_on_event(void* context, SceneManagerEvent event
         consumed = true;
     } else if(event.type == SceneManagerEventTypeTick) {
         if(subbrute_worker_is_running(instance->worker)) {
-            instance->device->key_index = subbrute_worker_get_step(instance->worker);
+            instance->device->current_step = subbrute_worker_get_step(instance->worker);
         }
-        subbrute_attack_view_set_current_step(view, instance->device->key_index);
+        subbrute_attack_view_set_current_step(view, instance->device->current_step);
         consumed = true;
     }