correct ping display also if average ping is 0ms in network games
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
MyAvatarLabel::MyAvatarLabel(QGroupBox* parent)
|
MyAvatarLabel::MyAvatarLabel(QGroupBox* parent)
|
||||||
: QLabel(parent), voteRunning(false), transparent(false), myUniqueId(0), myPingState(0), myAvgPing(0), myMinPing(0), myMaxPing(0)
|
: QLabel(parent), voteRunning(false), transparent(false), myUniqueId(0), myPingState(0), myAvgPing(-1), myMinPing(-1), myMaxPing(-1)
|
||||||
{
|
{
|
||||||
|
|
||||||
myContextMenu = new QMenu;
|
myContextMenu = new QMenu;
|
||||||
@@ -415,7 +415,7 @@ void MyAvatarLabel::paintEvent(QPaintEvent*)
|
|||||||
//paint ping state color for network clients
|
//paint ping state color for network clients
|
||||||
if(mySession->isNetworkClientRunning() && myId == 0) {
|
if(mySession->isNetworkClientRunning() && myId == 0) {
|
||||||
QColor pingColor;
|
QColor pingColor;
|
||||||
if(myAvgPing > 0 && myAvgPing <= 1000) {
|
if(myAvgPing >= 0 && myAvgPing <= 1000) {
|
||||||
pingColor.setNamedColor("green");
|
pingColor.setNamedColor("green");
|
||||||
} else if(myAvgPing > 1000 && myAvgPing <= 2000 ) {
|
} else if(myAvgPing > 1000 && myAvgPing <= 2000 ) {
|
||||||
pingColor.setNamedColor("yellow");
|
pingColor.setNamedColor("yellow");
|
||||||
|
|||||||
@@ -108,9 +108,9 @@ private:
|
|||||||
int myId;
|
int myId;
|
||||||
int myUniqueId;
|
int myUniqueId;
|
||||||
unsigned myPingState;
|
unsigned myPingState;
|
||||||
unsigned myAvgPing;
|
int myAvgPing;
|
||||||
unsigned myMinPing;
|
int myMinPing;
|
||||||
unsigned myMaxPing;
|
int myMaxPing;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user