From 4771988c3bded39e32fc51d9184ed9a3b3b8929c Mon Sep 17 00:00:00 2001 From: Iamgoofball Date: Tue, 7 Aug 2018 01:44:25 -0700 Subject: [PATCH 1/6] i'm never going to figure out how to compile this shit --- datatypes.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datatypes.h b/datatypes.h index 37d3e99ac..49a5c65d6 100644 --- a/datatypes.h +++ b/datatypes.h @@ -53,6 +53,7 @@ struct chatmessage_type int cid; int sfx_delay; int flip; + int reverse; }; struct area_type @@ -92,7 +93,8 @@ enum CHAT_MESSAGE EVIDENCE_ID, FLIP, REALIZATION, - TEXT_COLOR + TEXT_COLOR, + REVERSE }; enum COLOR From 0815c50cca3ba85e532b8f246cb7ee7af6247710 Mon Sep 17 00:00:00 2001 From: Iamgoofball Date: Tue, 7 Aug 2018 01:46:28 -0700 Subject: [PATCH 2/6] Update courtroom.h --- courtroom.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/courtroom.h b/courtroom.h index 728502b4d..ff018d00b 100644 --- a/courtroom.h +++ b/courtroom.h @@ -337,6 +337,7 @@ class Courtroom : public QMainWindow QCheckBox *ui_pre; QCheckBox *ui_flip; QCheckBox *ui_guard; + QCheckBox *ui_reverse; AOButton *ui_custom_objection; AOButton *ui_realization; @@ -481,6 +482,7 @@ private slots: void on_pre_clicked(); void on_flip_clicked(); void on_guard_clicked(); + void on_reverse_clicked(); void on_evidence_button_clicked(); From 74a771733d05a49a85082f1a292e08fef4bdcc5f Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Tue, 7 Aug 2018 02:18:39 -0700 Subject: [PATCH 3/6] Adds a toggle option to reverse the pre-anim on emotes --- aocharmovie.cpp | 30 ++++++++++++++++++------ aocharmovie.h | 2 +- base/themes/default/courtroom_design.ini | 3 ++- courtroom.cpp | 24 +++++++++++++++++-- 4 files changed, 48 insertions(+), 11 deletions(-) diff --git a/aocharmovie.cpp b/aocharmovie.cpp index b591c2249..930def3da 100644 --- a/aocharmovie.cpp +++ b/aocharmovie.cpp @@ -56,24 +56,40 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) m_movie->start(); } -void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) +void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration, int reverse) { QString gif_path = ao_app->get_character_path(p_char) + p_emote.toLower(); m_movie->stop(); this->clear(); m_movie->setFileName(gif_path); - m_movie->jumpToFrame(0); - + if (reverse != 0): + { + m_movie->jumpToFrame(m_movie->frameCount()); + } + else + { + m_movie->jumpToFrame(0); + } int full_duration = duration * time_mod; int real_duration = 0; play_once = false; - - for (int n_frame = 0 ; n_frame < m_movie->frameCount() ; ++n_frame) + if (reverse != 0): + { + for (int n_frame = m_movie->frameCount() ; n_frame > 0 ; --n_frame) + { + real_duration += m_movie->nextFrameDelay(); + m_movie->jumpToFrame(n_frame - 1); + } + } + else { - real_duration += m_movie->nextFrameDelay(); - m_movie->jumpToFrame(n_frame + 1); + for (int n_frame = 0 ; n_frame < m_movie->frameCount() ; ++n_frame) + { + real_duration += m_movie->nextFrameDelay(); + m_movie->jumpToFrame(n_frame + 1); + } } qDebug() << "full_duration: " << full_duration; qDebug() << "real_duration: " << real_duration; diff --git a/aocharmovie.h b/aocharmovie.h index b26bada52..c6aa1f450 100644 --- a/aocharmovie.h +++ b/aocharmovie.h @@ -17,7 +17,7 @@ class AOCharMovie : public QLabel AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app); void play(QString p_char, QString p_emote, QString emote_prefix); - void play_pre(QString p_char, QString p_emote, int duration); + void play_pre(QString p_char, QString p_emote, int duration, int reverse); void play_talking(QString p_char, QString p_emote); void play_idle(QString p_char, QString p_emote); diff --git a/base/themes/default/courtroom_design.ini b/base/themes/default/courtroom_design.ini index 16e5f474f..36c2097d8 100644 --- a/base/themes/default/courtroom_design.ini +++ b/base/themes/default/courtroom_design.ini @@ -34,7 +34,8 @@ reload_theme = 5, 415, 101, 23 call_mod = 5, 440, 71, 23 pre = 187, 345, 51, 21 flip = 187, 362, 51, 21 -guard = 187, 379, 61, 21 +reverse = 187, 379, 51, 21 +guard = 187, 396, 61, 21 custom_objection = 250, 325, 40, 40 realization = 295, 325, 40, 40 mute_button = 340, 325, 40, 40 diff --git a/courtroom.cpp b/courtroom.cpp index 352a3da5c..51a69708e 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -143,6 +143,9 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_guard = new QCheckBox(this); ui_guard->setText("Guard"); ui_guard->hide(); + ui_reverse = new QCheckBox(this); + ui_reverse->setText("Reverse"); + ui_reverse->hide(); ui_custom_objection = new AOButton(this, ao_app); ui_realization = new AOButton(this, ao_app); @@ -244,6 +247,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() connect(ui_pre, SIGNAL(clicked()), this, SLOT(on_pre_clicked())); connect(ui_flip, SIGNAL(clicked()), this, SLOT(on_flip_clicked())); connect(ui_guard, SIGNAL(clicked()), this, SLOT(on_guard_clicked())); + connect(ui_reverse, SIGNAL(clicked()), this, SLOT(on_reverse_clicked())); connect(ui_evidence_button, SIGNAL(clicked()), this, SLOT(on_evidence_button_clicked())); @@ -450,6 +454,8 @@ void Courtroom::set_widgets() set_size_and_pos(ui_guard, "guard"); + set_size_and_pos(ui_reverse, "reverse"); + set_size_and_pos(ui_custom_objection, "custom_objection"); ui_custom_objection->set_image("custom.png"); @@ -799,6 +805,7 @@ void Courtroom::on_chat_return_pressed() //placeholder# //realization# //text_color#% + //reverse# QStringList packet_contents; @@ -901,6 +908,15 @@ void Courtroom::on_chat_return_pressed() packet_contents.append(f_text_color); + QString f_reverse; + + if (ui_reverse->isChecked()) + f_reverse = "1"; + else + f_reverse = "0"; + + packet_contents.append(f_flip); + ao_app->send_server_packet(new AOPacket("MS", packet_contents)); } @@ -1228,8 +1244,12 @@ void Courtroom::play_preanim() qDebug() << "could not find " + ao_app->get_character_path(f_char) + f_preanim.toLower() + ".gif"; return; } - - ui_vp_player_char->play_pre(f_char, f_preanim, preanim_duration); + int is_reversed = 0; + if (m_chatmessage[REVERSE] == "1") + { + is_reversed = 1; + } + ui_vp_player_char->play_pre(f_char, f_preanim, preanim_duration, is_reversed); anim_state = 1; if (text_delay >= 0) text_delay_timer->start(text_delay); From 3a8dc7aae8ca17b293e5bc675b82bdff71db7a2d Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Tue, 7 Aug 2018 02:37:04 -0700 Subject: [PATCH 4/6] fgdasfsz --- courtroom.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/courtroom.cpp b/courtroom.cpp index 51a69708e..eee160967 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -145,7 +145,6 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_guard->hide(); ui_reverse = new QCheckBox(this); ui_reverse->setText("Reverse"); - ui_reverse->hide(); ui_custom_objection = new AOButton(this, ao_app); ui_realization = new AOButton(this, ao_app); From f7fa6e02b005e98507b8d6e852e37470b2cb3d4e Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Tue, 7 Aug 2018 02:37:53 -0700 Subject: [PATCH 5/6] I'm dumb lmao --- courtroom.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/courtroom.cpp b/courtroom.cpp index eee160967..0d6d752a8 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -2098,6 +2098,11 @@ void Courtroom::on_flip_clicked() ui_ic_chat_message->setFocus(); } +void Courtroom::on_reverse_clicked() +{ + ui_ic_chat_message->setFocus(); +} + void Courtroom::on_guard_clicked() { ui_ic_chat_message->setFocus(); From 46673ed9009779de181739dfca12adb4f860df92 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Tue, 7 Aug 2018 02:41:48 -0700 Subject: [PATCH 6/6] let's try this out --- courtroom.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/courtroom.cpp b/courtroom.cpp index 0d6d752a8..e9642d35f 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -2100,6 +2100,13 @@ void Courtroom::on_flip_clicked() void Courtroom::on_reverse_clicked() { + if (ui_pre->isChecked() == false) + { + if(ui_reverse->isChecked()) + { + ui_pre->setChecked(false) + } + } ui_ic_chat_message->setFocus(); }