a1ex avatar a1ex committed eaf2b35

Removed latest menu tweaks (bad feedback from some devs)

Comments (0)

Files changed (5)

platform/5DC.111/consts.h

 
 #define AE_VALUE 0 // 404
 
-#define CURRENT_DIALOG_MAYBE 0
-
 #define PLAY_MODE (gui_state == GUISTATE_PLAYMENU && MEM(0x27D8) && !MEM(0x3D50)) // StartPl1App, but not StartPlEraseApp
 #define MENU_MODE (gui_state == GUISTATE_PLAYMENU && MEM(0x4C48)) // StartMenuMainHeaderApp
 
+#define CURRENT_DIALOG_MAYBE (gui_state == GUISTATE_PLAYMENU ? 1 : 0)
+
 #define NUM_PICSTYLES 9
 #define PROP_PICSTYLE_SETTINGS(i) (PROP_PICSTYLE_SETTINGS_STANDARD - 1 + i)
 
 
 #define DOUBLE_BUFFERING 1
 
-//~ #define MENU_KEYHELP_Y_POS (menu_lv_transparent_mode ? 425 : 430)
-#define MENU_HELP_Y_POS 435
-#define MENU_HELP_Y_POS_2 458
+#define MENU_KEYHELP_Y_POS (menu_lv_transparent_mode ? 425 : 430)
+#define MENU_HELP_Y_POS 453
+#define MENU_WARNING_Y_POS (menu_lv_transparent_mode ? 425 : 453)
 
 #define MENU_BG_COLOR_HEADER_FOOTER COLOR_GRAY40
 
     return 40;
 }
 
-/* not reliable
-
-// checks whether (x,y,w,h) covers some text
-// returns 1 if it does not
-static int check_free(int x0, int y0, int w, int h)
+void submenu_icon(int x, int y)
 {
-    uint8_t* B = bmp_vram();
-    
-    #define P(x,y) B[BM(x,y)]
-    
-    int c0 = P(x0,y0);
-    for (int y = y0; y < y0 + h; y++)
-    {
-        for (int x = x0; x < x0 + w; x++)
-        {
-            if (P(x,y) != c0 && P(x,y) != COLOR_BLACK)
-                return 0;
-        }
-    }
-    #undef P
-    return 1;
-}
-
-// try to find a place to display the submenu key hint
-static int find_free(int* x0, int* y0, int w, int h)
-{
-    if (check_free(*x0, *y0, w, h)) return 0;
-    if (check_free(*x0, *y0-25, w, h)) { *y0 -= 25; return 1; }
-    return -1;
-}
-
-// helper to hide key hints if they overlap menu texts
-static int key_hint_check_overlap(int x, int y, int w, int h)
-{
-    int ok = check_free(x, y, w, h); // alright! (but don't return right away; update the timers)
-    
-    // maybe we can't display it without overwriting, so we'll erase it after a while
-    static int prev_y = 0;
-    static int prev_clk = 0;
-    int clk = get_ms_clock_value();
-    if (prev_y != y)
-        prev_clk = clk;
-    prev_y = y;
-    
-    if (ok) return 1; // alright!
-
-    if (prev_y == y && clk > prev_clk + 700)
-    {
-        return 0; // do not display
-    }
-    return 1; // display (temporarily)
-}
-*/
-
-static int key_hint_check_display_timeout(int x, int y, int w, int h, int keytype, int timeout)
-{
-    
-    // whenever the selected item or the key hint changes, re-display the hint
-    static int prev_sig = 0;
-    static int prev_clk = 0;
-    int clk = get_ms_clock_value();
-    int sig = y + keytype * 12345;
-    if (prev_sig != sig)
-        prev_clk = clk;
-    prev_sig = sig;
-
-    if (prev_sig == sig && clk > prev_clk + timeout)
-    {
-        return 0; // do not display
-    }
-    return 1; // display (temporarily)
-}
-
-// draw submenu dots (for non-selected items)
-static void submenu_marker(int x, int y)
-{
-    if (submenu_mode) return;
-    int fnt = SHADOW_FONT(FONT(FONT_MED, COLOR_CYAN, COLOR_BLACK));
-    bmp_printf(fnt, 685, y+14, "...");
-}
-
-static void submenu_key_hint(int x, int y)
-{
-    if (submenu_mode) return;
-
-    int fnt = SHADOW_FONT(FONT(FONT_MED, COLOR_CYAN, COLOR_BLACK));
-
-    int w = font_med.width * strlen(Q_BTN_NAME);
-    int h = font_med.height;
-    x = 720 - w;
-
-    if (!key_hint_check_display_timeout(x, y, w, h, 2, 1000))
-    {
-        submenu_marker(x, y); // print this one instead, it's smaller
-        return;
-    }
-
-    y += 6;
-    bmp_fill(COLOR_BLUE, x - 4, y - 4, w + 8, h + 8);
-    bmp_printf(fnt, x, y, Q_BTN_NAME);
-}
-
-static void edit_key_hint(int x, int y)
-{
+    //~ int color = COLOR_WHITE;
     x -= 40;
-    int w = 40;
-    int h = 30;
-
-    if (!key_hint_check_display_timeout(x, y, w, h, 1, 1000))
-        return; // do not display
-
-    bmp_fill(COLOR_LIGHTBLUE, x - 10, y, w + 20, h);
-
-    y -= 5;
-    if (CURRENT_DIALOG_MAYBE)
-        bfnt_draw_char(ICON_MAINDIAL, x, y, COLOR_CYAN, COLOR_BLUE);
-    else
-        leftright_sign(x + 20, y + 5);
-}
-
-// just for keeping timeouts updated
-static void dummy_hint(int x, int y)
-{
-    key_hint_check_display_timeout(x, y, 0, 0, 0, 1000);
+    bmp_draw_rect(45, x+2, y+5, 32-3, 32-10+1);
+    draw_line(x+20, y+28, x+30, y+28, COLOR_WHITE);
+    for (int i = -2; i <= 2; i++)
+    draw_line(x+26, y+28+i, x+30, y+28, COLOR_WHITE);
+    //~ for (int r = 0; r < 2; r++)
+    //~ {
+        //~ draw_circle(x + 30, y + 28, r, color);
+        //~ draw_circle(x + 23, y + 28, r, color);
+        //~ draw_circle(x + 16, y + 28, r, color);
+    //~ }
 }
 
 void submenu_only_icon(int x, int y, int value)
             }
         }
     }
-    #undef P
 }
 
 void dim_hidden_menu(int x0, int y0, int selected)
     return buf;
 }
 
-static void menu_clean_footer()
-{
-    int h = 50;
-    if (is_menu_active("Help")) h += 10;
-    int bgu = MENU_BG_COLOR_HEADER_FOOTER;
-    int fgu = COLOR_GRAY50;
-    bmp_fill(fgu, 0, 480-h-1, 720, 1);
-    bmp_fill(bgu, 0, 480-h, 720, h);
-}
-
 static void
 menu_display(
     struct menu * parentmenu,
     }
     //<== vscroll
 
-    if (!menu_lv_transparent_mode)
-        menu_clean_footer();
-
     int menu_entry_num = 0;
     while( menu )
     {
 
         if (advanced_hidden_edit_mode || IS_VISIBLE(menu))
         {
-
             // display help (should be first; if there are too many items in menu, the main text should overwrite the help, not viceversa)
-            if (menu->selected && menu->help && !menu_lv_transparent_mode)
+            if (menu->selected && menu->help)
             {
                 bmp_printf(
+                    FONT(FONT_MED, 0xC, MENU_BG_COLOR_HEADER_FOOTER), // red
+                     10,  MENU_HELP_Y_POS, 
+                        "                                                           "
+                );
+                bmp_printf(
                     FONT(FONT_MED, COLOR_WHITE, MENU_BG_COLOR_HEADER_FOOTER), 
                      10,  MENU_HELP_Y_POS, 
-                    menu->help
+                    menu_help_get_line(menu->help, menu->priv)
                 );
-
-                if (menu->help2)
-                {
-                    bmp_printf(
-                        FONT(FONT_MED, COLOR_WHITE, MENU_BG_COLOR_HEADER_FOOTER), 
-                         10,  MENU_HELP_Y_POS_2, 
-                        menu_help_get_line(menu->help2, menu->priv)
-                    );
-                }
             }
 
             // display icon (only the first icon is drawn)
                 entry_draw_icon(menu, x, y);
             }
 
-            // display key hints
-            if (menu->selected && (menu->priv || menu->select))
+            // display key help
+            if (menu->selected && !is_menu_active("Help") && (menu->priv || menu->select) && y + font_large.height <  430)
             {
-                if (submenu_mode == 1)
+                char msg[100] = "";
+
+                // this should follow exactly the same logic as in menu_entry_select
+                // todo: remove duplicate code
+                
+                
+                // exception for action and submenu items
+                if (icon_drawn == MNI_ACTION && !submenu_mode)
                 {
-                    if (IS_SUBMENU(parentmenu) && icon_drawn != MNI_ACTION)
-                        edit_key_hint(360 + g_submenu_width/2 - 10, y);
+                    STR_APPEND(msg, "SET: run action         ");
                 }
-                else if (submenu_mode == 2 || menu_lv_transparent_mode)
+                else if (menu->select == menu_open_submenu)
                 {
-                    if (icon_drawn != MNI_ACTION)
-                        edit_key_hint(710, y);
+                    STR_APPEND(msg, "SET: open submenu       ");
+                }
+                // exception end
+                
+                else if (submenu_mode == 2)
+                {
+                    STR_APPEND(msg, "SET: toggle edit mode   ");
+                }
+                else if (menu_lv_transparent_mode)
+                {
+                    STR_APPEND(msg, "SET: toggle LiveView    ");
+                }
+                else if (menu->edit_mode == EM_FEW_VALUES) // SET increments
+                {
+                    STR_APPEND(msg, "SET: change value       ");
+                }
+                else if (menu->edit_mode == EM_MANY_VALUES)
+                {
+                    STR_APPEND(msg, "SET: toggle edit mode   ");
+                }
+                else if (menu->edit_mode == EM_MANY_VALUES_LV)
+                {
+                    if (lv)
+                    {
+                        STR_APPEND(msg, "SET: toggle LiveView    ");
+                    }
+                    else if (submenu_mode != 1)
+                    {
+                        STR_APPEND(msg, "SET: toggle edit mode   ");
+                    }
+                    else // increment
+                    {
+                        STR_APPEND(msg, "SET: change value       ");
+                    }
+                }
+
+
+                if (submenu_mode || menu_lv_transparent_mode || only_selected)
+                {
+                    STR_APPEND(msg, "      ");
+                    if (CURRENT_DIALOG_MAYBE) // GUIMode nonzero => wheel events working
+                    {
+                        STR_APPEND(msg, "L/R/Wheel : ");
+                    }
+                    else
+                    {
+                        STR_APPEND(msg, "Left/Right: ");
+                    }
+                    if (icon_drawn == MNI_ACTION)
+                    {
+                        STR_APPEND(msg, "run action  ");
+                    }
+                    else
+                    {
+                        STR_APPEND(msg, "change value");
+                    }
+
+                    if (CURRENT_DIALOG_MAYBE) // we can use scrollwheel
+                        bfnt_draw_char(ICON_MAINDIAL, 680, 415, COLOR_CYAN, MENU_BG_COLOR_HEADER_FOOTER);
+                    else
+                        leftright_sign(690, 415);
                 }
                 else if (menu->children && !submenu_mode && !menu_lv_transparent_mode)
                 {
-                    if (icon_drawn != MNI_SUBMENU)
-                        submenu_key_hint(x, y);
+                    char *button = Q_BTN_NAME;
+                    
+                    int nspaces = 16 - strlen(button);
+                    for (int i = 0; i < nspaces; i++) { STR_APPEND(msg, " "); }
+                    
+                    STR_APPEND(msg, "%s: open submenu ", button);
                 }
-                else dummy_hint(x, y);
                 
-                if (!CURRENT_DIALOG_MAYBE)
+                //~ while (strlen(msg) < 60) { STR_APPEND(msg, " "); }
+
+                
+                bmp_printf(
+                    FONT(FONT_MED, COLOR_CYAN, MENU_BG_COLOR_HEADER_FOOTER), 
+                     10,  MENU_KEYHELP_Y_POS, 
+                    msg
+                );
+                
+                if (!submenu_mode && !menu_lv_transparent_mode) // we can use scrollwheel for navigation
                 {
-                    // we can't use the scrollwheel
-                    // and you need to be careful because you will change shooting settings while recording!
-                    bfnt_draw_char(ICON_MAINDIAL, 680, 5, MENU_WARNING_COLOR, MENU_BG_COLOR_HEADER_FOOTER);
-                    draw_line(720, 15, 680, 37, MENU_WARNING_COLOR);
-                    draw_line(720, 16, 680, 38, MENU_WARNING_COLOR);
+                    bfnt_draw_char(ICON_MAINDIAL, 680, 415, COLOR_GRAY50, MENU_BG_COLOR_HEADER_FOOTER);
+                    if (!CURRENT_DIALOG_MAYBE) // wait, we CAN'T use it... 
+                                               // and you need to be careful because you will change shooting settings while recording!
+                    {
+                        bfnt_draw_char(ICON_MAINDIAL, 680, 415, MENU_WARNING_COLOR, MENU_BG_COLOR_HEADER_FOOTER);
+                        draw_line(720, 430, 680, 445, MENU_WARNING_COLOR);
+                        draw_line(720, 431, 680, 446, MENU_WARNING_COLOR);
+                    }
                 }
             }
 
             // if there's a warning message set, display it
             if (menu->selected && warning_msg)
             {
+                bmp_printf(
+                    FONT(FONT_MED, COLOR_WHITE, MENU_BG_COLOR_HEADER_FOOTER),
+                     10,  MENU_WARNING_Y_POS, 
+                        "                                                            "
+                );
 
                 bmp_printf(
                     FONT(FONT_MED, MENU_WARNING_COLOR, MENU_BG_COLOR_HEADER_FOOTER),
-                     10,  MENU_HELP_Y_POS_2, 
+                     10,  MENU_WARNING_Y_POS, 
                         warning_msg
                 );
             }
 
             // display submenu marker if this item has a submenu
             if (menu->children && !menu_lv_transparent_mode)
-                if (!menu->selected || icon_drawn == MNI_SUBMENU)
-                    submenu_marker(x, y);
+                submenu_icon(x, y);
             
             // display selection bar
             if (menu->selected)
             hidden_msg[55] = '\0';
         }
 
-        int hidden_pos_y = 410;
+        int hidden_pos_y = MENU_KEYHELP_Y_POS;
         if (is_menu_active("Help")) hidden_pos_y -= font_med.height;
+        if (hidden_count || force_clear)
+        {
+            bmp_printf(
+                FONT(FONT_MED, COLOR_GRAY45, MENU_BG_COLOR_HEADER_FOOTER), 
+                 10,  hidden_pos_y, 
+                "                                                       "
+            );
+        }
         if (hidden_count)
         {
-            bmp_fill(0, 0, hidden_pos_y, 720, 19);
             bmp_printf(
-                SHADOW_FONT(FONT(FONT_MED, advanced_hidden_edit_mode ? MENU_WARNING_COLOR : COLOR_ORANGE , MENU_BG_COLOR_HEADER_FOOTER)), 
+                FONT(FONT_MED, advanced_hidden_edit_mode ? MENU_WARNING_COLOR : COLOR_ORANGE , MENU_BG_COLOR_HEADER_FOOTER), 
                  10, hidden_pos_y, 
                  hidden_msg
             );
     int menu_len = get_menu_len(parent);
     
     if(max > menu_len){
-        bmp_draw_rect(COLOR_GRAY50, 718, 43, 1, 385);
-        int16_t posx = 43 + (335 * (pos-1) / (max-1));
+        bmp_draw_rect(COLOR_GRAY50, 718, 43, 1, 375);
+        int16_t posx = 43 + (325 * (pos-1) / (max-1));
         bmp_fill(COLOR_WHITE, 717, posx, 4, 50);
     }
 }
         num_tabs++;
     }
     
-    int icon_spacing = (720 - 130 - 40) / num_tabs;
+    int icon_spacing = (720 - 130) / num_tabs;
     
     int bgs = COLOR_BLACK;
     int bgu = MENU_BG_COLOR_HEADER_FOOTER;
 
     bmp_fill(bgu, orig_x, y, 720, 42);
     bmp_fill(fgu, orig_x, y+42, 720, 1);
+    bmp_fill(fgu, orig_x, 480-61, 720, 1);
+    bmp_fill(bgu, orig_x, 480-60, 720, 60);
     for( ; menu ; menu = menu->next )
     {
         if (!menu_has_visible_items(menu->children) && !menu->selected)
         bmp_draw_rect(COLOR_WHITE,  bx,  by, 720-2*bx, h);
         bfnt_puts(submenu->name,  bx + 15,  by + 5, COLOR_WHITE, 40);
     }
-    
-    bmp_printf(
-        FONT(FONT_MED, COLOR_CYAN, MENU_BG_COLOR_HEADER_FOOTER), 
-        bx + w - 10 - font_med.width * strlen(Q_BTN_NAME), 
-        by + 15, 
-        Q_BTN_NAME
-    );
 
+    show_hidden_items(submenu, 1);
     menu_display(submenu,  bx + 50,  by + 50 + 25, 0);
-    show_hidden_items(submenu, 1);
 }
 
 static void
 
                 if (submenu_mode)
                 {
-                    if (!menu_lv_transparent_mode && !quick_redraw) bmp_dim(0, 480-52);
+                    if (!menu_lv_transparent_mode && !quick_redraw) bmp_dim(0, 480-62);
                     struct menu * submenu = get_current_submenu();
                     if (submenu) submenu_display(submenu);
                     else implicit_submenu_display();
     if (gui_state == GUISTATE_MENUDISP) return;
     NotifyBoxHide();
     int new_gui_mode = GUIMODE_ML_MENU;
+    new_gui_mode = 0;
     if (new_gui_mode) { redraw_flood_stop = 0; task_create("menu_redraw_flood", 0x1c, 0, menu_redraw_flood, 0); }
     if (new_gui_mode != CURRENT_DIALOG_MAYBE) 
     { 
         int8_t icon_type;
         int8_t edit_mode;
         const char * help;
-        const char * help2;
         const char * name; // used for context help and sometimes for display
         struct menu_entry * children;
         //~ uint32_t id; // unique ID (not supported; menus are identified by strings)
                 .max = 2,
                 .icon_type = IT_DICE,
                 .choices = (const char *[]) {"Exposure (Tv,Ae)", "Exposure (Flash)", "DOF (Aperture)"},
-                .help  = "Choose the variables to bracket:",
-                .help2 = "Expo bracket. M: changes shutter. Others: changes AEcomp.\n"
-                         "Flash bracket: change flash exposure compensation.\n"
-                         "DOF bracket: keep exposure constant, change Av/Tv ratio.",
+                .help = "Expo bracket. M: changes shutter. Others: changes AEcomp.\n"
+                        "Flash bracket: change flash exposure compensation.\n"
+                        "DOF bracket: keep exposure constant, change Av/Tv ratio.",
             },
             {
                 .name = "Frames",
                 .max = 2,
                 .icon_type = IT_DICE_OFF,
                 .choices = (const char *[]) {"OFF", "Smooth ramping", "LRT Holy Grail 1EV"},
-                .help = "Choose the algorithm for automatic bulb ramping.",
-                .help2 = " \n"
+                .help = "Choose the algorithm for automatic bulb ramping.\n"
                         "Feedback loop. Works best with expos longer than 1 second.\n"
                         "Expo is adjusted in 1EV integer steps. vimeo.com/26083323",
             },
                 .max = 2,
                 .choices = (const char *[]) {"Expo. change", "Frame diff.", "Steady hands"},
                 .icon_type = IT_DICE,
-                .help  = "Choose when the picture should be taken:",
-                .help2 = "EXP: reacts to exposure changes (large movements).\n"
-                         "DIF: detects smaller movements that do not change exposure.\n"
-                         "STDY: take pic if there's little or no motion (cam steady).",
+                .help = "EXP: reacts to exposure changes (large movements).\n"
+                        "DIF: detects smaller movements that do not change exposure.\n"
+                        "STDY: take pic if there's little or no motion (cam steady).",
             },
             {
                 .name = "Trigger level",
                 .priv = &focus_peaking_filter_edges,
                 .max = 2,
                 .choices = (const char *[]) {"Strong edges", "Balanced", "Fine details"},
-                .help  = "Fine-tune the focus detection algorithm:",
-                .help2 = "Strong edges: looks for edges, works best in low light.\n"
-                         "Balanced: tries to cover both strong edges and fine details.\n"
-                         "Fine details: looks for microcontrast. Needs lots of light.\n",
+                .help = "Highlights strong edges. Works best in low light.\n"
+                        "Tries to highlight both strong edges and fine details.\n"
+                        "Highlights fine details (texture). Requires lots of light.\n",
                 .icon_type = IT_DICE
             },
             {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.