@@ -608,6 +608,8 @@ void Courtroom::done_received()
608608 set_mute_list ();
609609
610610 show ();
611+
612+ ui_spectator->show ();
611613}
612614
613615void Courtroom::set_char_select_page ()
@@ -681,22 +683,30 @@ void Courtroom::set_background(QString p_background)
681683void Courtroom::enter_courtroom (int p_cid)
682684{
683685 m_cid = p_cid;
684- QString f_char = ao_app->get_char_name (char_list.at (m_cid).name );
686+
687+ QString f_char;
688+
689+ if (m_cid == -1 )
690+ f_char = " " ;
691+ else
692+ f_char = ao_app->get_char_name (char_list.at (m_cid).name );
693+
685694 current_char = f_char;
686695
687696 current_emote_page = 0 ;
688697 current_emote = 0 ;
689698
690- ui_emotes->show ();
699+ if (m_cid == -1 )
700+ ui_emotes->hide ();
701+ else
702+ ui_emotes->show ();
691703
692704 set_emote_page ();
693705
694706 current_evidence_page = 0 ;
695707 current_evidence = 0 ;
696708
697- qDebug () << " setting evidence page" ;
698709 set_evidence_page ();
699- qDebug () << " evidence page set" ;
700710
701711 QString side = ao_app->get_char_side (f_char);
702712
@@ -743,7 +753,7 @@ void Courtroom::enter_courtroom(int p_cid)
743753
744754 ui_char_select_background->hide ();
745755
746- ui_ic_chat_message->setEnabled (true );
756+ ui_ic_chat_message->setEnabled (m_cid != - 1 );
747757 ui_ic_chat_message->setFocus ();
748758}
749759
@@ -1147,6 +1157,12 @@ void Courtroom::play_preanim()
11471157 QString f_char = m_chatmessage[CHAR_NAME ];
11481158 QString f_preanim = m_chatmessage[PRE_EMOTE ];
11491159
1160+ if (!file_exists (ao_app->get_character_path (f_char) + " .gif" ))
1161+ {
1162+ preanim_done ();
1163+ return ;
1164+ }
1165+
11501166 // all time values in char.inis are multiplied by a constant(time_mod) to get the actual time
11511167 int preanim_duration = ao_app->get_preanim_duration (f_char, f_preanim) * time_mod;
11521168 int text_delay = ao_app->get_text_delay (f_char, f_preanim) * time_mod;
@@ -1740,6 +1756,7 @@ void Courtroom::on_change_character_clicked()
17401756 blip_player->set_volume (0 );
17411757
17421758 ui_char_select_background->show ();
1759+ ui_spectator->hide ();
17431760}
17441761
17451762void Courtroom::on_reload_theme_clicked ()
@@ -1775,12 +1792,9 @@ void Courtroom::on_char_select_right_clicked()
17751792
17761793void Courtroom::on_spectator_clicked ()
17771794{
1778- ui_emotes->hide ();
1779-
1780- ui_witness_testimony->hide ();
1781- ui_cross_examination->hide ();
1795+ enter_courtroom (-1 );
17821796
1783- ui_ic_chat_message-> setEnabled ( false );
1797+ ui_emotes-> hide ( );
17841798
17851799 ui_char_select_background->hide ();
17861800}
0 commit comments