aboutsummaryrefslogtreecommitdiff
path: root/src/aoemotebutton.cpp
diff options
context:
space:
mode:
authorin1tiate <32779090+in1tiate@users.noreply.github.com>2021-01-11 12:01:09 -0600
committerGitHub <noreply@github.com>2021-01-11 12:01:09 -0600
commit967f17a53f13e0542db9699baef7936eb955fea7 (patch)
treeee5ce2cad236243c43f8719c96d8342ee3afa5af /src/aoemotebutton.cpp
parentd54d1c1b729d86953903f25e8b0d7c2104c7c3f5 (diff)
Allow button generator to generate both on and off buttons (#320)
We'll see how cursed this is.
Diffstat (limited to 'src/aoemotebutton.cpp')
-rw-r--r--src/aoemotebutton.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/aoemotebutton.cpp b/src/aoemotebutton.cpp
index 652010d2..07e6a42c 100644
--- a/src/aoemotebutton.cpp
+++ b/src/aoemotebutton.cpp
@@ -25,7 +25,10 @@ void AOEmoteButton::set_image(QString p_image, QString p_emote_comment)
"\") 0 0 0 0 stretch stretch; }"
"QToolTip { color: #000000; background-color: #ffffff; border: 0px; }");
}
- else if (p_image.contains("_on") && file_exists(tmp_p_image.replace("_on", "_off"))) {
+ else if ((p_image.contains("_on") &&
+ file_exists(tmp_p_image.replace("_on", "_off"))) ||
+ (p_image.contains("_off") &&
+ file_exists(tmp_p_image.replace("_off", "_on")))) {
QImage tmpImage(tmp_p_image);
tmpImage = tmpImage.convertToFormat(QImage::Format_ARGB32);
QPoint p1, p2;