mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-06 01:31:39 +00:00
NewGUI fixes: save game numbering starts at 0; allow to load autosave
svn-id: r4693
This commit is contained in:
parent
40133b475a
commit
72efbd36b6
4
gui.cpp
4
gui.cpp
@ -882,8 +882,8 @@ void Gui::getSavegameNames(int start)
|
|||||||
int i;
|
int i;
|
||||||
_slotIndex = start;
|
_slotIndex = start;
|
||||||
|
|
||||||
for (i = 0; i < 9; i++, start++) {
|
for (i = 0; i < 9; i++) {
|
||||||
valid_games[i] = _s->getSavegameName(start, game_names[i]);
|
valid_games[i] = _s->getSavegameName(start + i, game_names[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,10 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO list
|
* TODO list
|
||||||
* - if save or load fails, popup an error dialog?
|
* - if save or load fails (e.g. due to disk full/directory write protected),
|
||||||
|
* display an error dialog?
|
||||||
|
* - The user can edit the name of the autosave game. Of course this will not
|
||||||
|
* do anything, but we should still prevent this.
|
||||||
* ...
|
* ...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -293,7 +296,8 @@ SaveLoadDialog::SaveLoadDialog(NewGui *gui)
|
|||||||
addButton(200, 100, 54, 16, RES_STRING(8), kQuitCmd, 'Q'); // Quit
|
addButton(200, 100, 54, 16, RES_STRING(8), kQuitCmd, 'Q'); // Quit
|
||||||
|
|
||||||
_savegameList = new ListWidget(this, 10, 20, 180, 94);
|
_savegameList = new ListWidget(this, 10, 20, 180, 94);
|
||||||
|
_savegameList->setNumberingMode(kListNumberingZero);
|
||||||
|
|
||||||
// Get savegame names
|
// Get savegame names
|
||||||
ScummVM::StringList l;
|
ScummVM::StringList l;
|
||||||
char name[32];
|
char name[32];
|
||||||
@ -312,7 +316,7 @@ void SaveLoadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
|
|||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case kListItemChangedCmd:
|
case kListItemChangedCmd:
|
||||||
case kSaveCmd:
|
case kSaveCmd:
|
||||||
if (_savegameList->getSelected() > 0 && !_savegameList->getSelectedString().isEmpty()) {
|
if (_savegameList->getSelected() >= 1 && !_savegameList->getSelectedString().isEmpty()) {
|
||||||
Scumm *s = _gui->getScumm();
|
Scumm *s = _gui->getScumm();
|
||||||
s->_saveLoadSlot = _savegameList->getSelected();
|
s->_saveLoadSlot = _savegameList->getSelected();
|
||||||
s->_saveLoadCompatible = false;
|
s->_saveLoadCompatible = false;
|
||||||
@ -323,7 +327,7 @@ void SaveLoadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
|
|||||||
break;
|
break;
|
||||||
case kListItemDoubleClickedCmd:
|
case kListItemDoubleClickedCmd:
|
||||||
case kLoadCmd:
|
case kLoadCmd:
|
||||||
if (_savegameList->getSelected() > 0 && !_savegameList->getSelectedString().isEmpty()) {
|
if (_savegameList->getSelected() >= 0 && !_savegameList->getSelectedString().isEmpty()) {
|
||||||
Scumm *s = _gui->getScumm();
|
Scumm *s = _gui->getScumm();
|
||||||
s->_saveLoadSlot = _savegameList->getSelected();
|
s->_saveLoadSlot = _savegameList->getSelected();
|
||||||
s->_saveLoadCompatible = false;
|
s->_saveLoadCompatible = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user