forked from len0rd/rockbox
Straighten out voicing of yesno dialogs.
Make it so gui_syncyesno_run() does not modify the text_messages passed as argument, simplify the code and even reduce size a bit. The key is to support voicing at the level of the text_message itself. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15505 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
fbdc0e6b57
commit
6f4c6ed990
3 changed files with 28 additions and 32 deletions
|
@ -19,6 +19,8 @@
|
|||
|
||||
#include "textarea.h"
|
||||
#include "font.h"
|
||||
#include "lang.h"
|
||||
#include "talk.h"
|
||||
|
||||
void gui_textarea_clear(struct screen * display)
|
||||
{
|
||||
|
@ -51,7 +53,8 @@ int gui_textarea_put_message(struct screen * display,
|
|||
int i;
|
||||
gui_textarea_clear(display);
|
||||
for(i=0;i<message->nb_lines && i+ystart<display->nb_lines;i++)
|
||||
display->puts_scroll(0, i+ystart, (unsigned char *)message->message_lines[i]);
|
||||
display->puts_scroll(0, i+ystart, P2STR((unsigned char *)message->
|
||||
message_lines[i]));
|
||||
gui_textarea_update(display);
|
||||
return(i);
|
||||
}
|
||||
|
@ -74,3 +77,18 @@ void gui_textarea_update_nblines(struct screen * display)
|
|||
#endif
|
||||
display->nb_lines = height / display->char_height;
|
||||
}
|
||||
|
||||
void talk_text_message(struct text_message * message, bool enqueue)
|
||||
{
|
||||
int line;
|
||||
if(message)
|
||||
for(line=0; line<message->nb_lines; line++)
|
||||
{
|
||||
long id = P2ID((unsigned char *)message->message_lines[line]);
|
||||
if(id>=0)
|
||||
{
|
||||
talk_id(id, enqueue);
|
||||
enqueue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue