diff options
Diffstat (limited to 'apps/gui/yesno.c')
-rw-r--r-- | apps/gui/yesno.c | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c index 4e86b017ca..891e73809b 100644 --- a/apps/gui/yesno.c +++ b/apps/gui/yesno.c @@ -101,25 +101,6 @@ static bool gui_yesno_draw_result(struct gui_yesno * yn, enum yesno_res result) #include "debug.h" -/* Processes a text_message whose lines may be virtual pointers - representing language / voicefont IDs (see settings.h). Copies out - the IDs to the ids array, which is of length maxlen, and replaces - the pointers in the text_message with the actual language strings. - The ids array is terminated with the TALK_FINAL_ID sentinel - element. */ -static void extract_talk_ids(struct text_message *m, long *ids, int maxlen) -{ - int line, i=0; - if(m) - for(line=0; line<m->nb_lines; line++) { - long id = P2ID((unsigned char *)m->message_lines[line]); - if(id>=0 && i<maxlen-1) - ids[i++] = id; - m->message_lines[line] = (char *)P2STR((unsigned char *)m->message_lines[line]); - } - ids[i] = TALK_FINAL_ID; -} - enum yesno_res gui_syncyesno_run(struct text_message * main_message, struct text_message * yes_message, struct text_message * no_message) @@ -129,13 +110,7 @@ enum yesno_res gui_syncyesno_run(struct text_message * main_message, int result=-1; bool result_displayed; struct gui_yesno yn[NB_SCREENS]; - long voice_ids[5]; long talked_tick = 0; - /* The text messages may contain virtual pointers to IDs (see - settings.h) instead of plain strings. Copy the IDs out so we - can speak them, and unwrap the actual language strings. */ - extract_talk_ids(main_message, voice_ids, - sizeof(voice_ids)/sizeof(voice_ids[0])); FOR_NB_SCREENS(i) { gui_yesno_init(&(yn[i]), main_message, yes_message, no_message); @@ -149,7 +124,7 @@ enum yesno_res gui_syncyesno_run(struct text_message * main_message, && (talked_tick==0 || TIME_AFTER(current_tick, talked_tick+HZ*5))) { talked_tick = current_tick; - talk_idarray(voice_ids, false); + talk_text_message(main_message, false); } button = get_action(CONTEXT_YESNOSCREEN, HZ*5); switch (button) @@ -168,16 +143,13 @@ enum yesno_res gui_syncyesno_run(struct text_message * main_message, } } - /* extract_talk_ids also converts ID to STR */ - extract_talk_ids((result == YESNO_YES) ? yes_message : no_message, - voice_ids, sizeof(voice_ids)/sizeof(voice_ids[0])); - FOR_NB_SCREENS(i) result_displayed=gui_yesno_draw_result(&(yn[i]), result); if (global_settings.talk_menu) { - talk_idarray(voice_ids, false); + talk_text_message((result == YESNO_YES) ? yes_message + : no_message, false); talk_force_enqueue_next(); } if(result_displayed) |