Example #1
0
bool CChevSwitch::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
	_fieldBC ^= 1;
	if (getParent()) {
		CSetChevPanelBitMsg bitMsg(_value, _fieldBC);
		bitMsg.execute(getParent());
	}

	CSetChevButtonImageMsg chevMsg(_fieldBC, 0);
	chevMsg.execute(this);

	return true;
}
Example #2
0
bool CPetDragChev::MouseDragEndMsg(CMouseDragEndMsg *msg) {
	CSuccUBus *succubus = dynamic_cast<CSuccUBus *>(msg->_dropTarget);

	if (succubus) {
		CSetChevRoomBits chevMsg(_destRoomFlags);
		chevMsg.execute(succubus);
	} else {
		CPetControl *petControl = getPetControl();
		if (!petControl || !petControl->contains(msg->_mousePos)
				|| msg->_mousePos.x >= 528 || !petControl->checkDragEnd(this))
			petMoveToHiddenRoom();
	}

	return true;
}