Add legacy fallback for "chatbox.png" name if chat.png doesn't exist

This commit is contained in:
Crystalwarrior 2020-03-31 17:09:00 +03:00
parent feaf04a5c4
commit 7816c8ab23

View File

@ -1793,7 +1793,8 @@ void Courtroom::handle_chatmessage_2()
} }
else //Aw yeah dude do some showname resizing magic 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()); QFontMetrics fm(ui_vp_showname->font());
int fm_width=fm.horizontalAdvance(ui_vp_showname->text()); int fm_width=fm.horizontalAdvance(ui_vp_showname->text());
@ -1803,7 +1804,8 @@ void Courtroom::handle_chatmessage_2()
if (chatbox != "") if (chatbox != "")
{ {
chatbox_path = ao_app->get_base_path() + "misc/" + chatbox + "/chat"; 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"); pos_size_type default_width = ao_app->get_element_dimensions("showname", "courtroom_design.ini");