Prechádzať zdrojové kódy

Merge pull request #8 from leedave/feature/v1.6

Feature/v1.6
David Lee 1 rok pred
rodič
commit
448aac8416
6 zmenil súbory, kde vykonal 18 pridanie a 64 odobranie
  1. 1 1
      application.fam
  2. 0 7
      changelog.md
  3. 2 8
      color_guess.c
  4. 1 8
      color_guess.h
  5. 13 8
      docs/changelog.md
  6. 1 32
      scenes/color_guess_scene_settings.c

+ 1 - 1
application.fam

@@ -11,7 +11,7 @@ App(
     order=10,
     fap_icon="icons/color_guess_10px.png",
     fap_icon_assets="icons",
-    fap_version="1.5",
+    fap_version="1.6",
     fap_category="Games",
     fap_author="Leedave",
     fap_description="Color Guessing Game",

+ 0 - 7
changelog.md

@@ -1,7 +0,0 @@
-## v1.1
-
-Added GFX to start screen
-
-## v1.0
-
-First release to Application Catalog

+ 2 - 8
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;
@@ -38,8 +37,6 @@ ColorGuess* color_guess_app_alloc() {
 
     //Scene additions
     app->view_dispatcher = view_dispatcher_alloc();
-    view_dispatcher_enable_queue(app->view_dispatcher);
-
     app->scene_manager = scene_manager_alloc(&color_guess_scene_handlers, app);
     view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
     view_dispatcher_set_navigation_event_callback(
@@ -111,10 +108,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);

+ 1 - 8
color_guess.h

@@ -17,7 +17,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 +32,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 +50,6 @@ typedef enum {
     ColorGuessHapticOn,
 } ColorGuessHapticState;
 
-typedef enum {
-    ColorGuessSpeakerOff,
-    ColorGuessSpeakerOn,
-} ColorGuessSpeakerState;
-
 typedef enum {
     ColorGuessLedOff,
     ColorGuessLedOn,

+ 13 - 8
docs/changelog.md

@@ -1,21 +1,26 @@
-## 1.5
+## v1.6
+- Reducing code
+- Removal of deprecated view dispatcher queue
+
+## v1.5
 - Additional Memory Management fixes by Willy-JL
 - Redraw Issue fixed by Willy-JL
 - Added GNU License
 - Added version number
 
-## 1.4
-- Prevent value changing on win view
-- Fix issues with FW build 0.99.x
+## v1.4
+- Compatibility for FW above 0.99.0
+- Fix for Value changing on success screen
 
-## 1.3
-- Patched Memory Leak in storage
+## v1.3
+- Fixed minor memory leak in storage
 
 ## v1.2
-- Updated compatibility to 0.95.0-rc
+- Updated Application for Flipper Zero 0.95.0-rc
 
 ## v1.1
-- Updated Launch Screen GFX
+
+Added GFX to start screen
 
 ## v1.0
 

+ 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);