diff options
| author | stonedDiscord <stoned@derpymail.org> | 2020-02-23 13:53:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-23 13:53:44 +0100 |
| commit | 149f04dc8465332363eeca9a40e123fc25863a17 (patch) | |
| tree | ad1bfae38670defee3357ee5a80639485e5f142d /src/path_functions.cpp | |
| parent | 6ccabdd568075dfcecc6190d8d41a50b8bd99b84 (diff) | |
| parent | ad80e6413f7bc81177605c125eaf9c408aac94c6 (diff) | |
Merge pull request #117 from AttorneyOnline/2.7
2.7
Diffstat (limited to 'src/path_functions.cpp')
| -rw-r--r-- | src/path_functions.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/path_functions.cpp b/src/path_functions.cpp index 5eb97a32..72b7accc 100644 --- a/src/path_functions.cpp +++ b/src/path_functions.cpp @@ -96,11 +96,37 @@ QString AOApplication::get_sounds_path(QString p_file) QString AOApplication::get_music_path(QString p_song) { - QString path = get_base_path() + "sounds/music/" + p_song; + QString withending_check = get_base_path() + "sounds/music/" + p_song; + QString mp3_check = get_base_path() + "sounds/music/" + p_song + ".mp3"; + QString opus_check = get_base_path() + "sounds/music/" + p_song + ".opus"; + if (file_exists(opus_check)) + { + #ifndef CASE_SENSITIVE_FILESYSTEM + return opus_check; + #else + return get_case_sensitive_path(opus_check); + #endif + } + else if (file_exists(mp3_check)) + { + #ifndef CASE_SENSITIVE_FILESYSTEM + return mp3_check; + #else + return get_case_sensitive_path(mp3_check); + #endif + } + else if (file_exists(withending_check)) + { + #ifndef CASE_SENSITIVE_FILESYSTEM + return withending_check; + #else + return get_case_sensitive_path(withending_check); + #endif + } #ifndef CASE_SENSITIVE_FILESYSTEM - return path; + return get_base_path() + "sounds/music/" + p_song + ".wav"; #else - return get_case_sensitive_path(path); + return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".wav"); #endif } |
