diff options
author | Paul Gilbert | 2014-03-25 08:55:29 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-03-25 08:55:29 -0400 |
commit | 2879b895bc301b46a4d9098de56fabfc2434f0f8 (patch) | |
tree | e427594b68b44b006d15e26d2154284461109f94 /engines/mads/user_interface.cpp | |
parent | 3c504f4d028efdec39b6b250948eb41522de18e2 (diff) | |
download | scummvm-rg350-2879b895bc301b46a4d9098de56fabfc2434f0f8.tar.gz scummvm-rg350-2879b895bc301b46a4d9098de56fabfc2434f0f8.tar.bz2 scummvm-rg350-2879b895bc301b46a4d9098de56fabfc2434f0f8.zip |
MADS: Fixes for UI item selection, add added an enum for Font::setColorMode
Diffstat (limited to 'engines/mads/user_interface.cpp')
-rw-r--r-- | engines/mads/user_interface.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index 67fb50e4ac..b45ff14633 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -331,10 +331,10 @@ void UserInterface::writeVocab(ScrCategory category, int id) { case CAT_ACTION: font = _vm->_font->getFont(FONT_INTERFACE); vocabId = scene._verbList[id]._id; - if (_highlightedActionIndex) { - _vm->_font->setColorMode(1); + if (id == _highlightedActionIndex) { + _vm->_font->setColorMode(SELMODE_HIGHLIGHTED); } else { - _vm->_font->setColorMode(id == _selectedActionIndex ? 2 : 0); + _vm->_font->setColorMode(id == _selectedActionIndex ? SELMODE_SELECTED : SELMODE_UNSELECTED); } vocabStr = scene.getVocab(vocabId); vocabStr.setChar(toupper(vocabStr[0]), 0); @@ -344,10 +344,10 @@ void UserInterface::writeVocab(ScrCategory category, int id) { case CAT_INV_LIST: font = _vm->_font->getFont(FONT_INTERFACE); vocabId = _vm->_game->_objects.getItem(id)._descId; - if (_v1C == id) { - _vm->_font->setColorMode(1); + if (id == _v1C) { + _vm->_font->setColorMode(SELMODE_HIGHLIGHTED); } else { - _vm->_font->setColorMode(id == _selectedInvIndex ? 2 : 0); + _vm->_font->setColorMode(id == _selectedInvIndex ? SELMODE_SELECTED : SELMODE_UNSELECTED); vocabStr = scene.getVocab(vocabId); vocabStr.setChar(toupper(vocabStr[0]), 0); font->writeString(this, vocabStr, Common::Point(bounds.left, bounds.top)); @@ -378,16 +378,17 @@ void UserInterface::writeVocab(ScrCategory category, int id) { break; } - font->setColorMode((id == 4) || (_scrollerY == 3) ? 1 : 0); + font->setColorMode((id == 4) || (_scrollerY == 3) ? SELMODE_HIGHLIGHTED : SELMODE_UNSELECTED); font->writeString(this, vocabStr, Common::Point(bounds.left, bounds.top)); break; default: + // Item specific verbs font = _vm->_font->getFont(FONT_INTERFACE); vocabId = _vm->_game->_objects.getItem(_selectedInvIndex)._vocabList[id]._vocabId; - if (_v1E == id) { - _vm->_font->setColorMode(1); + if (id == _v1E) { + _vm->_font->setColorMode(SELMODE_HIGHLIGHTED); } else { - _vm->_font->setColorMode(id == _selectedInvIndex ? 2 : 0); + _vm->_font->setColorMode(id == _selectedInvIndex ? SELMODE_SELECTED : SELMODE_UNSELECTED); vocabStr = scene.getVocab(vocabId); vocabStr.setChar(toupper(vocabStr[0]), 0); font->writeString(this, vocabStr, Common::Point(bounds.left, bounds.top)); |