diff --git a/Attorney_Online_remake.pro b/Attorney_Online_remake.pro index df3ef9c..6938e4d 100644 --- a/Attorney_Online_remake.pro +++ b/Attorney_Online_remake.pro @@ -40,7 +40,8 @@ SOURCES += main.cpp\ emotes.cpp \ aosfxplayer.cpp \ aomusicplayer.cpp \ - aoblipplayer.cpp + aoblipplayer.cpp \ + evidence.cpp HEADERS += lobby.h \ aoimage.h \ diff --git a/aosfxplayer.cpp b/aosfxplayer.cpp index a2d89b0..3c52b24 100644 --- a/aosfxplayer.cpp +++ b/aosfxplayer.cpp @@ -21,8 +21,6 @@ void AOSfxPlayer::play(QString p_sfx, int p_volume, QString p_char) else f_path = ao_app->get_sounds_path() + p_sfx; - qDebug() << "sfx path: " << f_path; - m_stream = BASS_StreamCreateFile(FALSE, f_path.toStdString().c_str(), 0, 0, BASS_STREAM_AUTOFREE); set_volume(p_volume); diff --git a/courtroom.cpp b/courtroom.cpp index c32a9b0..b60a6e6 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -287,11 +287,11 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() set_widgets(); + //in evidence.cpp + construct_evidence(); + //implementation in emotes.cpp construct_emotes(); - - connect(ui_emote_left, SIGNAL(clicked()), this, SLOT(on_emote_left_clicked())); - connect(ui_emote_right, SIGNAL(clicked()), this, SLOT(on_emote_right_clicked())); } void Courtroom::set_mute_list() @@ -1019,7 +1019,7 @@ void Courtroom::handle_chatmessage_2() ui_vp_chatbox->set_image("chatmed.png"); else { - QString chatbox_path = ao_app->get_base_path() + "misc/" + chatbox; + QString chatbox_path = ao_app->get_base_path() + "misc/" + chatbox + ".png"; ui_vp_chatbox->set_image_from_path(chatbox_path); } diff --git a/courtroom.h b/courtroom.h index d281121..d567b28 100644 --- a/courtroom.h +++ b/courtroom.h @@ -171,6 +171,9 @@ private: int emote_rows = 2; int max_emotes_on_page = 10; + int current_evidence_page = 0; + //int current_evidence + //is set to true if the bg folder contains defensedesk.png, prosecutiondesk.png and stand.png bool is_ao2_bg = false; @@ -286,7 +289,8 @@ private: void construct_emotes(); void set_emote_page(); - + void construct_evidence(); + void set_evidence_page(); public slots: void objection_done(); diff --git a/emotes.cpp b/emotes.cpp index c32da40..b733822 100644 --- a/emotes.cpp +++ b/emotes.cpp @@ -52,6 +52,9 @@ void Courtroom::construct_emotes() set_size_and_pos(ui_emote_right, "emote_right"); ui_emote_right->set_image("arrow_right.png"); + + connect(ui_emote_left, SIGNAL(clicked()), this, SLOT(on_emote_left_clicked())); + connect(ui_emote_right, SIGNAL(clicked()), this, SLOT(on_emote_right_clicked())); } void Courtroom::set_emote_page() diff --git a/evidence.cpp b/evidence.cpp new file mode 100644 index 0000000..ec598df --- /dev/null +++ b/evidence.cpp @@ -0,0 +1,19 @@ +#include "courtroom.h" + +void Courtroom::construct_evidence() +{ + //constructing emote button grid + const int base_x_pos{10}; + const int base_y_pos{0}; + + const int x_modifier{49}; + int x_mod_count{0}; + + const int y_modifier{49}; + int y_mod_count{0}; + + emote_columns = ui_emotes->width() / x_modifier; + emote_rows = ui_emotes->height() / y_modifier; + + max_emotes_on_page = emote_columns * emote_rows; +} diff --git a/text_file_functions.cpp b/text_file_functions.cpp index b2a3d93..388a0d0 100644 --- a/text_file_functions.cpp +++ b/text_file_functions.cpp @@ -260,12 +260,8 @@ QString AOApplication::get_pre_emote(QString p_char, int p_emote) { QString f_result = read_char_ini(p_char, QString::number(p_emote + 1), "[Emotions]", "[SoundN]"); - qDebug() << "f_result" << f_result; - QStringList result_contents = f_result.split("#"); - - if (result_contents.size() < 4) { qDebug() << "W: misformatted char.ini: " << p_char << ", " << p_emote;