From 5bf5a228335e4859b61ae1af8558778592395eeb Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sat, 17 Nov 2018 20:12:12 -0600 Subject: [PATCH] Fix compile-time issues from merge --- aoapplication.h | 1 + aoblipplayer.cpp | 2 +- aomovie.cpp | 6 +++--- courtroom.cpp | 17 +++++++---------- path_functions.cpp | 10 ++++++++++ text_file_functions.cpp | 2 +- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/aoapplication.h b/aoapplication.h index a237b8f..f420733 100644 --- a/aoapplication.h +++ b/aoapplication.h @@ -119,6 +119,7 @@ public: QString get_data_path(); QString get_theme_path(QString p_file); QString get_default_theme_path(QString p_file); + QString get_custom_theme_path(QString p_theme, QString p_file); QString get_character_path(QString p_char, QString p_file); QString get_sounds_path(QString p_file); QString get_music_path(QString p_song); diff --git a/aoblipplayer.cpp b/aoblipplayer.cpp index 0ea0897..067ed00 100644 --- a/aoblipplayer.cpp +++ b/aoblipplayer.cpp @@ -8,7 +8,7 @@ AOBlipPlayer::AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app) void AOBlipPlayer::set_blips(QString p_sfx) { - QString f_path = ao_app->get_sounds_path() + p_sfx.toLower(); + QString f_path = ao_app->get_sounds_path(p_sfx); for (int n_stream = 0 ; n_stream < 5 ; ++n_stream) { diff --git a/aomovie.cpp b/aomovie.cpp index 6839eab..97ee248 100644 --- a/aomovie.cpp +++ b/aomovie.cpp @@ -28,12 +28,12 @@ void AOMovie::play(QString p_gif, QString p_char, QString p_custom_theme) QString custom_path; if (p_gif == "custom") - custom_path = ao_app->get_image_suffix(get_character_path(p_char, p_gif)); + custom_path = ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_gif)); else - custom_path = ao_app->get_image_suffix(get_character_path(p_char, p_gif + "_bubble")); + custom_path = ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_gif + "_bubble")); QString misc_path = ao_app->get_base_path() + "misc/" + p_custom_theme + "/" + p_gif + "_bubble.gif"; - QString custom_theme_path = ao_app->get_base_path() + "themes/" + p_custom_theme + "/" + p_gif + ".gif"; + QString custom_theme_path = ao_app->get_custom_theme_path(p_custom_theme, p_gif + ".gif"); QString theme_path = ao_app->get_theme_path(p_gif + ".gif"); QString default_theme_path = ao_app->get_default_theme_path(p_gif + ".gif"); QString placeholder_path = ao_app->get_theme_path("placeholder.gif"); diff --git a/courtroom.cpp b/courtroom.cpp index 88139e1..92b9030 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -11,7 +11,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() if (ao_app->get_audio_output_device() == "Default") { - BASS_Init(-1, 48000, BASS_DEVICE_LATENCY, 0, NULL); + BASS_Init(-1, 48000, BASS_DEVICE_LATENCY, nullptr, nullptr); load_bass_opus_plugin(); } else @@ -21,7 +21,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() if (ao_app->get_audio_output_device() == info.name) { BASS_SetDevice(a); - BASS_Init(a, 48000, BASS_DEVICE_LATENCY, 0, NULL); + BASS_Init(a, 48000, BASS_DEVICE_LATENCY, nullptr, nullptr); load_bass_opus_plugin(); qDebug() << info.name << "was set as the default audio output device."; break; @@ -874,9 +874,9 @@ void Courtroom::enter_courtroom(int p_cid) } if (ao_app->custom_objection_enabled && - (file_exists(ao_app->get_character_path(char_path, "custom.gif")) || - file_exists(ao_app->get_character_path(char_path, "custom.apng"))) && - file_exists(ao_app->get_character_path(char_path, "custom.wav"))) + (file_exists(ao_app->get_character_path(current_char, "custom.gif")) || + file_exists(ao_app->get_character_path(current_char, "custom.apng"))) && + file_exists(ao_app->get_character_path(current_char, "custom.wav"))) ui_custom_objection->show(); else ui_custom_objection->hide(); @@ -1664,9 +1664,6 @@ void Courtroom::handle_chatmessage_3() void Courtroom::append_ic_text(QString p_text, QString p_name) { - // a bit of a silly hack, should use QListWidget for IC in the first place though - static bool isEmpty = true; - QTextCharFormat bold; QTextCharFormat normal; bold.setFontWeight(QFont::Bold); @@ -1991,7 +1988,7 @@ void Courtroom::play_preanim() preanim_duration = ao2_duration; sfx_delay_timer->start(sfx_delay); - QString anim_to_find = ao_app->get_image_suffix(ao_app->get_character_path(f_char) + f_preanim.toLower()); + QString anim_to_find = ao_app->get_image_suffix(ao_app->get_character_path(f_char, f_preanim)); if (!file_exists(anim_to_find) || preanim_duration < 0) { @@ -2026,7 +2023,7 @@ void Courtroom::play_noninterrupting_preanim() preanim_duration = ao2_duration; sfx_delay_timer->start(sfx_delay); - QString anim_to_find = ao_app->get_image_suffix(ao_app->get_character_path(f_char) + f_preanim.toLower()); + QString anim_to_find = ao_app->get_image_suffix(ao_app->get_character_path(f_char, f_preanim)); if (!file_exists(anim_to_find) || preanim_duration < 0) { diff --git a/path_functions.cpp b/path_functions.cpp index 24041e2..7d40054 100644 --- a/path_functions.cpp +++ b/path_functions.cpp @@ -52,6 +52,16 @@ QString AOApplication::get_default_theme_path(QString p_file) #endif } +QString AOApplication::get_custom_theme_path(QString p_theme, QString p_file) +{ + QString path = get_base_path() + "themes/" + p_theme + "/" + p_file; +#ifndef CASE_SENSITIVE_FILESYSTEM + return path; +#else + return get_case_sensitive_path(path); +#endif +} + QString AOApplication::get_theme_path(QString p_file) { QString path = get_base_path() + "themes/" + current_theme + "/" + p_file; diff --git a/text_file_functions.cpp b/text_file_functions.cpp index 69c5fab..9390978 100644 --- a/text_file_functions.cpp +++ b/text_file_functions.cpp @@ -345,7 +345,7 @@ QString AOApplication::get_image_suffix(QString path_to_check) //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) { - QSettings settings(get_character_path(p_char) + "char.ini", QSettings::IniFormat); + QSettings settings(get_character_path(p_char, "char.ini"), QSettings::IniFormat); settings.beginGroup(target_tag); QString value = settings.value(p_search_line).toString(); settings.endGroup();