aboutsummaryrefslogtreecommitdiff
path: root/text_file_functions.cpp
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2018-11-10 23:50:51 -0600
committeroldmud0 <oldmud0@users.noreply.github.com>2018-11-10 23:50:51 -0600
commit33cae53665ef2a1a0db8cf664faca0faf08770f6 (patch)
tree63bd31d7f0a64693b124e8f0858f3423184ea635 /text_file_functions.cpp
parentde9bdceec73a7228c44e189e4bc141c721488586 (diff)
Merge AOV 2.5.1 into mainline
Diffstat (limited to 'text_file_functions.cpp')
-rw-r--r--text_file_functions.cpp26
1 files changed, 26 insertions, 0 deletions
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)