diff options
| author | Crystalwarrior <varsash@gmail.com> | 2020-03-31 17:09:00 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2020-03-31 17:09:00 +0300 |
| commit | 7816c8ab234e185e5eb3410761aee3ca60e0f354 (patch) | |
| tree | b1cac3c0559f9953c084ee1c628b9413694c54ae | |
| parent | feaf04a5c48bb647d12408645f69e1ed49c9df15 (diff) | |
Add legacy fallback for "chatbox.png" name if chat.png doesn't exist
| -rw-r--r-- | src/courtroom.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 6763300f..d310a0a5 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"); |
