aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/courtroom.cpp16
-rw-r--r--src/text_file_functions.cpp26
2 files changed, 32 insertions, 10 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index d310a0a5..c7f19364 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -1806,10 +1806,22 @@ void Courtroom::handle_chatmessage_2()
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);
+ }
}
- pos_size_type default_width = ao_app->get_element_dimensions("showname", "courtroom_design.ini");
- int extra_width = ao_app->get_design_element("showname_extra_width", "courtroom_design.ini").toInt();
+ pos_size_type default_width = ao_app->get_element_dimensions("showname", "courtroom_design.ini", m_chatmessage[CHAR_NAME]);
+ int extra_width = ao_app->get_design_element("showname_extra_width", "courtroom_design.ini", m_chatmessage[CHAR_NAME]).toInt();
if(extra_width > 0)
{
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index c3948123..d9867094 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -264,11 +264,12 @@ QPoint AOApplication::get_button_spacing(QString p_identifier, QString p_file)
return return_value;
}
-pos_size_type AOApplication::get_element_dimensions(QString p_identifier, QString p_file)
+pos_size_type AOApplication::get_element_dimensions(QString p_identifier, QString p_file, QString p_char)
{
+ QString char_ini_path = get_base_path() + "misc/" + get_chat(p_char) + "/" + p_file;
QString design_ini_path = get_theme_path(p_file);
QString default_path = get_default_theme_path(p_file);
- QString f_result = read_design_ini(p_identifier, design_ini_path);
+ QString f_result = read_design_ini(p_identifier, char_ini_path);
pos_size_type return_value;
@@ -279,10 +280,14 @@ pos_size_type AOApplication::get_element_dimensions(QString p_identifier, QStrin
if (f_result == "")
{
- f_result = read_design_ini(p_identifier, default_path);
-
+ f_result = read_design_ini(p_identifier, design_ini_path);
if (f_result == "")
- return return_value;
+ {
+ f_result = read_design_ini(p_identifier, default_path);
+
+ if (f_result == "")
+ return return_value;
+ }
}
QStringList sub_line_elements = f_result.split(",");
@@ -297,13 +302,18 @@ pos_size_type AOApplication::get_element_dimensions(QString p_identifier, QStrin
return return_value;
}
-QString AOApplication::get_design_element(QString p_identifier, QString p_file)
+QString AOApplication::get_design_element(QString p_identifier, QString p_file, QString p_char)
{
+ QString char_ini_path = get_base_path() + "misc/" + get_chat(p_char) + "/" + p_file;
QString design_ini_path = get_theme_path(p_file);
- QString f_result = read_design_ini(p_identifier, design_ini_path);
QString default_path = get_default_theme_path(p_file);
+ QString f_result = read_design_ini(p_identifier, char_ini_path);
if (f_result == "")
- f_result = read_design_ini(p_identifier, default_path);
+ {
+ f_result = read_design_ini(p_identifier, design_ini_path);
+ if (f_result == "")
+ f_result = read_design_ini(p_identifier, default_path);
+ }
return f_result;
}
QString AOApplication::get_font_name(QString p_identifier, QString p_file)