diff options
author | Nebuleon Fumika | 2013-01-14 03:58:52 -0500 |
---|---|---|
committer | Nebuleon Fumika | 2013-01-14 03:58:52 -0500 |
commit | 4ba17a46f649414770b8fcae5a97111c1d161e71 (patch) | |
tree | d2169eb5fa8e499c94975e44c6cd3ba322b538ea /source/nds | |
parent | 07f0fe97fd23983dc25df0b1961d3e46b596f442 (diff) | |
download | snes9x2005-4ba17a46f649414770b8fcae5a97111c1d161e71.tar.gz snes9x2005-4ba17a46f649414770b8fcae5a97111c1d161e71.tar.bz2 snes9x2005-4ba17a46f649414770b8fcae5a97111c1d161e71.zip |
Make yes/no dialog(ue)s respond to touches on the Yes and No buttons.
Diffstat (limited to 'source/nds')
-rw-r--r-- | source/nds/draw.c | 14 |
1 files changed, 13 insertions, 1 deletions
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); } |