aboutsummaryrefslogtreecommitdiff
path: root/src/emotes.cpp
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2020-04-17 21:57:16 -0500
committeroldmud0 <oldmud0@users.noreply.github.com>2020-04-17 21:57:16 -0500
commit13942345c6a3e7e1625c6c26cc2f2f368a3bff23 (patch)
tree73ce940217b57fd47afb6a95e828e6309ed5e683 /src/emotes.cpp
parentfaac191f0b9e99b82614ed3959ec5c67f56a1fc3 (diff)
Run clang-format on entire project
Indentation fixed to 2 spaces per tab. Braces set to Stroustrup style. Lines reflow at 80 characters. One-line method bodies are on the same line as the signature. Space always after `//`. No indentation on preprocessor macros. Includes are sorted lexicographically. If you don't want to see this commit on blames, use the hidden whitespace option on GitHub, or use `-w` in git-blame.
Diffstat (limited to 'src/emotes.cpp')
-rw-r--r--src/emotes.cpp43
1 files changed, 20 insertions, 23 deletions
diff --git a/src/emotes.cpp b/src/emotes.cpp
index b6a217e6..bbe2f5c9 100644
--- a/src/emotes.cpp
+++ b/src/emotes.cpp
@@ -8,7 +8,8 @@ void Courtroom::construct_emotes()
set_size_and_pos(ui_emotes, "emotes");
- QPoint f_spacing = ao_app->get_button_spacing("emote_button_spacing", "courtroom_design.ini");
+ QPoint f_spacing = ao_app->get_button_spacing("emote_button_spacing",
+ "courtroom_design.ini");
const int button_width = 40;
int x_spacing = f_spacing.x();
@@ -18,13 +19,14 @@ void Courtroom::construct_emotes()
int y_spacing = f_spacing.y();
int y_mod_count = 0;
- emote_columns = ((ui_emotes->width() - button_width) / (x_spacing + button_width)) + 1;
- emote_rows = ((ui_emotes->height() - button_height) / (y_spacing + button_height)) + 1;
+ emote_columns =
+ ((ui_emotes->width() - button_width) / (x_spacing + button_width)) + 1;
+ emote_rows =
+ ((ui_emotes->height() - button_height) / (y_spacing + button_height)) + 1;
max_emotes_on_page = emote_columns * emote_rows;
- for (int n = 0 ; n < max_emotes_on_page ; ++n)
- {
+ for (int n = 0; n < max_emotes_on_page; ++n) {
int x_pos = (button_width + x_spacing) * x_mod_count;
int y_pos = (button_height + y_spacing) * y_mod_count;
@@ -34,12 +36,12 @@ void Courtroom::construct_emotes()
f_emote->set_id(n);
- connect(f_emote, SIGNAL(emote_clicked(int)), this, SLOT(on_emote_clicked(int)));
+ connect(f_emote, SIGNAL(emote_clicked(int)), this,
+ SLOT(on_emote_clicked(int)));
++x_mod_count;
- if (x_mod_count == emote_columns)
- {
+ if (x_mod_count == emote_columns) {
++y_mod_count;
x_mod_count = 0;
}
@@ -56,23 +58,20 @@ void Courtroom::set_emote_page()
ui_emote_left->hide();
ui_emote_right->hide();
- for (AOEmoteButton *i_button : ui_emote_list)
- {
+ for (AOEmoteButton *i_button : ui_emote_list) {
i_button->hide();
}
int total_pages = total_emotes / max_emotes_on_page;
int emotes_on_page = 0;
- if (total_emotes % max_emotes_on_page != 0)
- {
+ if (total_emotes % max_emotes_on_page != 0) {
++total_pages;
- //i. e. not on the last page
+ // i. e. not on the last page
if (total_pages > current_emote_page + 1)
emotes_on_page = max_emotes_on_page;
else
emotes_on_page = total_emotes % max_emotes_on_page;
-
}
else
emotes_on_page = max_emotes_on_page;
@@ -83,8 +82,7 @@ void Courtroom::set_emote_page()
if (current_emote_page > 0)
ui_emote_left->show();
- for (int n_emote = 0 ; n_emote < emotes_on_page ; ++n_emote)
- {
+ for (int n_emote = 0; n_emote < emotes_on_page; ++n_emote) {
int n_real_emote = n_emote + current_emote_page * max_emotes_on_page;
AOEmoteButton *f_emote = ui_emote_list.at(n_emote);
@@ -95,7 +93,6 @@ void Courtroom::set_emote_page()
f_emote->show();
}
-
}
void Courtroom::set_emote_dropdown()
@@ -105,8 +102,7 @@ void Courtroom::set_emote_dropdown()
int total_emotes = ao_app->get_emote_number(current_char);
QStringList emote_list;
- for (int n = 0 ; n < total_emotes ; ++n)
- {
+ for (int n = 0; n < total_emotes; ++n) {
emote_list.append(ao_app->get_emote_comment(current_char, n));
}
@@ -119,19 +115,20 @@ void Courtroom::select_emote(int p_id)
int max = (max_emotes_on_page - 1) + current_emote_page * max_emotes_on_page;
if (current_emote >= min && current_emote <= max)
- ui_emote_list.at(current_emote % max_emotes_on_page)->set_image(current_char, current_emote, "_off.png");
+ ui_emote_list.at(current_emote % max_emotes_on_page)
+ ->set_image(current_char, current_emote, "_off.png");
int old_emote = current_emote;
current_emote = p_id;
if (current_emote >= min && current_emote <= max)
- ui_emote_list.at(current_emote % max_emotes_on_page)->set_image(current_char, current_emote, "_on.png");
+ ui_emote_list.at(current_emote % max_emotes_on_page)
+ ->set_image(current_char, current_emote, "_on.png");
int emote_mod = ao_app->get_emote_mod(current_char, current_emote);
- if (old_emote == current_emote)
- {
+ if (old_emote == current_emote) {
ui_pre->setChecked(!ui_pre->isChecked());
}
else if (emote_mod == 1)