void UserInterface::selectObject(int invIndex) { if (_selectedInvIndex != invIndex || _inventoryChanged) { int oldVocabCount = _selectedInvIndex < 0 ? 0 : _vm->_game->_objects.getItem(_selectedInvIndex)._vocabCount; int newVocabCount = invIndex < 0 ? 0 : _vm->_game->_objects.getItem(invIndex)._vocabCount; int maxVocab = MAX(oldVocabCount, newVocabCount); updateSelection(CAT_INV_LIST, invIndex, &_selectedInvIndex); _highlightedItemVocabIndex = -1; _selectedItemVocabIdx = -1; if (maxVocab) { assert(_uiSlots.size() < 50); int vocabHeight = maxVocab * 8; Common::Rect bounds(240, 3, 240 + 80, 3 + vocabHeight); _uiSlots.add(bounds); _uiSlots.draw(false, false); drawItemVocabList(); updateRect(bounds); } } if (invIndex == -1) { noInventoryAnim(); } else { loadInventoryAnim(_vm->_game->_objects._inventoryList[invIndex]); _vm->_palette->setPalette(&_vm->_palette->_mainPalette[7 * 3], 7, 1); _vm->_palette->setPalette(&_vm->_palette->_mainPalette[246 * 3], 246, 2); } }
void UserInterface::drawTextElements() { if (_vm->_game->_screenObjects._inputMode) { drawConversationList(); } else { // Draw the actions drawActions(); drawInventoryList(); drawItemVocabList(); } }
void UserInterface::drawTextElements() { switch (_vm->_game->_screenObjects._inputMode) { case kInputBuildingSentences: // Draw the actions drawActions(); drawInventoryList(); drawItemVocabList(); break; case kInputConversation: drawConversationList(); break; case kInputLimitedSentences: default: break; } }