diff options
Diffstat (limited to 'src/courtroom.cpp')
| -rw-r--r-- | src/courtroom.cpp | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 7a38b942..55b851e3 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1883,30 +1883,35 @@ void Courtroom::handle_chatmessage_2() QString chatbox_path = ao_app->get_theme_path("chat"); QString chatbox = ao_app->get_chat(m_chatmessage[CHAR_NAME]); - if (chatbox != "") { + QString customchar; + if (ao_app->is_customchat_enabled()) + customchar = m_chatmessage[CHAR_NAME]; + + if (chatbox != "" && ao_app->is_customchat_enabled()) { chatbox_path = ao_app->get_base_path() + "misc/" + chatbox + "/chat"; if (!ui_vp_chatbox->set_chatbox(chatbox_path)) ui_vp_chatbox->set_chatbox(chatbox_path + "box"); + } - pos_size_type design_ini_result = ao_app->get_element_dimensions( - "chat_arrow", "courtroom_design.ini", m_chatmessage[CHAR_NAME]); - if (design_ini_result.width < 0 || design_ini_result.height < 0) { - qDebug() << "W: could not find \"chat_arrow\" in courtroom_design.ini"; - ui_vp_chat_arrow->hide(); - } - else { - ui_vp_chat_arrow->move(design_ini_result.x, design_ini_result.y); - ui_vp_chat_arrow->combo_resize(design_ini_result.width, - design_ini_result.height); - } + //This should probably be called only if any change from the last chat arrow was actually detected. + pos_size_type design_ini_result = ao_app->get_element_dimensions( + "chat_arrow", "courtroom_design.ini", customchar); + if (design_ini_result.width < 0 || design_ini_result.height < 0) { + qDebug() << "W: could not find \"chat_arrow\" in courtroom_design.ini"; + ui_vp_chat_arrow->hide(); + } + else { + ui_vp_chat_arrow->move(design_ini_result.x, design_ini_result.y); + ui_vp_chat_arrow->combo_resize(design_ini_result.width, + design_ini_result.height); } pos_size_type default_width = ao_app->get_element_dimensions( - "showname", "courtroom_design.ini", m_chatmessage[CHAR_NAME]); + "showname", "courtroom_design.ini", customchar); int extra_width = ao_app ->get_design_element("showname_extra_width", "courtroom_design.ini", - m_chatmessage[CHAR_NAME]) + customchar) .toInt(); if (extra_width > 0) { @@ -2692,8 +2697,13 @@ void Courtroom::chat_tick() ui_vp_player_char->play_idle(m_chatmessage[CHAR_NAME], m_chatmessage[EMOTE]); } - QString f_char = m_chatmessage[CHAR_NAME]; - QString f_custom_theme = ao_app->get_chat(f_char); + QString f_char; + QString f_custom_theme; + if (ao_app->is_customchat_enabled()) + { + f_char = m_chatmessage[CHAR_NAME]; + f_custom_theme = ao_app->get_chat(f_char); + } ui_vp_chat_arrow->play( "chat_arrow", f_char, f_custom_theme); // Chat stopped being processed, indicate that. @@ -4236,7 +4246,7 @@ void Courtroom::set_text_color_dropdown() // Update markdown colors. TODO: make a loading function that only loads the // config file once instead of several times for (int c = 0; c < max_colors; ++c) { - QColor color = ao_app->get_chat_color(QString::number(c), current_char); + QColor color = ao_app->get_chat_color("c" + QString::number(c), current_char); color_rgb_list.append(color); color_markdown_start_list.append(ao_app->get_chat_markdown( "c" + QString::number(c) + "_start", current_char)); |
