diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-09-16 21:10:21 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-09-16 21:10:21 +0300 |
| commit | f3c7beab70aeb1e9b1446553c3cb57345a1e5eb7 (patch) | |
| tree | ab1116c21ebfc006c96ce87f9303a3bcbb057f96 | |
| parent | b085be5a2a0512c432bc9fd58413a9d8f93d451e (diff) | |
Chat arrow indicator to inform you if the current message stopped being processed
Can be modified from the theme in chat_arrow of courtroom_design.ini
Uses chat_arrow .png/.gif/etc.
| -rw-r--r-- | include/courtroom.h | 1 | ||||
| -rw-r--r-- | src/courtroom.cpp | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/courtroom.h b/include/courtroom.h index 9b3c0577..45a3dfd3 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -424,6 +424,7 @@ private: AOEvidenceDisplay *ui_vp_evidence_display; AOImage *ui_vp_chatbox; QLabel *ui_vp_showname; + AOMovie *ui_vp_chat_arrow; QTextEdit *ui_vp_message; AOMovie *ui_vp_realization; AOMovie *ui_vp_testimony; diff --git a/src/courtroom.cpp b/src/courtroom.cpp index cfdc8fbb..b2c98bc0 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -87,6 +87,9 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_vp_chatbox = new AOImage(this, ao_app); ui_vp_showname = new QLabel(ui_vp_chatbox); ui_vp_showname->setAlignment(Qt::AlignHCenter); + ui_vp_chat_arrow = new AOMovie(ui_vp_chatbox, ao_app); + ui_vp_chat_arrow->set_play_once(false); + ui_vp_message = new QTextEdit(this); ui_vp_message->setFrameStyle(QFrame::NoFrame); ui_vp_message->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -491,6 +494,20 @@ void Courtroom::set_widgets() // ui_vp_message->setStyleSheet("background-color: rgba(0, 0, 0, 0);" // "color: white"); + ui_vp_chat_arrow->move(0, 0); + pos_size_type design_ini_result = ao_app->get_element_dimensions("chat_arrow", "courtroom_design.ini"); + + 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); + } + ui_vp_testimony->move(ui_viewport->x(), ui_viewport->y()); ui_vp_testimony->combo_resize(ui_viewport->width(), ui_viewport->height()); @@ -1395,6 +1412,9 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) if (f_message == previous_ic_message) return; + //Stop the chat arrow from animating + ui_vp_chat_arrow->stop(); + text_state = 0; anim_state = 0; ui_vp_objection->stop(); @@ -2302,6 +2322,7 @@ void Courtroom::chat_tick() anim_state = 3; ui_vp_player_char->play_idle(m_chatmessage[CHAR_NAME], m_chatmessage[EMOTE]); } + ui_vp_chat_arrow->play("chat_arrow"); //Chat stopped being processed, indicate that. } else |
