mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-22 09:49:11 +00:00
MYST3: Menu WIP
- Escape now closes the menu - Fix loading non first save item - Clicking twice on an item loads it
This commit is contained in:
parent
4fc45e4dc6
commit
e031c97b2e
@ -129,6 +129,7 @@ void Menu::goToNode(uint16 node) {
|
||||
_vm->_state->setMenuSavedNode(_vm->_state->getLocationNode());
|
||||
}
|
||||
|
||||
_vm->_state->setMenuEscapePressed(0);
|
||||
_vm->_state->setLocationNextAge(9);
|
||||
_vm->_state->setLocationNextRoom(901);
|
||||
_vm->goToNode(node, 2);
|
||||
@ -267,6 +268,12 @@ void Menu::saveLoadUpdateVars() {
|
||||
}
|
||||
|
||||
void Menu::loadMenuSelect(uint16 item) {
|
||||
// Selecting twice the same item loads it
|
||||
if (item == _vm->_state->getMenuSaveLoadSelectedItem()) {
|
||||
loadMenuLoad();
|
||||
return;
|
||||
}
|
||||
|
||||
_vm->_state->setMenuSaveLoadSelectedItem(item);
|
||||
int16 page = _vm->_state->getMenuSaveLoadCurrentPage();
|
||||
|
||||
@ -297,11 +304,10 @@ void Menu::loadMenuSelect(uint16 item) {
|
||||
const DirectorySubEntry *desc = _vm->getFileDescription("AGES", 1000, 0, DirectorySubEntry::kTextMetadata);
|
||||
_saveLoadAgeName = desc->getTextData(_vm->_db->getAgeLabelId(age));
|
||||
_saveLoadAgeName.toUppercase();
|
||||
|
||||
// TODO: Selecting twice loads item
|
||||
}
|
||||
|
||||
void Menu::loadMenuLoad(uint16 item) {
|
||||
void Menu::loadMenuLoad() {
|
||||
uint16 item = _vm->_state->getMenuSaveLoadSelectedItem();
|
||||
int16 page = _vm->_state->getMenuSaveLoadCurrentPage();
|
||||
|
||||
uint16 index = page * 7 + item;
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
|
||||
void loadMenuOpen();
|
||||
void loadMenuSelect(uint16 item);
|
||||
void loadMenuLoad(uint16 item);
|
||||
void loadMenuLoad();
|
||||
void loadMenuChangePage();
|
||||
void setSaveLoadSpotItem(SpotItemFace *spotItem) { _saveLoadSpotItem = spotItem; }
|
||||
|
||||
|
@ -274,9 +274,10 @@ void Myst3Engine::processInput(bool lookOnly) {
|
||||
switch (event.kbd.keycode) {
|
||||
case Common::KEYCODE_ESCAPE:
|
||||
// Open main menu
|
||||
if (_state->getLocationRoom() != 901) {
|
||||
if (_state->getLocationRoom() != 901)
|
||||
_menu->goToNode(100);
|
||||
}
|
||||
else
|
||||
_state->setMenuEscapePressed(1);
|
||||
break;
|
||||
case Common::KEYCODE_d:
|
||||
if (event.kbd.flags & Common::KBD_CTRL) {
|
||||
|
@ -178,7 +178,7 @@ void Puzzles::saveLoadMenu(uint16 action, uint16 item) {
|
||||
_vm->_menu->loadMenuSelect(item);
|
||||
break;
|
||||
case 2:
|
||||
_vm->_menu->loadMenuLoad(item);
|
||||
_vm->_menu->loadMenuLoad();
|
||||
break;
|
||||
case 6:
|
||||
_vm->_menu->loadMenuChangePage();
|
||||
|
@ -94,6 +94,7 @@ GameState::GameState(Myst3Engine *vm):
|
||||
VAR(480, BookStateTomahna, false)
|
||||
VAR(481, BookStateReleeshahn, false)
|
||||
|
||||
VAR(1337, MenuEscapePressed, false)
|
||||
VAR(1339, MenuLoadBack, false)
|
||||
VAR(1340, MenuSaveBack, false)
|
||||
VAR(1341, MenuSaveAction, false)
|
||||
|
@ -101,6 +101,7 @@ public:
|
||||
DECLARE_VAR(480, BookStateTomahna)
|
||||
DECLARE_VAR(481, BookStateReleeshahn)
|
||||
|
||||
DECLARE_VAR(1337, MenuEscapePressed)
|
||||
DECLARE_VAR(1339, MenuLoadBack)
|
||||
DECLARE_VAR(1340, MenuSaveBack)
|
||||
DECLARE_VAR(1341, MenuSaveAction)
|
||||
|
Loading…
Reference in New Issue
Block a user