David Lee 1 год назад
Родитель
Сommit
63a816b6f6
6 измененных файлов с 30 добавлено и 46 удалено
  1. 2 0
      .vscode/compile_commands.json
  2. 19 0
      changelog.md
  3. 3 6
      color_guess.c
  4. 2 8
      color_guess.h
  5. 3 0
      docs/changelog.md
  6. 1 32
      scenes/color_guess_scene_settings.c

Разница между файлами не показана из-за своего большого размера
+ 2 - 0
.vscode/compile_commands.json


+ 19 - 0
changelog.md

@@ -1,3 +1,22 @@
+## v1.6
+- Reducing code
+
+## v1.5
+- Additional Memory Management fixes by Willy-JL
+- Redraw Issue fixed by Willy-JL
+- Added GNU License
+- Added version number
+
+## v1.4
+- Compatibility for FW above 0.99.0
+- Fix for Value changing on success screen
+
+## v1.3
+- Fixed minor memory leak in storage
+
+## v1.2
+- Updated Application for Flipper Zero 0.95.0-rc
+
 ## v1.1
 
 Added GFX to start screen

+ 3 - 6
color_guess.c

@@ -24,8 +24,7 @@ ColorGuess* color_guess_app_alloc() {
     ColorGuess* app = malloc(sizeof(ColorGuess));
     app->gui = furi_record_open(RECORD_GUI);
     app->notification = furi_record_open(RECORD_NOTIFICATION);
-    app->error = false;
-
+    
     // Set Defaults if no config exists
     app->haptic = 1;
     app->led = 1;
@@ -87,6 +86,7 @@ void color_guess_app_free(ColorGuess* app) {
     // View Dispatcher
     view_dispatcher_remove_view(app->view_dispatcher, ColorGuessViewIdStartscreen);
     color_guess_startscreen_free(app->color_guess_startscreen);
+    dialog_ex_free(app->dialog_ex);
     view_dispatcher_remove_view(app->view_dispatcher, ColorGuessViewIdMenu);
     submenu_free(app->submenu);
     view_dispatcher_remove_view(app->view_dispatcher, ColorGuessViewIdPlay);
@@ -111,10 +111,7 @@ void color_guess_app_free(ColorGuess* app) {
 int32_t color_guess_app(void* p) {
     UNUSED(p);
     ColorGuess* app = color_guess_app_alloc();
-    if(app->error) {
-        return 255;
-    }
-
+    
     view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
 
     scene_manager_next_scene(app->scene_manager, ColorGuessSceneStartscreen);

+ 2 - 8
color_guess.h

@@ -9,6 +9,7 @@
 #include <gui/view_dispatcher.h>
 #include <gui/modules/submenu.h>
 #include <gui/scene_manager.h>
+#include <gui/modules/dialog_ex.h>
 #include <gui/modules/variable_item_list.h>
 #include "helpers/color_guess_custom_event.h"
 #include "scenes/color_guess_scene.h"
@@ -17,7 +18,7 @@
 #include "views/color_guess_startscreen.h"
 #include "helpers/color_guess_storage.h"
 
-#define COLOR_GUESS_VERSION "1.5"
+#define COLOR_GUESS_VERSION "1.6"
 #define TAG "Color_Guess"
 
 typedef struct {
@@ -32,9 +33,7 @@ typedef struct {
     ColorGuessPlay* color_guess_play;
     ColorGuessStartscreen* color_guess_startscreen;
     Submenu* color_guess_settings;
-    bool error;
     uint32_t haptic;
-    //uint32_t speaker;
     uint32_t led;
     uint32_t save_settings;
 } ColorGuess;
@@ -52,11 +51,6 @@ typedef enum {
     ColorGuessHapticOn,
 } ColorGuessHapticState;
 
-typedef enum {
-    ColorGuessSpeakerOff,
-    ColorGuessSpeakerOn,
-} ColorGuessSpeakerState;
-
 typedef enum {
     ColorGuessLedOff,
     ColorGuessLedOn,

+ 3 - 0
docs/changelog.md

@@ -1,3 +1,6 @@
+## 1.6
+- Reducing code
+
 ## 1.5
 - Additional Memory Management fixes by Willy-JL
 - Redraw Issue fixed by Willy-JL

+ 1 - 32
scenes/color_guess_scene_settings.c

@@ -11,22 +11,12 @@ const char* const haptic_text[2] = {
     "OFF",
     "ON",
 };
+
 const uint32_t haptic_value[2] = {
     ColorGuessHapticOff,
     ColorGuessHapticOn,
 };
 
-/* Speaker currently not used
-const char* const speaker_text[2] = {
-    "OFF",
-    "ON",
-};
-const uint32_t speaker_value[2] = {
-    ColorGuessSpeakerOff,
-    ColorGuessSpeakerOn,
-};
-*/
-
 /* Game doesn't make sense with LED off, but the setting is there */
 const char* const led_text[2] = {
     "OFF",
@@ -45,15 +35,6 @@ static void color_guess_scene_settings_set_haptic(VariableItem* item) {
     app->haptic = haptic_value[index];
 }
 
-/*
-static void color_guess_scene_settings_set_speaker(VariableItem* item) {
-    ColorGuess* app = variable_item_get_context(item);
-    uint8_t index = variable_item_get_current_value_index(item);
-    variable_item_set_current_value_text(item, speaker_text[index]);
-    app->speaker = speaker_value[index];
-}
-*/
-
 static void color_guess_scene_settings_set_led(VariableItem* item) {
     ColorGuess* app = variable_item_get_context(item);
     uint8_t index = variable_item_get_current_value_index(item);
@@ -78,18 +59,6 @@ void color_guess_scene_settings_on_enter(void* context) {
     variable_item_set_current_value_index(item, value_index);
     variable_item_set_current_value_text(item, haptic_text[value_index]);
 
-    // Sound on/off
-    /*
-    item = variable_item_list_add(
-        app->variable_item_list,
-        "Sound:",
-        2,
-        color_guess_scene_settings_set_speaker,
-        app);
-    value_index = value_index_uint32(app->speaker, speaker_value, 2);
-    variable_item_set_current_value_index(item, value_index);
-    variable_item_set_current_value_text(item, speaker_text[value_index]);*/
-
     // LED Effects on/off
     item = variable_item_list_add(
         app->variable_item_list, "LED FX:", 2, color_guess_scene_settings_set_led, app);

Некоторые файлы не были показаны из-за большого количества измененных файлов