Make dark clan colors visible in stats screen
authorWuzzy <Wuzzy2@mail.ru>
Mon, 01 Apr 2019 23:15:18 +0200
changeset 14742 123aaa2bf4b5
parent 14741 8563cc40fc1e
child 14743 9423d30ec205
Make dark clan colors visible in stats screen
ChangeLog.txt
QTfrontend/hwconsts.cpp.in
QTfrontend/hwconsts.h
QTfrontend/ui/page/pagegamestats.cpp
--- a/ChangeLog.txt	Mon Apr 01 22:07:42 2019 +0200
+++ b/ChangeLog.txt	Mon Apr 01 23:15:18 2019 +0200
@@ -59,6 +59,7 @@
  * Fix speech bubbles overlapping in the wrong order
  * Fix wrong ice beam angle if it goes diagonally up out of map through world wrap
  * Fix double water splash when flying saucer drowns
+ * Black clan color is now properly supported
 
 Game HUD:
  + Colorize switching arrows, pointing arrow and target cross in clan color
--- a/QTfrontend/hwconsts.cpp.in	Mon Apr 01 22:07:42 2019 +0200
+++ b/QTfrontend/hwconsts.cpp.in	Mon Apr 01 23:15:18 2019 +0200
@@ -45,6 +45,7 @@
 int cMaxTeams = 8;
 int cMaxHHs = HEDGEHOGS_PER_TEAM * cMaxTeams;
 int cMinServerVersion = 3;
+unsigned char cInvertTextColorAt = 64;
 
 QString * cDefaultAmmoStore = new QString( AMMOLINE_DEFAULT_QT AMMOLINE_DEFAULT_PROB
                                            AMMOLINE_DEFAULT_DELAY AMMOLINE_DEFAULT_CRATE );
--- a/QTfrontend/hwconsts.h	Mon Apr 01 22:07:42 2019 +0200
+++ b/QTfrontend/hwconsts.h	Mon Apr 01 23:15:18 2019 +0200
@@ -39,6 +39,7 @@
 extern int cMaxTeams;
 extern int cMaxHHs;
 extern int cMinServerVersion;
+extern unsigned char cInvertTextColorAt;
 
 class QStandardItemModel;
 
--- a/QTfrontend/ui/page/pagegamestats.cpp	Mon Apr 01 22:07:42 2019 +0200
+++ b/QTfrontend/ui/page/pagegamestats.cpp	Mon Apr 01 23:15:18 2019 +0200
@@ -222,11 +222,25 @@
                 minValue = qMin(minValue, hps[t]);
             }
 
-            QPen pen(c);
+            // Draw clan health/score graph lines
+            QColor col = QColor(c);
+
+            // Special pen for very dark clan colors
+            if (!(col.red() >= cInvertTextColorAt || col.green() >= cInvertTextColorAt || col.blue() >= cInvertTextColorAt))
+            {
+                QPen pen_marker(QColor(255, 255, 255));
+                pen_marker.setWidth(3);
+                pen_marker.setStyle(Qt::DotLine);
+                pen_marker.setCosmetic(true);
+                m_scene->addPath(path, pen_marker);
+            }
+
+            // Regular pen
+            QPen pen(col);
             pen.setWidth(2);
             pen.setCosmetic(true);
+            m_scene->addPath(path, pen);
 
-            m_scene->addPath(path, pen);
             ++i;
         }