diff options
author | Franklin Wei <git@fwei.tk> | 2017-01-03 11:26:18 -0500 |
---|---|---|
committer | Franklin Wei <git@fwei.tk> | 2017-01-04 20:53:21 -0500 |
commit | 1464cb942b0308c356c667896299d6cf6675bea6 (patch) | |
tree | 69741fa5950298a3eb63c82fe0ed339d94f991b9 /apps/plugins/puzzles/rockbox.c | |
parent | 31907283a4bb3aaa69a5b9cc1c1606271fb58660 (diff) | |
download | rockbox-1464cb942b0308c356c667896299d6cf6675bea6.tar.gz rockbox-1464cb942b0308c356c667896299d6cf6675bea6.zip |
puzzles: minor polishing touches on the user interface
- the debug menu has been neatly hidden away in the classic Android style ;)
- playback control option added to the pause menu when possible
- also fixes a minor redraw issue
Change-Id: I00d0186986a8e659991948336b26b4f2e2a0ce66
Diffstat (limited to 'apps/plugins/puzzles/rockbox.c')
-rw-r--r-- | apps/plugins/puzzles/rockbox.c | 70 |
1 files changed, 60 insertions, 10 deletions
diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c index b64ab7559f..f1c3d45e76 100644 --- a/apps/plugins/puzzles/rockbox.c +++ b/apps/plugins/puzzles/rockbox.c | |||
@@ -60,6 +60,13 @@ static unsigned *colors = NULL; | |||
60 | static int ncolors = 0; | 60 | static int ncolors = 0; |
61 | static long last_keystate = 0; | 61 | static long last_keystate = 0; |
62 | 62 | ||
63 | #ifdef FOR_REAL | ||
64 | /* the "debug menu" is hidden by default in order to avoid the | ||
65 | * naturally ensuing complaints from users */ | ||
66 | static bool debug_mode = false; | ||
67 | static int help_times = 0; | ||
68 | #endif | ||
69 | |||
63 | static void fix_size(void); | 70 | static void fix_size(void); |
64 | 71 | ||
65 | static struct viewport clip_rect; | 72 | static struct viewport clip_rect; |
@@ -899,6 +906,14 @@ static const struct { | |||
899 | 906 | ||
900 | static void quick_help(void) | 907 | static void quick_help(void) |
901 | { | 908 | { |
909 | #ifdef FOR_REAL | ||
910 | if(++help_times >= 5) | ||
911 | { | ||
912 | rb->splash(HZ, "You are now a developer!"); | ||
913 | debug_mode = true; | ||
914 | } | ||
915 | #endif | ||
916 | |||
902 | for(int i = 0; i < ARRAYLEN(quick_help_text); ++i) | 917 | for(int i = 0; i < ARRAYLEN(quick_help_text); ++i) |
903 | { | 918 | { |
904 | if(!strcmp(midend_which_game(me)->name, quick_help_text[i].game)) | 919 | if(!strcmp(midend_which_game(me)->name, quick_help_text[i].game)) |
@@ -938,7 +953,7 @@ static void debug_menu(void) | |||
938 | switch(rb->do_menu(&menu, &sel, NULL, false)) | 953 | switch(rb->do_menu(&menu, &sel, NULL, false)) |
939 | { | 954 | { |
940 | case 0: | 955 | case 0: |
941 | rb->set_int("Slowmo factor", "", UNIT_INT, &settings.slowmo_factor, NULL, 1, 1, 10, NULL); | 956 | rb->set_int("Slowmo factor", "", UNIT_INT, &settings.slowmo_factor, NULL, 1, 1, 15, NULL); |
942 | break; | 957 | break; |
943 | case 1: | 958 | case 1: |
944 | { | 959 | { |
@@ -993,16 +1008,27 @@ static int pausemenu_cb(int action, const struct menu_item_ex *this_item) | |||
993 | break; | 1008 | break; |
994 | #endif | 1009 | #endif |
995 | case 8: | 1010 | case 8: |
1011 | #ifdef COMBINED | ||
1012 | /* audio buf is used, so no playback */ | ||
1013 | /* TODO: neglects app builds, but not many people will | ||
1014 | * care, I bet */ | ||
1015 | return ACTION_EXIT_MENUITEM; | ||
1016 | #else | ||
1017 | break; | ||
1018 | #endif | ||
1019 | case 9: | ||
996 | if(!midend_num_presets(me)) | 1020 | if(!midend_num_presets(me)) |
997 | return ACTION_EXIT_MENUITEM; | 1021 | return ACTION_EXIT_MENUITEM; |
998 | break; | 1022 | break; |
999 | case 9: | 1023 | case 10: |
1000 | #ifdef FOR_REAL | 1024 | #ifdef FOR_REAL |
1025 | if(debug_mode) | ||
1026 | break; | ||
1001 | return ACTION_EXIT_MENUITEM; | 1027 | return ACTION_EXIT_MENUITEM; |
1002 | #else | 1028 | #else |
1003 | break; | 1029 | break; |
1004 | #endif | 1030 | #endif |
1005 | case 10: | 1031 | case 11: |
1006 | if(!midend_which_game(me)->can_configure) | 1032 | if(!midend_which_game(me)->can_configure) |
1007 | return ACTION_EXIT_MENUITEM; | 1033 | return ACTION_EXIT_MENUITEM; |
1008 | break; | 1034 | break; |
@@ -1026,6 +1052,7 @@ static int pause_menu(void) | |||
1026 | "Solve", | 1052 | "Solve", |
1027 | "Quick Help", | 1053 | "Quick Help", |
1028 | "Extensive Help", | 1054 | "Extensive Help", |
1055 | "Playback Control", | ||
1029 | "Game Type", | 1056 | "Game Type", |
1030 | "Debug Menu", | 1057 | "Debug Menu", |
1031 | "Configure Game", | 1058 | "Configure Game", |
@@ -1041,6 +1068,10 @@ static int pause_menu(void) | |||
1041 | rb->snprintf(title, sizeof(title), "%s Menu", midend_which_game(me)->name); | 1068 | rb->snprintf(title, sizeof(title), "%s Menu", midend_which_game(me)->name); |
1042 | menu__.desc = title; | 1069 | menu__.desc = title; |
1043 | 1070 | ||
1071 | #ifdef FOR_REAL | ||
1072 | help_times = 0; | ||
1073 | #endif | ||
1074 | |||
1044 | bool quit = false; | 1075 | bool quit = false; |
1045 | int sel = 0; | 1076 | int sel = 0; |
1046 | while(!quit) | 1077 | while(!quit) |
@@ -1089,31 +1120,34 @@ static int pause_menu(void) | |||
1089 | full_help(); | 1120 | full_help(); |
1090 | break; | 1121 | break; |
1091 | case 8: | 1122 | case 8: |
1123 | playback_control(NULL); | ||
1124 | break; | ||
1125 | case 9: | ||
1092 | presets_menu(); | 1126 | presets_menu(); |
1093 | midend_new_game(me); | 1127 | midend_new_game(me); |
1094 | fix_size(); | 1128 | fix_size(); |
1095 | quit = true; | 1129 | quit = true; |
1096 | break; | 1130 | break; |
1097 | case 9: | 1131 | case 10: |
1098 | debug_menu(); | 1132 | debug_menu(); |
1099 | break; | 1133 | break; |
1100 | case 10: | 1134 | case 11: |
1101 | config_menu(); | 1135 | config_menu(); |
1102 | midend_new_game(me); | 1136 | midend_new_game(me); |
1103 | fix_size(); | 1137 | fix_size(); |
1104 | quit = true; | 1138 | quit = true; |
1105 | break; | 1139 | break; |
1106 | #ifdef COMBINED | 1140 | #ifdef COMBINED |
1107 | case 11: | ||
1108 | return -1; | ||
1109 | case 12: | 1141 | case 12: |
1110 | return -2; | 1142 | return -1; |
1111 | case 13: | 1143 | case 13: |
1144 | return -2; | ||
1145 | case 14: | ||
1112 | return -3; | 1146 | return -3; |
1113 | #else | 1147 | #else |
1114 | case 11: | ||
1115 | return -2; | ||
1116 | case 12: | 1148 | case 12: |
1149 | return -2; | ||
1150 | case 13: | ||
1117 | return -3; | 1151 | return -3; |
1118 | #endif | 1152 | #endif |
1119 | default: | 1153 | default: |
@@ -1576,6 +1610,10 @@ enum plugin_status plugin_start(const void *param) | |||
1576 | rb->cpu_boost(false); | 1610 | rb->cpu_boost(false); |
1577 | #endif | 1611 | #endif |
1578 | 1612 | ||
1613 | #ifdef FOR_REAL | ||
1614 | help_times = 0; | ||
1615 | #endif | ||
1616 | |||
1579 | #ifndef COMBINED | 1617 | #ifndef COMBINED |
1580 | #define static auto | 1618 | #define static auto |
1581 | #define const | 1619 | #define const |
@@ -1625,9 +1663,21 @@ enum plugin_status plugin_start(const void *param) | |||
1625 | break; | 1663 | break; |
1626 | case 5: | 1664 | case 5: |
1627 | presets_menu(); | 1665 | presets_menu(); |
1666 | if(!load_success) | ||
1667 | { | ||
1668 | clear_and_draw(); | ||
1669 | goto game_loop; | ||
1670 | } | ||
1671 | quit = true; | ||
1628 | break; | 1672 | break; |
1629 | case 6: | 1673 | case 6: |
1630 | config_menu(); | 1674 | config_menu(); |
1675 | if(!load_success) | ||
1676 | { | ||
1677 | clear_and_draw(); | ||
1678 | goto game_loop; | ||
1679 | } | ||
1680 | quit = true; | ||
1631 | break; | 1681 | break; |
1632 | case 8: | 1682 | case 8: |
1633 | if(load_success) | 1683 | if(load_success) |