diff options
Diffstat (limited to 'apps/talk.c')
-rw-r--r-- | apps/talk.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/talk.c b/apps/talk.c index e9307f056f..1f1eefd51d 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -127,6 +127,7 @@ static unsigned char* p_lastclip; /* address of latest clip, for silence add */ | |||
127 | static unsigned long voicefile_size = 0; /* size of the loaded voice file */ | 127 | static unsigned long voicefile_size = 0; /* size of the loaded voice file */ |
128 | static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */ | 128 | static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */ |
129 | static bool talk_initialized; /* true if talk_init has been called */ | 129 | static bool talk_initialized; /* true if talk_init has been called */ |
130 | static int talk_menu_disable; /* if non-zero, temporarily disable voice UI (not saved) */ | ||
130 | 131 | ||
131 | /***************** Private prototypes *****************/ | 132 | /***************** Private prototypes *****************/ |
132 | 133 | ||
@@ -498,6 +499,7 @@ static void reset_state(void) | |||
498 | 499 | ||
499 | void talk_init(void) | 500 | void talk_init(void) |
500 | { | 501 | { |
502 | talk_menu_disable = 0; | ||
501 | if (talk_initialized && !strcasecmp(last_lang, global_settings.lang_file)) | 503 | if (talk_initialized && !strcasecmp(last_lang, global_settings.lang_file)) |
502 | { | 504 | { |
503 | /* not a new file, nothing to do */ | 505 | /* not a new file, nothing to do */ |
@@ -819,3 +821,19 @@ int talk_spell(const char* spell, bool enqueue) | |||
819 | 821 | ||
820 | return 0; | 822 | return 0; |
821 | } | 823 | } |
824 | |||
825 | bool talk_menus_enabled(void) | ||
826 | { | ||
827 | return (global_settings.talk_menu && talk_menu_disable == 0); | ||
828 | } | ||
829 | |||
830 | |||
831 | void talk_disable_menus(void) | ||
832 | { | ||
833 | talk_menu_disable++; | ||
834 | } | ||
835 | |||
836 | void talk_enable_menus(void) | ||
837 | { | ||
838 | talk_menu_disable--; | ||
839 | } | ||