diff options
| author | Crystalwarrior <Varsash@Gmail.com> | 2022-07-07 13:59:34 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-07 13:59:34 +0300 |
| commit | d45834561211bae5525135294f2f5e732ba80854 (patch) | |
| tree | e183537c26bda66fa3690509a64204305e46cad5 /src/emotes.cpp | |
| parent | 7805e80e8337d538b671a35cf15335fbcc54d3e5 (diff) | |
Overlay emote_buttons with emote_selected image from theme instead of generating files (#727)
* Create an "emote_selected" overlay for emote buttons using default theme's emote_selected image
It is used if "_on" button image is not found on the character.
If emote_selected image is missing from the default theme, use a simple transparent black color overlay instead.
Replaces auto-generation of _off images
* clang plz
* use static overlays only
Diffstat (limited to 'src/emotes.cpp')
| -rw-r--r-- | src/emotes.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/emotes.cpp b/src/emotes.cpp index 3c06d439..669aa179 100644 --- a/src/emotes.cpp +++ b/src/emotes.cpp @@ -63,13 +63,15 @@ void Courtroom::refresh_emotes() max_emotes_on_page = emote_columns * emote_rows; + QString selected_image = ao_app->get_image_suffix(ao_app->get_theme_path("emote_selected", ""), true); + 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; AOEmoteButton *f_emote = new AOEmoteButton(ui_emotes, ao_app, x_pos, y_pos, button_width, button_height); - + f_emote->set_selected_image(selected_image); ui_emote_list.append(f_emote); f_emote->set_id(n); |
