Fix compile-time issues from merge

This commit is contained in:
oldmud0 2018-11-17 20:12:12 -06:00
parent b385babf77
commit 5bf5a22833
6 changed files with 23 additions and 15 deletions

View File

@ -119,6 +119,7 @@ public:
QString get_data_path(); QString get_data_path();
QString get_theme_path(QString p_file); QString get_theme_path(QString p_file);
QString get_default_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_character_path(QString p_char, QString p_file);
QString get_sounds_path(QString p_file); QString get_sounds_path(QString p_file);
QString get_music_path(QString p_song); QString get_music_path(QString p_song);

View File

@ -8,7 +8,7 @@ AOBlipPlayer::AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app)
void AOBlipPlayer::set_blips(QString p_sfx) 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) for (int n_stream = 0 ; n_stream < 5 ; ++n_stream)
{ {

View File

@ -28,12 +28,12 @@ void AOMovie::play(QString p_gif, QString p_char, QString p_custom_theme)
QString custom_path; QString custom_path;
if (p_gif == "custom") 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 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 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 theme_path = ao_app->get_theme_path(p_gif + ".gif");
QString default_theme_path = ao_app->get_default_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"); QString placeholder_path = ao_app->get_theme_path("placeholder.gif");

View File

@ -11,7 +11,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
if (ao_app->get_audio_output_device() == "Default") 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(); load_bass_opus_plugin();
} }
else else
@ -21,7 +21,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
if (ao_app->get_audio_output_device() == info.name) if (ao_app->get_audio_output_device() == info.name)
{ {
BASS_SetDevice(a); 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(); load_bass_opus_plugin();
qDebug() << info.name << "was set as the default audio output device."; qDebug() << info.name << "was set as the default audio output device.";
break; break;
@ -874,9 +874,9 @@ void Courtroom::enter_courtroom(int p_cid)
} }
if (ao_app->custom_objection_enabled && if (ao_app->custom_objection_enabled &&
(file_exists(ao_app->get_character_path(char_path, "custom.gif")) || (file_exists(ao_app->get_character_path(current_char, "custom.gif")) ||
file_exists(ao_app->get_character_path(char_path, "custom.apng"))) && file_exists(ao_app->get_character_path(current_char, "custom.apng"))) &&
file_exists(ao_app->get_character_path(char_path, "custom.wav"))) file_exists(ao_app->get_character_path(current_char, "custom.wav")))
ui_custom_objection->show(); ui_custom_objection->show();
else else
ui_custom_objection->hide(); ui_custom_objection->hide();
@ -1664,9 +1664,6 @@ void Courtroom::handle_chatmessage_3()
void Courtroom::append_ic_text(QString p_text, QString p_name) 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 bold;
QTextCharFormat normal; QTextCharFormat normal;
bold.setFontWeight(QFont::Bold); bold.setFontWeight(QFont::Bold);
@ -1991,7 +1988,7 @@ void Courtroom::play_preanim()
preanim_duration = ao2_duration; preanim_duration = ao2_duration;
sfx_delay_timer->start(sfx_delay); 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) || if (!file_exists(anim_to_find) ||
preanim_duration < 0) preanim_duration < 0)
{ {
@ -2026,7 +2023,7 @@ void Courtroom::play_noninterrupting_preanim()
preanim_duration = ao2_duration; preanim_duration = ao2_duration;
sfx_delay_timer->start(sfx_delay); 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) || if (!file_exists(anim_to_find) ||
preanim_duration < 0) preanim_duration < 0)
{ {

View File

@ -52,6 +52,16 @@ QString AOApplication::get_default_theme_path(QString p_file)
#endif #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 AOApplication::get_theme_path(QString p_file)
{ {
QString path = get_base_path() + "themes/" + current_theme + "/" + p_file; QString path = get_base_path() + "themes/" + current_theme + "/" + p_file;

View File

@ -345,7 +345,7 @@ QString AOApplication::get_image_suffix(QString path_to_check)
//returns the empty string if the search line couldnt be found //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) 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); settings.beginGroup(target_tag);
QString value = settings.value(p_search_line).toString(); QString value = settings.value(p_search_line).toString();
settings.endGroup(); settings.endGroup();