void UserInterface::drawTextElements() {
	if (_vm->_game->_screenObjects._inputMode) {
		drawConversationList();
	} else {
		// Draw the actions
		drawActions();
		drawInventoryList();
		drawItemVocabList();
	}
}
Exemple #2
0
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;
	}
}
void UserInterface::updateSelection(ScrCategory category, int newIndex, int *idx) {
	Game &game = *_vm->_game;
	Common::Array<int> &invList = game._objects._inventoryList;
	Common::Rect bounds;

	if (category == CAT_INV_LIST && _inventoryChanged) {
		*idx = newIndex;
		bounds = Common::Rect(90, 3, 90 + 69, 3 + 40);
		_uiSlots.add(bounds);
		_uiSlots.draw(false, false);
		drawInventoryList();
		updateRect(bounds);
		_inventoryChanged = false;

		if (invList.size() < 2) {
			_scrollbarElevator = 0;
		} else {
			int v = _inventoryTopIndex * 18 / (invList.size() - 1);
			_scrollbarElevator = MIN(v, 17);
		}
	} else {
		int oldIndex = *idx;
		*idx = newIndex;

		if (oldIndex >= 0) {
			writeVocab(category, oldIndex);

			if (getBounds(category, oldIndex, bounds))
				updateRect(bounds);
		}

		if (newIndex >= 0) {
			writeVocab(category, newIndex);

			if (getBounds(category, newIndex, bounds))
				updateRect(bounds);
		}
	}
}