示例#1
0
bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
	if (_scrollUp.MouseButtonUpMsg(msg->_mousePos) ||
			_scrollDown.MouseButtonUpMsg(msg->_mousePos))
		return true;

	if (_doorBot.MouseButtonUpMsg(msg->_mousePos)) {
		switch (canSummonBot("DoorBot")) {
		case SUMMON_CANT:
			_log.addLine(g_vm->_strings[CANT_SUMMON_DOORBOT], getColor(1));
			break;
		case SUMMON_CAN:
			summonBot("DoorBot");
			return true;
		default:
			break;
		}

		// Scroll to the bottom of the log
		scrollToBottom();
		return true;
	}

	if (_bellBot.MouseButtonUpMsg(msg->_mousePos)) {
		switch (canSummonBot("BellBot")) {
		case SUMMON_CANT:
			_log.addLine(g_vm->_strings[CANT_SUMMON_BELLBOT], getColor(1));
			break;
		case SUMMON_CAN:
			summonBot("BellBot");
			return true;
		default:
			break;
		}

		// Scroll to the bottom of the log
		scrollToBottom();
		return true;
	}

	return false;
}
示例#2
0
bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
	if (_scrollUp.MouseButtonUpMsg(msg->_mousePos) ||
			_scrollDown.MouseButtonUpMsg(msg->_mousePos))
		return true;

	if (_doorBot.MouseButtonUpMsg(msg->_mousePos)) {
		switch (canSummonBot("DoorBot")) {
		case SUMMON_CANT:
			_log.addLine("Sadly, it is not possible to summon the DoorBot from this location.", getColor(1));
			break;
		case SUMMON_CAN:
			summonBot("DoorBot");
			return true;
		default:
			break;
		}

		// Scroll to the bottom of the log
		scrollToBottom();
		return true;
	}

	if (_bellBot.MouseButtonUpMsg(msg->_mousePos)) {
		switch (canSummonBot("BellBot")) {
		case SUMMON_CANT:
			_log.addLine("Sadly, it is not possible to summon the BellBot from this location.", getColor(1));
			break;
		case SUMMON_CAN:
			summonBot("BellBot");
			return true;
		default:
			break;
		}

		// Scroll to the bottom of the log
		scrollToBottom();
		return true;
	}

	return false;
}