diff options
Diffstat (limited to 'source/nds')
-rw-r--r-- | source/nds/draw.c | 16 | ||||
-rw-r--r-- | source/nds/draw.h | 42 | ||||
-rw-r--r-- | source/nds/gui.c | 55 |
3 files changed, 78 insertions, 35 deletions
diff --git a/source/nds/draw.c b/source/nds/draw.c index 793b6ca..9a96e43 100644 --- a/source/nds/draw.c +++ b/source/nds/draw.c @@ -106,8 +106,12 @@ struct gui_iconlist gui_icon_list[]= { /* 34 */ {"sbutto", 76, 16, NULL} }; +u16 COLOR_BG = COLOR16( 0, 0, 0); u16 COLOR_INACTIVE_ITEM = COLOR16( 0, 0, 0); u16 COLOR_ACTIVE_ITEM = COLOR16(31, 31, 31); +u16 COLOR_MSSG = COLOR16( 0, 0, 0); +u16 COLOR_INACTIVE_MAIN = COLOR16(31, 31, 31); +u16 COLOR_ACTIVE_MAIN = COLOR16(31, 31, 31); /* @@ -624,6 +628,7 @@ void draw_hscroll_over(u32 index) /* * Drawing dialog */ +/* void draw_dialog(void* screen_addr, u32 sx, u32 sy, u32 ex, u32 ey) { drawboxfill(screen_addr, sx + 5, sy + 5, ex + 5, ey + 5, COLOR_DIALOG_SHADOW); @@ -650,6 +655,7 @@ void draw_dialog(void* screen_addr, u32 sx, u32 sy, u32 ex, u32 ey) drawboxfill(screen_addr, sx, sy, ex, ey, COLOR_DIALOG); } +*/ /* * Draw yes or no dialog @@ -1116,10 +1122,18 @@ int color_init() { *colon = '\0'; u16* color = NULL; - if (strcasecmp(current_line, "ActiveItem") == 0) + if (strcasecmp(current_line, "Background") == 0) + color = &COLOR_BG; + else if (strcasecmp(current_line, "ActiveItem") == 0) color = &COLOR_ACTIVE_ITEM; else if (strcasecmp(current_line, "InactiveItem") == 0) color = &COLOR_INACTIVE_ITEM; + else if (strcasecmp(current_line, "MessageText") == 0) + color = &COLOR_MSSG; + else if (strcasecmp(current_line, "ActiveMain") == 0) + color = &COLOR_ACTIVE_MAIN; + else if (strcasecmp(current_line, "InactiveMain") == 0) + color = &COLOR_INACTIVE_MAIN; if (color != NULL) { diff --git a/source/nds/draw.h b/source/nds/draw.h index 904798a..b696407 100644 --- a/source/nds/draw.h +++ b/source/nds/draw.h @@ -61,25 +61,25 @@ #define COLOR_TRANS COLOR16(31, 31, 63) #define COLOR_WHITE COLOR16(31, 31, 31) #define COLOR_BLACK COLOR16( 0, 0, 0) -#define COLOR_TEXT COLOR16(31, 31, 31) -#define COLOR_PROGRESS_TEXT COLOR16( 0, 0, 0) -#define COLOR_PROGRESS_BAR COLOR16(15, 15, 15) -#define COLOR_ERROR COLOR16(31, 0, 0) -#define COLOR_BG COLOR16(2, 4, 10) -#define COLOR_BG32 COLOR32(2*8, 4*8, 10*8) -#define COLOR_ROM_INFO COLOR16(22, 18, 26) -#define COLOR_HELP_TEXT COLOR16(16, 20, 24) -#define COLOR_DIALOG COLOR16(31, 31, 31) -#define COLOR_DIALOG_SHADOW COLOR16( 0, 2, 8) -#define COLOR_FRAME COLOR16( 0, 0, 0) -#define COLOR_YESNO_TEXT COLOR16( 0, 0, 0) -#define COLOR_GREEN COLOR16( 0, 31, 0 ) -#define COLOR_GREEN1 COLOR16( 0, 24, 0 ) -#define COLOR_GREEN2 COLOR16( 0, 18, 0 ) -#define COLOR_GREEN3 COLOR16( 0, 12, 0 ) -#define COLOR_GREEN4 COLOR16( 0, 6, 0 ) -#define COLOR_RED COLOR16( 31, 0, 0 ) -#define COLOR_MSSG COLOR16( 16, 8, 29) +//#define COLOR_TEXT COLOR16(31, 31, 31) +//#define COLOR_PROGRESS_TEXT COLOR16( 0, 0, 0) +//#define COLOR_PROGRESS_BAR COLOR16(15, 15, 15) +//#define COLOR_ERROR COLOR16(31, 0, 0) +//#define COLOR_BG COLOR16(2, 4, 10) +//#define COLOR_BG32 COLOR32(2*8, 4*8, 10*8) +//#define COLOR_ROM_INFO COLOR16(22, 18, 26) +//#define COLOR_HELP_TEXT COLOR16(16, 20, 24) +//#define COLOR_DIALOG COLOR16(31, 31, 31) +//#define COLOR_DIALOG_SHADOW COLOR16( 0, 2, 8) +//#define COLOR_FRAME COLOR16( 0, 0, 0) +//#define COLOR_YESNO_TEXT COLOR16( 0, 0, 0) +//#define COLOR_GREEN COLOR16( 0, 31, 0 ) +//#define COLOR_GREEN1 COLOR16( 0, 24, 0 ) +//#define COLOR_GREEN2 COLOR16( 0, 18, 0 ) +//#define COLOR_GREEN3 COLOR16( 0, 12, 0 ) +//#define COLOR_GREEN4 COLOR16( 0, 6, 0 ) +//#define COLOR_RED COLOR16( 31, 0, 0 ) +//#define COLOR_MSSG COLOR16( 16, 8, 29) /****************************************************************************** * ******************************************************************************/ @@ -87,8 +87,12 @@ extern "C" { #endif +extern u16 COLOR_BG; extern u16 COLOR_INACTIVE_ITEM; extern u16 COLOR_ACTIVE_ITEM; +extern u16 COLOR_MSSG; +extern u16 COLOR_INACTIVE_MAIN; +extern u16 COLOR_ACTIVE_MAIN; struct background{ char bgname[128]; diff --git a/source/nds/gui.c b/source/nds/gui.c index 7502fcd..8d2c043 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -3011,6 +3011,7 @@ u32 menu(u16 *screen, bool8 FirstInvocation) void main_menu_passive() { + u16 color; show_icon(down_screen_addr, &ICON_MAINBG, 0, 0); //Audio/Video @@ -3018,93 +3019,117 @@ u32 menu(u16 *screen, bool8 FirstInvocation) if(display_option++ == current_option) { show_icon(down_screen_addr, &ICON_AVO, 19, 2); show_icon(down_screen_addr, &ICON_MSEL, 5, 57); + color = COLOR_ACTIVE_MAIN; } else { show_icon(down_screen_addr, &ICON_NAVO, 19, 2); show_icon(down_screen_addr, &ICON_MNSEL, 5, 57); + color = COLOR_INACTIVE_MAIN; } - draw_string_vcenter(down_screen_addr, 7, 57, 75, COLOR_WHITE, line_buffer); + draw_string_vcenter(down_screen_addr, 7, 57, 75, color, line_buffer); //Save strcpy(line_buffer, *(display_option->display_string)); if(display_option++ == current_option) { show_icon(down_screen_addr, &ICON_SAVO, 103, 2); show_icon(down_screen_addr, &ICON_MSEL, 89, 57); + color = COLOR_ACTIVE_MAIN; } else { show_icon(down_screen_addr, &ICON_NSAVO, 103, 2); show_icon(down_screen_addr, &ICON_MNSEL, 89, 57); + color = COLOR_INACTIVE_MAIN; } - draw_string_vcenter(down_screen_addr, 91, 57, 75, COLOR_WHITE, line_buffer); + draw_string_vcenter(down_screen_addr, 91, 57, 75, color, line_buffer); //Cheat strcpy(line_buffer, *(display_option->display_string)); if(display_option++ == current_option) { show_icon(down_screen_addr, &ICON_CHEAT, 187, 2); show_icon(down_screen_addr, &ICON_MSEL, 173, 57); + color = COLOR_ACTIVE_MAIN; } else { show_icon(down_screen_addr, &ICON_NCHEAT, 187, 2); show_icon(down_screen_addr, &ICON_MNSEL, 173, 57); + color = COLOR_INACTIVE_MAIN; } - draw_string_vcenter(down_screen_addr, 175, 57, 75, COLOR_WHITE, line_buffer); + draw_string_vcenter(down_screen_addr, 175, 57, 75, color, line_buffer); //Tools strcpy(line_buffer, *(display_option->display_string)); if(display_option++ == current_option) { show_icon(down_screen_addr, &ICON_TOOL, 19, 75); show_icon(down_screen_addr, &ICON_MSEL, 5, 131); + color = COLOR_ACTIVE_MAIN; } else { show_icon(down_screen_addr, &ICON_NTOOL, 19, 75); show_icon(down_screen_addr, &ICON_MNSEL, 5, 131); + color = COLOR_INACTIVE_MAIN; } - draw_string_vcenter(down_screen_addr, 7, 131, 75, COLOR_WHITE, line_buffer); + draw_string_vcenter(down_screen_addr, 7, 131, 75, color, line_buffer); //Other strcpy(line_buffer, *(display_option->display_string)); if(display_option++ == current_option) { show_icon(down_screen_addr, &ICON_OTHER, 103, 75); show_icon(down_screen_addr, &ICON_MSEL, 89, 131); + color = COLOR_ACTIVE_MAIN; } else { show_icon(down_screen_addr, &ICON_NOTHER, 103, 75); show_icon(down_screen_addr, &ICON_MNSEL, 89, 131); + color = COLOR_INACTIVE_MAIN; } - draw_string_vcenter(down_screen_addr, 91, 131, 75, COLOR_WHITE, line_buffer); + draw_string_vcenter(down_screen_addr, 91, 131, 75, color, line_buffer); //Exit strcpy(line_buffer, *(display_option->display_string)); if(display_option++ == current_option) { show_icon(down_screen_addr, &ICON_EXIT, 187, 75); show_icon(down_screen_addr, &ICON_MSEL, 173, 131); + color = COLOR_ACTIVE_MAIN; } else { show_icon(down_screen_addr, &ICON_NEXIT, 187, 75); show_icon(down_screen_addr, &ICON_MNSEL, 173, 131); + color = COLOR_INACTIVE_MAIN; } - draw_string_vcenter(down_screen_addr, 175, 131, 75, COLOR_WHITE, line_buffer); + draw_string_vcenter(down_screen_addr, 175, 131, 75, color, line_buffer); //New - if(display_option++ == current_option) + if(display_option++ == current_option) { show_icon(down_screen_addr, &ICON_MAINITEM, 0, 154); - else + color = COLOR_ACTIVE_MAIN; + } + else { show_icon(down_screen_addr, &ICON_NMAINITEM, 0, 154); - draw_string_vcenter(down_screen_addr, 0, 165, 85, COLOR_WHITE, msg[MSG_MAIN_MENU_NEW_GAME]); + color = COLOR_INACTIVE_MAIN; + } + draw_string_vcenter(down_screen_addr, 0, 165, 85, color, msg[MSG_MAIN_MENU_NEW_GAME]); //Restart - if(display_option++ == current_option) + if(display_option++ == current_option) { show_icon(down_screen_addr, &ICON_MAINITEM, 85, 154); - else + color = COLOR_ACTIVE_MAIN; + } + else { show_icon(down_screen_addr, &ICON_NMAINITEM, 85, 154); - draw_string_vcenter(down_screen_addr, 85, 165, 85, COLOR_WHITE, msg[MSG_MAIN_MENU_RETURN_TO_GAME]); + color = COLOR_INACTIVE_MAIN; + } + draw_string_vcenter(down_screen_addr, 85, 165, 85, color, msg[MSG_MAIN_MENU_RETURN_TO_GAME]); //Return - if(display_option++ == current_option) + if(display_option++ == current_option) { show_icon(down_screen_addr, &ICON_MAINITEM, 170, 154); - else + color = COLOR_ACTIVE_MAIN; + } + else { show_icon(down_screen_addr, &ICON_NMAINITEM, 170, 154); - draw_string_vcenter(down_screen_addr, 170, 165, 85, COLOR_WHITE, msg[MSG_MAIN_MENU_RESET_GAME]); + color = COLOR_INACTIVE_MAIN; + } + draw_string_vcenter(down_screen_addr, 170, 165, 85, color, msg[MSG_MAIN_MENU_RESET_GAME]); } void main_menu_key() |