aboutsummaryrefslogtreecommitdiff
path: root/evidence.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'evidence.cpp')
-rw-r--r--evidence.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/evidence.cpp b/evidence.cpp
index ec598df..51a568f 100644
--- a/evidence.cpp
+++ b/evidence.cpp
@@ -2,7 +2,7 @@
void Courtroom::construct_evidence()
{
- //constructing emote button grid
+ //constructing evidence button grid
const int base_x_pos{10};
const int base_y_pos{0};
@@ -12,8 +12,31 @@ void Courtroom::construct_evidence()
const int y_modifier{49};
int y_mod_count{0};
- emote_columns = ui_emotes->width() / x_modifier;
- emote_rows = ui_emotes->height() / y_modifier;
+ evidence_columns = ui_evidence->width() / x_modifier;
+ evidence_rows = ui_evidence->height() / y_modifier;
- max_emotes_on_page = emote_columns * emote_rows;
+ max_evidence_on_page = evidence_columns * evidence_rows;
+
+ for (int n = 0 ; n < max_emotes_on_page ; ++n)
+ {
+ int x_pos = base_x_pos + (x_modifier * x_mod_count);
+ int y_pos = base_y_pos + (y_modifier * y_mod_count);
+
+ AOEmoteButton *f_emote = new AOEmoteButton(ui_emotes, ao_app, x_pos, y_pos);
+
+ ui_emote_list.append(f_emote);
+
+ f_emote->set_id(n);
+
+ connect(f_emote, SIGNAL(emote_clicked(int)), this, SLOT(on_emote_clicked(int)));
+
+ ++x_mod_count;
+
+ //if emote number is divisible by columns with rest columns -1 then the next emote button should start on a new line
+ if ((n % emote_columns) == (emote_columns - 1) && (n != 0))
+ {
+ ++y_mod_count;
+ x_mod_count = 0;
+ }
+ }
}