From 09f56dc233324a7611554912c5483e20e0684104 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 26 Sep 2002 12:29:10 +0000 Subject: some fixes for the message dialog; added some comments svn-id: r5021 --- gui/gui.cpp | 8 ++++---- gui/message.cpp | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'gui') diff --git a/gui/gui.cpp b/gui/gui.cpp index c26a522693..94e36b2e3d 100644 --- a/gui/gui.cpp +++ b/gui/gui.cpp @@ -596,10 +596,10 @@ void Gui::handleSoundDialogCommand(int cmd) _s->_mixer->setVolume(_s->_sound->_sound_volume_sfx); _s->_mixer->setMusicVolume(_s->_sound->_sound_volume_music); - scummcfg->setInt("master_volume", _s->_sound->_sound_volume_master); - scummcfg->setInt("music_volume", _s->_sound->_sound_volume_music); - scummcfg->setInt("sfx_volume", _s->_sound->_sound_volume_sfx); - scummcfg->flush(); + g_config->setInt("master_volume", _s->_sound->_sound_volume_master); + g_config->setInt("music_volume", _s->_sound->_sound_volume_music); + g_config->setInt("sfx_volume", _s->_sound->_sound_volume_sfx); + g_config->flush(); close(); } else { diff --git a/gui/message.cpp b/gui/message.cpp index 351b120797..a2b890785c 100644 --- a/gui/message.cpp +++ b/gui/message.cpp @@ -43,24 +43,24 @@ MessageDialog::MessageDialog(NewGui *gui, const String &message) tmp = String(start, str - start); lines.push_back(tmp); lineWidth = _gui->getStringWidth(tmp); - if (maxlineWidth < lineWidth) + if (maxlineWidth < lineWidth) maxlineWidth = lineWidth; start = str + 1; } ++str; } - if (*start) { - tmp = String(start, str - start); - lines.push_back(tmp); - lineWidth = _gui->getStringWidth(tmp); - if (maxlineWidth < lineWidth) - maxlineWidth = lineWidth; - } + + // Add in the last line + tmp = String(start, str - start); + lines.push_back(tmp); + lineWidth = _gui->getStringWidth(tmp); + if (maxlineWidth < lineWidth) + maxlineWidth = lineWidth; // TODO - we should probably check for over/underflows here _w = maxlineWidth + 20; - _h = lines.size() * kLineHeight + 30; + _h = lines.size() * kLineHeight + 34; _x = (320 - _w) / 2; for (int i = 0; i < lines.size(); i++) { @@ -69,5 +69,5 @@ MessageDialog::MessageDialog(NewGui *gui, const String &message) } // FIXME - the vertical position has to be adjusted - addButton((_w - 54)/2, _h - 20, 54, 16, "OK", kCloseCmd, '\n'); // Confirm dialog + addButton((_w - 54)/2, _h - 24, 54, 16, "OK", kCloseCmd, '\n'); // Confirm dialog } -- cgit v1.2.3