diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/aoimage.cpp | 15 | ||||
| -rw-r--r-- | src/aosfxplayer.cpp | 9 | ||||
| -rw-r--r-- | src/courtroom.cpp | 21 |
3 files changed, 32 insertions, 13 deletions
diff --git a/src/aoimage.cpp b/src/aoimage.cpp index 2663ba0..3977c97 100644 --- a/src/aoimage.cpp +++ b/src/aoimage.cpp @@ -2,6 +2,8 @@ #include "aoimage.h" +#include <QBitmap> + AOImage::AOImage(QWidget *parent, AOApplication *p_ao_app) : QLabel(parent) { m_parent = parent; @@ -29,9 +31,10 @@ bool AOImage::set_image(QString p_image) } QPixmap f_pixmap(final_image_path); - - this->setPixmap( - f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio)); + f_pixmap = + f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio); + this->setPixmap(f_pixmap); + this->setMask(f_pixmap.mask()); return true; } @@ -45,7 +48,9 @@ bool AOImage::set_chatbox(QString p_path) QPixmap f_pixmap(p_path); - this->setPixmap( - f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio)); + f_pixmap = + f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio); + this->setPixmap(f_pixmap); + this->setMask(f_pixmap.mask()); return true; } diff --git a/src/aosfxplayer.cpp b/src/aosfxplayer.cpp index 8c4f3c8..1a0e2d2 100644 --- a/src/aosfxplayer.cpp +++ b/src/aosfxplayer.cpp @@ -37,11 +37,16 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout, QString misc_path = ""; QString char_path = ""; + QString theme_path = ""; QString sound_path = ao_app->get_sfx_suffix(ao_app->get_sounds_path(p_sfx)); - if (shout != "") + if (shout != "") { misc_path = ao_app->get_sfx_suffix(ao_app->get_base_path() + "misc/" + shout + "/" + p_sfx); + theme_path = ao_app->get_sfx_suffix(ao_app->get_theme_path(p_sfx)); + if (!file_exists(theme_path)) + theme_path = ao_app->get_sfx_suffix(ao_app->get_default_theme_path(p_sfx)); + } if (p_char != "") char_path = ao_app->get_sfx_suffix(ao_app->get_character_path(p_char, p_sfx)); @@ -52,6 +57,8 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout, f_path = char_path; else if (file_exists(misc_path)) f_path = misc_path; + else if (shout != "" && file_exists(theme_path)) //only check here for shouts + f_path = theme_path; else f_path = sound_path; diff --git a/src/courtroom.cpp b/src/courtroom.cpp index d36343b..a12c95a 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1533,9 +1533,8 @@ void Courtroom::on_chat_return_pressed() return; ui_ic_chat_message->blockSignals(true); - QTimer::singleShot(600, this, [=] { - ui_ic_chat_message->blockSignals(false); - }); + QTimer::singleShot(600, this, + [=] { ui_ic_chat_message->blockSignals(false); }); // MS# // deskmod# // pre-emote# @@ -3163,8 +3162,12 @@ void Courtroom::handle_song(QStringList *p_contents) } music_player->play(f_song, channel, looping, effect_flags); - if (channel == 0) - ui_music_name->setText(f_song_clear); + if (channel == 0) { + if (file_exists(ao_app->get_sfx_suffix(ao_app->get_music_path(f_song)))) + ui_music_name->setText(f_song_clear); + else + ui_music_name->setText(tr("[MISSING] %1").arg(f_song_clear)); + } } else { QString str_char = char_list.at(n_char).name; @@ -3195,8 +3198,12 @@ void Courtroom::handle_song(QStringList *p_contents) append_ic_text(f_song_clear, str_show, tr("has played a song")); music_player->play(f_song, channel, looping, effect_flags); - if (channel == 0) - ui_music_name->setText(f_song_clear); + if (channel == 0) { + if (file_exists(ao_app->get_sfx_suffix(ao_app->get_music_path(f_song)))) + ui_music_name->setText(f_song_clear); + else + ui_music_name->setText(tr("[MISSING] %1").arg(f_song_clear)); + } } } } |
