aboutsummaryrefslogtreecommitdiff
path: root/src/courtroom.cpp
diff options
context:
space:
mode:
authorstonedDiscord <stoned@derpymail.org>2020-03-07 22:05:57 +0100
committerGitHub <noreply@github.com>2020-03-07 22:05:57 +0100
commit0ce577c482a97d1d85cf84a6a04550bfe99be8fa (patch)
tree1fb7068f04ffa2cf7f72b73df17e1b1293df5438 /src/courtroom.cpp
parent80bf49ee90e996c9f356d438231f941bad118b52 (diff)
parent369cc298e408b33fe57c9d4ff72cb8a691f7550e (diff)
Merge pull request #119 from in1tiate/chatboxfix
Re-add support for 2.4-style custom chatboxes
Diffstat (limited to 'src/courtroom.cpp')
-rw-r--r--src/courtroom.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index b9686e70..805c8cca 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -1655,7 +1655,21 @@ void Courtroom::handle_chatmessage_2()
ui_vp_chatbox->set_image("chatmed.png");
else
{
- QString chatbox_path = ao_app->get_base_path() + "misc/" + chatbox + "/chatbox.png";
+ QString chatbox_path;
+ QString misc_path = ao_app->get_base_path() + "misc/" + chatbox + "/chatbox.png";
+ // support for 2.4 legacy chatboxes
+ QString legacy_path = ao_app->get_base_path() + "misc/" + chatbox + ".png";
+ if (file_exists(misc_path))
+ {
+ chatbox_path = misc_path;
+ }
+ else if (file_exists(legacy_path))
+ chatbox_path = legacy_path;
+ else
+ {
+ QString default_chatbox_path = ao_app->get_theme_path("chatmed.png");
+ chatbox_path = default_chatbox_path;
+ }
ui_vp_chatbox->set_image_from_path(chatbox_path);
}