From 0c53763c1eb42b9567459451ce47ef7239e151c6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 13 May 2013 01:00:40 +0300 Subject: dont show popup on empty cells in char selection dialog. --- src/gui/widgets/characterdisplay.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp index 1815ec395..de0306f7c 100644 --- a/src/gui/widgets/characterdisplay.cpp +++ b/src/gui/widgets/characterdisplay.cpp @@ -114,7 +114,11 @@ void CharacterDisplay::mouseMoved(gcn::MouseEvent &event) int mouseX = 0; int mouseY = 0; SDL_GetMouseState(&mouseX, &mouseY); - mPopup->show(mouseX, mouseY, mName->getCaption()); + const std::string &name = mName->getCaption(); + if (!name.empty()) + mPopup->show(mouseX, mouseY, name); + else + mPopup->setVisible(false); } void CharacterDisplay::mousePressed(gcn::MouseEvent &event) -- cgit v1.2.3-70-g09d2