diff --git a/courtroom.cpp b/courtroom.cpp index 6e8d3b3..88571af 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -600,12 +600,36 @@ void Courtroom::enter_courtroom(int p_cid) ui_flip->show(); } + list_music(); + ui_char_select_background->hide(); ui_ic_chat_message->setEnabled(true); ui_ic_chat_message->setFocus(); } +void Courtroom::list_music() +{ + ui_music_list->clear(); + + for (int n_song = 0 ; n_song < music_list.size() ; ++n_song) + { + QString i_song = music_list.at(n_song); + + if (i_song.toLower().contains(ui_music_search->text().toLower())) + { + ui_music_list->addItem(i_song); + + QString song_path = ao_app->get_base_path() + "sounds/music/" + i_song.toLower(); + + if (file_exists(song_path)) + ui_music_list->item(n_song)->setBackground(Qt::green); + else + ui_music_list->item(n_song)->setBackground(Qt::red); + } + } +} + void Courtroom::append_ms_chatmessage(QString f_message) { const QTextCursor old_cursor = ui_ms_chatlog->textCursor(); diff --git a/courtroom.h b/courtroom.h index 0478ae6..b1d32d7 100644 --- a/courtroom.h +++ b/courtroom.h @@ -56,6 +56,7 @@ public: QString get_current_char() {return current_char;} void enter_courtroom(int p_cid); + void list_music(); void append_ms_chatmessage(QString f_message); void append_server_chatmessage(QString f_message); diff --git a/emotes.cpp b/emotes.cpp index 25d97e6..c1598aa 100644 --- a/emotes.cpp +++ b/emotes.cpp @@ -104,12 +104,8 @@ void Courtroom::on_emote_clicked(int p_id) f_emote->set_off(current_char, n_real_emote); } - qDebug() << "on_emote_clicked with current_emote " << current_emote; - int emote_mod = ao_app->get_emote_mod(current_char, current_emote); - qDebug() << "on_emote_clicked called with emote mod " << emote_mod; - if (emote_mod == 1 || emote_mod == 3 || emote_mod == 4) diff --git a/packet_distribution.cpp b/packet_distribution.cpp index 9697ada..0b7853e 100644 --- a/packet_distribution.cpp +++ b/packet_distribution.cpp @@ -297,7 +297,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) if (f_contents.size() < 3) goto end; - w_courtroom->enter_courtroom(f_contents.at(2).toInt()); + if (courtroom_constructed) + w_courtroom->enter_courtroom(f_contents.at(2).toInt()); } else if (header == "MS") { @@ -308,8 +309,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) { if (f_contents.size() < 1) goto end; - - w_courtroom->handle_wtce(f_contents.at(0)); + if (courtroom_constructed) + w_courtroom->handle_wtce(f_contents.at(0)); } else if (header == "checkconnection") {