Merge branch 'master' into master

This commit is contained in:
stonedDiscord 2024-06-25 12:39:03 +02:00 committed by GitHub
commit a289d8c576
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4195,7 +4195,7 @@ void Courtroom::start_chat_ticking()
last_misc = current_misc; last_misc = current_misc;
current_misc = ao_app->get_chat(m_chatmessage[CHAR_NAME]); current_misc = ao_app->get_chat(m_chatmessage[CHAR_NAME]);
if (last_misc != current_misc || char_color_rgb_list.size() < max_colors) if ((last_misc != current_misc || char_color_rgb_list.size() < max_colors) && Options::getInstance().customChatboxEnabled())
{ {
gen_char_rgb_list(current_misc); gen_char_rgb_list(current_misc);
} }
@ -4265,10 +4265,21 @@ void Courtroom::chat_tick()
ui_vp_chat_arrow->setTransformationMode(ao_app->get_misc_scaling(f_custom_theme)); ui_vp_chat_arrow->setTransformationMode(ao_app->get_misc_scaling(f_custom_theme));
ui_vp_chat_arrow->loadAndPlayAnimation("chat_arrow", f_custom_theme); // Chat stopped being processed, indicate that. ui_vp_chat_arrow->loadAndPlayAnimation("chat_arrow", f_custom_theme); // Chat stopped being processed, indicate that.
QString f_message_filtered = filter_ic_text(f_message, true, -1, m_chatmessage[TEXT_COLOR].toInt()); QString f_message_filtered = filter_ic_text(f_message, true, -1, m_chatmessage[TEXT_COLOR].toInt());
for (int c = 0; c < max_colors; ++c) if (Options::getInstance().customChatboxEnabled())
{ { // chatbox colors
additive_previous = additive_previous.replace("$c" + QString::number(c), char_color_rgb_list.at(c).name(QColor::HexRgb)); for (int c = 0; c < max_colors; ++c)
f_message_filtered = f_message_filtered.replace("$c" + QString::number(c), char_color_rgb_list.at(c).name(QColor::HexRgb)); {
additive_previous = additive_previous.replace("$c" + QString::number(c), char_color_rgb_list.at(c).name(QColor::HexRgb));
f_message_filtered = f_message_filtered.replace("$c" + QString::number(c), char_color_rgb_list.at(c).name(QColor::HexRgb));
}
}
else
{ // default colors
for (int c = 0; c < max_colors; ++c)
{
additive_previous = additive_previous.replace("$c" + QString::number(c), default_color_rgb_list.at(c).name(QColor::HexRgb));
f_message_filtered = f_message_filtered.replace("$c" + QString::number(c), default_color_rgb_list.at(c).name(QColor::HexRgb));
}
} }
additive_previous = additive_previous + f_message_filtered; additive_previous = additive_previous + f_message_filtered;
real_tick_pos = ui_vp_message->toPlainText().size(); real_tick_pos = ui_vp_message->toPlainText().size();
@ -4433,10 +4444,21 @@ void Courtroom::chat_tick()
{ {
// Do the colors, gradual showing, etc. in here // Do the colors, gradual showing, etc. in here
QString f_message_filtered = filter_ic_text(f_message, true, tick_pos, m_chatmessage[TEXT_COLOR].toInt()); QString f_message_filtered = filter_ic_text(f_message, true, tick_pos, m_chatmessage[TEXT_COLOR].toInt());
for (int c = 0; c < max_colors; ++c) if (Options::getInstance().customChatboxEnabled())
{ { // use chatbox colors
additive_previous = additive_previous.replace("$c" + QString::number(c), char_color_rgb_list.at(c).name(QColor::HexRgb)); for (int c = 0; c < max_colors; ++c)
f_message_filtered = f_message_filtered.replace("$c" + QString::number(c), char_color_rgb_list.at(c).name(QColor::HexRgb)); {
additive_previous = additive_previous.replace("$c" + QString::number(c), char_color_rgb_list.at(c).name(QColor::HexRgb));
f_message_filtered = f_message_filtered.replace("$c" + QString::number(c), char_color_rgb_list.at(c).name(QColor::HexRgb));
}
}
else
{ // just use default colors
for (int c = 0; c < max_colors; ++c)
{
additive_previous = additive_previous.replace("$c" + QString::number(c), default_color_rgb_list.at(c).name(QColor::HexRgb));
f_message_filtered = f_message_filtered.replace("$c" + QString::number(c), default_color_rgb_list.at(c).name(QColor::HexRgb));
}
} }
ui_vp_message->setHtml(additive_previous + f_message_filtered); ui_vp_message->setHtml(additive_previous + f_message_filtered);
@ -6201,16 +6223,21 @@ void Courtroom::set_text_color_dropdown()
// Update markdown colors. TODO: make a loading function that only loads the // Update markdown colors. TODO: make a loading function that only loads the
// config file once instead of several times // config file once instead of several times
QString misc_to_check = ""; // default
if (Options::getInstance().customChatboxEnabled())
{
misc_to_check = ao_app->get_chat(current_char); // chatbox specific
}
for (int c = 0; c < max_colors; ++c) for (int c = 0; c < max_colors; ++c)
{ {
QColor color = ao_app->get_chat_color("c" + QString::number(c), ao_app->get_chat(current_char)); QColor color = ao_app->get_chat_color("c" + QString::number(c), misc_to_check);
color_rgb_list.append(color); color_rgb_list.append(color);
color_markdown_start_list.append(ao_app->get_chat_markup("c" + QString::number(c) + "_start", ao_app->get_chat(current_char))); color_markdown_start_list.append(ao_app->get_chat_markup("c" + QString::number(c) + "_start", misc_to_check));
color_markdown_end_list.append(ao_app->get_chat_markup("c" + QString::number(c) + "_end", ao_app->get_chat(current_char))); color_markdown_end_list.append(ao_app->get_chat_markup("c" + QString::number(c) + "_end", misc_to_check));
color_markdown_remove_list.append(ao_app->get_chat_markup("c" + QString::number(c) + "_remove", ao_app->get_chat(current_char)) == "1"); color_markdown_remove_list.append(ao_app->get_chat_markup("c" + QString::number(c) + "_remove", misc_to_check) == "1");
color_markdown_talking_list.append(ao_app->get_chat_markup("c" + QString::number(c) + "_talking", ao_app->get_chat(current_char)) != "0"); color_markdown_talking_list.append(ao_app->get_chat_markup("c" + QString::number(c) + "_talking", misc_to_check) != "0");
QString color_name = ao_app->get_chat_markup("c" + QString::number(c) + "_name", ao_app->get_chat(current_char)); QString color_name = ao_app->get_chat_markup("c" + QString::number(c) + "_name", misc_to_check);
if (color_name.isEmpty()) // Not defined if (color_name.isEmpty()) // Not defined
{ {
if (c > 0) if (c > 0)
@ -6386,7 +6413,10 @@ void Courtroom::on_reload_theme_clicked()
set_widgets(); set_widgets();
update_character(m_cid, ui_iniswap_dropdown->itemText(ui_iniswap_dropdown->currentIndex())); update_character(m_cid, ui_iniswap_dropdown->itemText(ui_iniswap_dropdown->currentIndex()));
enter_courtroom(); enter_courtroom();
gen_char_rgb_list(ao_app->get_chat(current_char)); if (Options::getInstance().customChatboxEnabled())
{
gen_char_rgb_list(ao_app->get_chat(current_char));
}
// to update status on the background // to update status on the background
set_background(current_background, true); set_background(current_background, true);