diff options
author | Max Horn | 2002-10-21 09:38:42 +0000 |
---|---|---|
committer | Max Horn | 2002-10-21 09:38:42 +0000 |
commit | 46a3039f701dd40e2347d4c5090e0a3c74489a37 (patch) | |
tree | d25c913e98b47623ad97cd60b8e94b18ca5c450a /scumm/dialogs.cpp | |
parent | 7677e42ffe26ea21d57422c3ae0810047407304e (diff) | |
download | scummvm-rg350-46a3039f701dd40e2347d4c5090e0a3c74489a37.tar.gz scummvm-rg350-46a3039f701dd40e2347d4c5090e0a3c74489a37.tar.bz2 scummvm-rg350-46a3039f701dd40e2347d4c5090e0a3c74489a37.zip |
patch #626226 with some mods of my own
svn-id: r5209
Diffstat (limited to 'scumm/dialogs.cpp')
-rw-r--r-- | scumm/dialogs.cpp | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index 3d846c60fc..4752cbfd96 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -318,10 +318,7 @@ SaveLoadDialog::SaveLoadDialog(NewGui *gui, Scumm *scumm) void SaveLoadDialog::open() { - _saveMode = false; - _saveButton->setState(false); - _loadButton->setState(true); - fillList(); + switchToLoadMode(); ScummDialog::open(); } @@ -331,28 +328,24 @@ void SaveLoadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat switch (cmd) { case kSaveCmd: if (!_saveMode) { - _saveMode = true; - _saveButton->setState(true); - _loadButton->setState(false); - fillList(); - draw(); + switchToSaveMode(); } break; case kLoadCmd: if (_saveMode) { - _saveMode = false; - _saveButton->setState(false); - _loadButton->setState(true); - fillList(); - draw(); + switchToLoadMode(); } break; case kListItemDoubleClickedCmd: - if (_savegameList->getSelected() >= 0 && !_savegameList->getSelectedString().isEmpty()) { + if (_savegameList->getSelected() >= 0) { if (_saveMode) { - // Start editing the selected item, for saving - _savegameList->startEditMode(); - } else { + if (_savegameList->getSelectedString().isEmpty()) { + // Start editing the selected item, for saving + _savegameList->startEditMode(); + } else { + save(); + } + } else if (!_savegameList->getSelectedString().isEmpty()) { load(); } } @@ -366,6 +359,11 @@ void SaveLoadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat } } break; + case kListSelectionChangedCmd: + if (_saveMode) { + _savegameList->startEditMode(); + } + break; case kPlayCmd: close(); break; @@ -415,6 +413,30 @@ void SaveLoadDialog::load() close(); } +void SaveLoadDialog::switchToSaveMode() +{ + _saveMode = true; + _saveButton->setState(true); + _loadButton->setState(false); + _saveButton->clearFlags(WIDGET_ENABLED); + _loadButton->setFlags(WIDGET_ENABLED); + _savegameList->setEditable(true); + fillList(); + draw(); +} + +void SaveLoadDialog::switchToLoadMode() +{ + _saveMode = false; + _saveButton->setState(false); + _loadButton->setState(true); + _saveButton->setFlags(WIDGET_ENABLED); + _loadButton->clearFlags(WIDGET_ENABLED); + _savegameList->setEditable(false); + fillList(); + draw(); +} + #pragma mark - |