From 4ba17a46f649414770b8fcae5a97111c1d161e71 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Mon, 14 Jan 2013 03:58:52 -0500 Subject: Make yes/no dialog(ue)s respond to touches on the Yes and No buttons. --- source/nds/draw.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source/nds') diff --git a/source/nds/draw.c b/source/nds/draw.c index d739dc9..c7a7d02 100644 --- a/source/nds/draw.c +++ b/source/nds/draw.c @@ -753,7 +753,7 @@ void draw_dialog(void* screen_addr, u32 sx, u32 sy, u32 ex, u32 ey) } /* -* Draw yer or no dialog +* Draw yes or no dialog */ u32 draw_yesno_dialog(enum SCREEN_ID screen, u32 sy, char *yes, char *no) { @@ -817,6 +817,18 @@ u32 draw_yesno_dialog(enum SCREEN_ID screen, u32 sy, char *yes, char *no) while((gui_action != CURSOR_SELECT) && (gui_action != CURSOR_BACK)) { gui_action = get_gui_input(); + if (gui_action == CURSOR_TOUCH) + { + ds2_getrawInput(&inputdata); + // Turn it into a SELECT (A) or BACK (B) if the button is touched. + if (inputdata.y >= 128 && inputdata.y < 128 + ICON_BUTTON.y) + { + if (inputdata.x >= 49 && inputdata.x < 49 + ICON_BUTTON.x) + gui_action = CURSOR_SELECT; + else if (inputdata.x >= 136 && inputdata.x < 136 + ICON_BUTTON.x) + gui_action = CURSOR_BACK; + } + } // OSTimeDly(OS_TICKS_PER_SEC/10); mdelay(100); } -- cgit v1.2.3