aboutsummaryrefslogtreecommitdiff
path: root/emotes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'emotes.cpp')
-rw-r--r--emotes.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/emotes.cpp b/emotes.cpp
new file mode 100644
index 00000000..71f9cb40
--- /dev/null
+++ b/emotes.cpp
@@ -0,0 +1,45 @@
+#include "courtroom.h"
+
+#include "aoemotebutton.h"
+
+void Courtroom::construct_emotes()
+{
+ //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};
+
+ for (int n = 0 ; n < 90 ; ++n)
+ {
+ int x_pos = base_x_pos + (x_modifier * x_mod_count);
+ int y_pos = base_y_pos + (y_modifier * y_mod_count);
+
+ ui_emote_list.append(new AOEmoteButton(ui_emotes, ao_app, x_pos, y_pos));
+
+ ++x_mod_count;
+
+ //if char number is divisible by 5 with rest 4 then the next emote button should start on a new line
+ if (n % 5 == 4 && n != 0)
+ {
+ ++y_mod_count;
+ x_mod_count = 0;
+ }
+ }
+}
+
+void Courtroom::set_emote_page()
+{
+ ui_emote_left->hide();
+ ui_emote_right->hide();
+
+ for (AOEmoteButton *i_button : ui_emote_list)
+ {
+ i_button->hide();
+ }
+
+}