@@ -43,6 +43,8 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
4343 music_player->set_volume (0 );
4444 sfx_player = new AOSfxPlayer (this , ao_app);
4545 sfx_player->set_volume (0 );
46+ objection_player = new AOSfxPlayer (this , ao_app);
47+ sfx_player->set_volume (0 );
4648 blip_player = new AOBlipPlayer (this , ao_app);
4749 blip_player->set_volume (0 );
4850
@@ -57,17 +59,18 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
5759 ui_vp_player_char = new AOCharMovie (ui_viewport, ao_app);
5860 ui_vp_desk = new AOScene (ui_viewport, ao_app);
5961 ui_vp_legacy_desk = new AOScene (ui_viewport, ao_app);
60- ui_vp_chatbox = new AOImage (ui_viewport, ao_app);
62+ ui_vp_testimony = new AOImage (ui_viewport, ao_app);
63+ ui_vp_realization = new AOImage (this , ao_app);
64+ ui_vp_wtce = new AOMovie (ui_viewport, ao_app);
65+ ui_vp_objection = new AOMovie (ui_viewport, ao_app);
66+
67+ ui_vp_chatbox = new AOImage (this , ao_app);
6168 ui_vp_showname = new QLabel (ui_vp_chatbox);
6269 ui_vp_message = new QPlainTextEdit (ui_vp_chatbox);
6370 ui_vp_message->setFrameStyle (QFrame::NoFrame);
6471 ui_vp_message->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
6572 ui_vp_message->setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
6673 ui_vp_message->setReadOnly (true );
67- ui_vp_testimony = new AOImage (ui_viewport, ao_app);
68- ui_vp_realization = new AOImage (this , ao_app);
69- ui_vp_wtce = new AOMovie (ui_viewport, ao_app);
70- ui_vp_objection = new AOMovie (ui_viewport, ao_app);
7174
7275 ui_ic_chatlog = new QPlainTextEdit (this );
7376 ui_ic_chatlog->setReadOnly (true );
@@ -378,6 +381,7 @@ void Courtroom::set_widgets()
378381 " color: white;" );
379382
380383 set_size_and_pos (ui_vp_message, " message" );
384+ ui_vp_message->setTextInteractionFlags (Qt::NoTextInteraction);
381385 #if (defined (_WIN32) || defined (_WIN64))
382386 ui_vp_message->setFont (pt_10);
383387 #else
@@ -408,14 +412,14 @@ void Courtroom::set_widgets()
408412 #else
409413 ui_ic_chatlog->setFont (pt_9);
410414 #endif
411- ui_ic_chatlog->setStyleSheet (" background-color: rgba(0, 0, 0, 0);"
412- " color: white;" );
415+ ui_ic_chatlog->setStyleSheet (" QPlainTextEdit{ background-color: rgba(0, 0, 0, 0);"
416+ " color: white; } " );
413417
414418 set_size_and_pos (ui_ms_chatlog, " ms_chatlog" );
415- ui_ms_chatlog->setStyleSheet (" background-color: rgba(0, 0, 0, 0);" );
419+ ui_ms_chatlog->setStyleSheet (" QPlainTextEdit{ background-color: rgba(0, 0, 0, 0); } " );
416420
417421 set_size_and_pos (ui_server_chatlog, " server_chatlog" );
418- ui_server_chatlog->setStyleSheet (" background-color: rgba(0, 0, 0, 0);" );
422+ ui_server_chatlog->setStyleSheet (" QPlainTextEdit{ background-color: rgba(0, 0, 0, 0); } " );
419423
420424 set_size_and_pos (ui_mute_list, " mute_list" );
421425 ui_mute_list->hide ();
@@ -601,6 +605,7 @@ void Courtroom::done_received()
601605
602606 music_player->set_volume (0 );
603607 sfx_player->set_volume (0 );
608+ objection_player->set_volume (0 );
604609 blip_player->set_volume (0 );
605610
606611 set_char_select_page ();
@@ -747,6 +752,7 @@ void Courtroom::enter_courtroom(int p_cid)
747752
748753 music_player->set_volume (ui_music_slider->value ());
749754 sfx_player->set_volume (ui_sfx_slider->value ());
755+ objection_player->set_volume (ui_sfx_slider->value ());
750756 blip_player->set_volume (ui_blip_slider->value ());
751757
752758 testimony_in_progress = false ;
@@ -954,7 +960,7 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
954960 if (mute_map.value (m_chatmessage[CHAR_NAME ]))
955961 return ;
956962
957- QString f_showname = ao_app->get_showname (m_chatmessage[CHAR_NAME ] );
963+ QString f_showname = ao_app->get_showname (char_list. at ( m_chatmessage[CHAR_ID ]. toInt ()). name );
958964
959965 QString f_message = f_showname + " : " + m_chatmessage[MESSAGE ] + ' \n ' ;
960966
@@ -992,20 +998,20 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
992998 {
993999 case 1 :
9941000 ui_vp_objection->play (" holdit" );
995- sfx_player ->play (" holdit.wav" , m_chatmessage[CHAR_NAME ]);
1001+ objection_player ->play (" holdit.wav" , m_chatmessage[CHAR_NAME ]);
9961002 break ;
9971003 case 2 :
9981004 ui_vp_objection->play (" objection" );
999- sfx_player ->play (" objection.wav" , m_chatmessage[CHAR_NAME ]);
1005+ objection_player ->play (" objection.wav" , m_chatmessage[CHAR_NAME ]);
10001006 break ;
10011007 case 3 :
10021008 ui_vp_objection->play (" takethat" );
1003- sfx_player ->play (" takethat.wav" , m_chatmessage[CHAR_NAME ]);
1009+ objection_player ->play (" takethat.wav" , m_chatmessage[CHAR_NAME ]);
10041010 break ;
10051011 // case 4 is AO2 only
10061012 case 4 :
10071013 ui_vp_objection->play (" custom" , m_chatmessage[CHAR_NAME ]);
1008- sfx_player ->play (" custom.wav" , m_chatmessage[CHAR_NAME ]);
1014+ objection_player ->play (" custom.wav" , m_chatmessage[CHAR_NAME ]);
10091015 break ;
10101016 default :
10111017 qDebug () << " W: Logic error in objection switch statement!" ;
@@ -1030,7 +1036,7 @@ void Courtroom::handle_chatmessage_2()
10301036 ui_vp_speedlines->stop ();
10311037 ui_vp_player_char->stop ();
10321038
1033- QString f_showname = ao_app->get_showname (m_chatmessage[CHAR_NAME ] );
1039+ QString f_showname = ao_app->get_showname (char_list. at ( m_chatmessage[CHAR_ID ]. toInt ()). name );
10341040
10351041 ui_vp_showname->setText (f_showname);
10361042
@@ -1157,14 +1163,15 @@ void Courtroom::play_preanim()
11571163 QString f_char = m_chatmessage[CHAR_NAME ];
11581164 QString f_preanim = m_chatmessage[PRE_EMOTE ];
11591165
1160- if (!file_exists (ao_app->get_character_path (f_char) + " .gif" ))
1166+ if (!file_exists (ao_app->get_character_path (f_char) + f_preanim. toLower () + " .gif" ))
11611167 {
11621168 preanim_done ();
1169+ qDebug () << " could not find " + ao_app->get_character_path (f_char) + f_preanim + " .gif" ;
11631170 return ;
11641171 }
11651172
11661173 // all time values in char.inis are multiplied by a constant(time_mod) to get the actual time
1167- int preanim_duration = ao_app->get_preanim_duration (f_char, f_preanim) * time_mod;
1174+ int preanim_duration = ao_app->get_ao2_preanim_duration (f_char, f_preanim) * time_mod;
11681175 int text_delay = ao_app->get_text_delay (f_char, f_preanim) * time_mod;
11691176 int sfx_delay = m_chatmessage[SFX_DELAY ].toInt () * time_mod;
11701177
@@ -1720,6 +1727,7 @@ void Courtroom::on_music_slider_moved(int p_value)
17201727void Courtroom::on_sfx_slider_moved (int p_value)
17211728{
17221729 sfx_player->set_volume (p_value);
1730+ objection_player->set_volume (p_value);
17231731 ui_ic_chat_message->setFocus ();
17241732}
17251733
@@ -1753,6 +1761,7 @@ void Courtroom::on_change_character_clicked()
17531761{
17541762 music_player->set_volume (0 );
17551763 sfx_player->set_volume (0 );
1764+ sfx_player->set_volume (0 );
17561765 blip_player->set_volume (0 );
17571766
17581767 ui_char_select_background->show ();
@@ -1862,4 +1871,6 @@ Courtroom::~Courtroom()
18621871{
18631872 delete music_player;
18641873 delete sfx_player;
1874+ delete objection_player;
1875+ delete blip_player;
18651876}
0 commit comments