aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2017-02-14 13:16:45 +0100
committerDavid Skoland <davidskoland@gmail.com>2017-02-14 13:16:45 +0100
commitbc2f15e4f133da5db723f08935cffb4373adef2a (patch)
treee7a6e32ca98a6af60ba9d81b580732ef6d4ebb03
parentfd6fbc4b54297dee873e25830bc5f954745ffb49 (diff)
removed debug statements, fixed a chatbox issue
-rw-r--r--Attorney_Online_remake.pro3
-rw-r--r--aosfxplayer.cpp2
-rw-r--r--courtroom.cpp8
-rw-r--r--courtroom.h6
-rw-r--r--emotes.cpp3
-rw-r--r--evidence.cpp19
-rw-r--r--text_file_functions.cpp4
7 files changed, 33 insertions, 12 deletions
diff --git a/Attorney_Online_remake.pro b/Attorney_Online_remake.pro
index df3ef9cb..6938e4de 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 a2d89b0c..3c52b24d 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 c32a9b0b..b60a6e6e 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 d281121c..d567b281 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 c32da400..b733822d 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 00000000..ec598dfa
--- /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 b2a3d933..388a0d0d 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;