From 33cae53665ef2a1a0db8cf664faca0faf08770f6 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sat, 10 Nov 2018 23:50:51 -0600 Subject: Merge AOV 2.5.1 into mainline --- text_file_functions.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'text_file_functions.cpp') diff --git a/text_file_functions.cpp b/text_file_functions.cpp index 42bcd74d..a633dd94 100644 --- a/text_file_functions.cpp +++ b/text_file_functions.cpp @@ -315,6 +315,32 @@ QString AOApplication::get_sfx(QString p_identifier) return return_sfx; } +QString AOApplication::get_sfx_suffix(QString sound_to_check) +{ + QString mp3_check = get_sounds_path() + sound_to_check + ".mp3"; + QString opus_check = get_sounds_path() + sound_to_check + ".opus"; + if(file_exists(opus_check)) + { + return sound_to_check + ".opus"; + } + if(file_exists(mp3_check)) + { + return sound_to_check + ".mp3"; + } + return sound_to_check + ".wav"; +} + +QString AOApplication::get_image_suffix(QString path_to_check) +{ + QString apng_check = path_to_check + ".apng"; + if(file_exists(apng_check)) + { + return path_to_check + ".apng"; + } + return path_to_check + ".gif"; +} + + //returns whatever is to the right of "search_line =" within target_tag and terminator_tag, trimmed //returns the empty string if the search line couldnt be found QString AOApplication::read_char_ini(QString p_char, QString p_search_line, QString target_tag) -- cgit