From 7816c8ab234e185e5eb3410761aee3ca60e0f354 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 31 Mar 2020 17:09:00 +0300 Subject: [PATCH] Add legacy fallback for "chatbox.png" name if chat.png doesn't exist --- src/courtroom.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 6763300..d310a0a 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1793,7 +1793,8 @@ void Courtroom::handle_chatmessage_2() } else //Aw yeah dude do some showname resizing magic { - ui_vp_chatbox->set_image("chat"); + if (!ui_vp_chatbox->set_image("chat")) + ui_vp_chatbox->set_image("chatbox"); QFontMetrics fm(ui_vp_showname->font()); int fm_width=fm.horizontalAdvance(ui_vp_showname->text()); @@ -1803,7 +1804,8 @@ void Courtroom::handle_chatmessage_2() if (chatbox != "") { chatbox_path = ao_app->get_base_path() + "misc/" + chatbox + "/chat"; - ui_vp_chatbox->set_chatbox(chatbox_path); + if (!ui_vp_chatbox->set_chatbox(chatbox_path)) + ui_vp_chatbox->set_chatbox(chatbox_path + "box"); } pos_size_type default_width = ao_app->get_element_dimensions("showname", "courtroom_design.ini");