1
0
Fork 0

GUI: don't warn on empty dialogs

This commit is contained in:
James Turner 2021-08-01 17:09:20 +01:00
parent 622ae7d329
commit a79e6e46da

View file

@ -201,6 +201,11 @@ NewGUI::update (double delta_time_sec)
bool bool
NewGUI::showDialog (const string &name) NewGUI::showDialog (const string &name)
{ {
if (name.empty()) {
SG_LOG(SG_GENERAL, SG_ALERT, "showDialog: no dialog name provided");
return false;
}
// first, check if it's already shown // first, check if it's already shown
if (_active_dialogs.find(name) != _active_dialogs.end()){ if (_active_dialogs.find(name) != _active_dialogs.end()){
_active_dialogs[name]->bringToFront(); _active_dialogs[name]->bringToFront();