Exemple #1
0
bool CCage::MovieEndMsg(CMovieEndMsg *msg) {
	enableMouse();
	_open = clipExistsByEnd("Shut", msg->_endFrame);

	CStatusChangeMsg statusMsg;
	statusMsg._newStatus = _open ? 1 : (CParrot::_v4 == 0 ? 1 : 0);
	statusMsg.execute("PerchCoreHolder");

	return true;
}
Exemple #2
0
bool CTitania::ActMsg(CActMsg *msg) {
	if (msg->_action == "SleepTitania") {
		setVisible(true);
		playCutscene(52, 104);
		playSound("z#47.wav", 100);
		changeView("Titania.Node 7.S", "");

		petShow();
		enableMouse();
		CSetFrameMsg frameMsg;
		frameMsg.execute("Bomb");

	} else if (msg->_action == "CheckHead") {
		CSenseWorkingMsg workingMsg1("Not Working");
		CSenseWorkingMsg workingMsg2("Not Working");
		CSenseWorkingMsg workingMsg3("Not Working");
		CSenseWorkingMsg workingMsg4("Not Working");

		if (_eye1 && _eye2) {
			workingMsg1._value = _visionCentre ? "Working" : "Random";
		}
		if (_ear1 && _ear2) {
			workingMsg2._value = _auditoryCentre ? "Working" : "Random";
		}
		if (_nose) {
			workingMsg4._value = _olfactoryCentre ? "Working" : "Random";
		}
		if (_mouth) {
			workingMsg3._value = _speechCentre ? "Working" : "Random";
		}

		if (_centralCore && _eye1 && _eye2 && _ear1 && _ear2 && _nose && _mouth
				&& _speechCentre && _olfactoryCentre && _auditoryCentre) {
			playSound("z#47.wav");

			CActMsg actMsg("Woken");
			actMsg.execute("MouthSlot");
			actMsg.execute("VisionCentreSlot");
			setPassengerClass(UNCHECKED);

			addTimer(1000);
		} else {
			workingMsg1.execute("Eye1Slot");
			workingMsg1.execute("Eye2Slot");
			workingMsg2.execute("Ear1Slot");
			workingMsg2.execute("Ear2Slot");
			workingMsg3.execute("MouthSlot");
			workingMsg4.execute("NoseSlot");
		}
	}

	return true;
}
Exemple #3
0
void RMGfxEngine::openOptionScreen(CORO_PARAM, int type) {
	CORO_BEGIN_CONTEXT;
	bool bRes;
	CORO_END_CONTEXT(_ctx);

	CORO_BEGIN_CODE(_ctx);

	_ctx->bRes = false;

	if (type == 0)
		CORO_INVOKE_2(_opt.init, _bigBuf, _ctx->bRes);
	else if (type == 1)
		CORO_INVOKE_3(_opt.initLoadMenuOnly, _bigBuf, true, _ctx->bRes);
	else if (type == 2)
		CORO_INVOKE_2(_opt.initNoLoadSave, _bigBuf, _ctx->bRes);
	else if (type == 3)
		CORO_INVOKE_3(_opt.initLoadMenuOnly, _bigBuf, false, _ctx->bRes);
	else if (type == 4)
		CORO_INVOKE_3(_opt.initSaveMenuOnly, _bigBuf, false, _ctx->bRes);

	if (_ctx->bRes) {
		g_vm->pauseSound(true);

		disableInput();
		_inv.endCombine();
		_curActionObj = 0;
		_curAction = TA_GOTO;
		_point.setAction(_curAction);
		_point.setSpecialPointer(RMPointer::PTR_NONE);
		_point.setCustomPointer(NULL);
		enableMouse();
		g_vm->grabThumbnail();

		// Exists the IDLE to avoid premature death in loading
		_bMustEnterMenu = true;
		if (type == 1 || type == 2) {
			GLOBALS._bIdleExited = true;
		} else {
			CORO_INVOKE_0(_tony.stopNoAction);

			GLOBALS._bIdleExited = false;

			CoroScheduler.createProcess(exitAllIdles, &_nCurLoc, sizeof(int));
		}
	}

	CORO_END_CODE;
}
NS_MONKEY_BEGIN

DisplayObject::DisplayObject() :
Pivot3D(),
_geometry(nullptr),
_blendMode(BlendMode::NORMAL),
_alpha(1.0f),
_width(0.0f),
_height(0.0f),
_boundsDirty(true),
_touchIn(false)
{
    _anchorPoint.setTo(0, 0);
    _drable       = true;
    _updatable    = true;
    enableMouse(false);
}
Exemple #5
0
bool CDoorbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
	CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(msg);

	if (_npcFlags & NPCFLAG_DOORBOT_INTRO) {
		// Initial speech by Doorbot in 
		switch (msg->_dialogueId) {
		case 10552:
			playClip("SE Try Buttons", MOVIE_NOTIFY_OBJECT);
			_introMovieNum = 9;
			break;

		case 10553:
			enableMouse();
			break;

		case 10557:
			playClip("SE Move To Right", MOVIE_NOTIFY_OBJECT);
			_introMovieNum = 11;
			break;

		case 10559:
			stopAnimTimer(_timerId);
			_timerId = addTimer(0, 2500, 0);
			break;

		case 10560:
			petShow();
			petSetArea(PET_CONVERSATION);
			stopAnimTimer(_timerId);
			_timerId = addTimer(1, 1000, 0);
			break;

		case 10561:
			enableMouse();
			_introMovieNum = 1;
			stopAnimTimer(_timerId);
			_timerId = addTimer(2, 10000, 0);
			break;

		case 10562:
			if (_introMovieNum == 1) {
				stopAnimTimer(_timerId);
				_timerId = addTimer(2, getRandomNumber(5000), 0);
			}
			break;

		case 10563:
		case 10564:
			disableMouse();
			startTalking(this, 221480);
			break;

		case 10565:
			startTalking(this, 221481);
			break;

		case 10566:
			stopAnimTimer(_timerId);
			_timerId = 0;
			if (_field110 == 2) {
				playClip("Cloak On", MOVIE_NOTIFY_OBJECT);
				_introMovieNum = 6;
			} else {
				_timerId = addTimer(3, 2000, 0);
			}
			break;

		case 10567: {
			CActMsg actMsg("BecomeGettable");
			actMsg.execute("Photograph");
			enableMouse();
			stopAnimTimer(_timerId);
			_timerId = addTimer(4, 5000, 0);
			break;
		}

		case 10568:
			// Start moving cursor to photograph
			mouseDisableControl();
			mouseSetPosition(Point(600, 250), 2500);
			_timerId = addTimer(6, 2500, 0);
			break;

		case 10569:
			if (_field110 != 2) {
				stopAnimTimer(_timerId);
				_timerId = addTimer(5, 3000, 0);
			}
			break;

		case 10570:
			mouseSetPosition(Point(200, 430), 2500);
			_timerId = addTimer(7, 3000, 0);
			break;

		case 10571:
			playClip("Cloak On", MOVIE_NOTIFY_OBJECT);
			_introMovieNum = 6;
			break;

		default:
			break;
		}
	}

	return true;
}
Exemple #6
0
//--------------------------------------------------------------
void ofxGLWarper::toggleMouse(){
    enableMouse(!bUseMouse);
}
Exemple #7
0
//===================================
// GetMouseData...
//-----------------------------------
MouseData* MouseGetData(void) {
	hd_data_t *hd_data = NULL;
	driver_info_t *di  = NULL;
	MouseData* data    = NULL;
	MouseData* first   = NULL;
	MouseData* last    = NULL;
	hd_t *hd           = NULL;
	hd_t *first_dev    = NULL;
	Display* dpy       = NULL;
	int haveDisplay    = 0;
	char buf[256]      = "";

	//===================================
	// Open X11 display
	//-----------------------------------
	if ((dpy = XOpenDisplay (getenv("DISPLAY")))) {
		haveDisplay = 1;
	}
	//===================================
	// Disable mouse
	//-----------------------------------
	if (haveDisplay) {
		disableMouse (dpy);
	}
	hd_data = (hd_data_t*)calloc(1, sizeof *hd_data);
	//hd_data->flags.fast = 1;
	hd = hd_list(hd_data, hw_mouse, 1, NULL);
	first_dev = hd;

	for(; hd; hd = hd->next) {
		if (! hd->unix_dev_name) {
			continue;
		}
		//===================================
		// create new element and defaults...
		// -----------------------------------
		data = (MouseData*)malloc(sizeof(MouseData));
		sprintf (buf,"0x%04x",ID_VALUE(hd->device.id));
		strcpy(data->did,buf);
		sprintf (buf,"0x%04x",ID_VALUE(hd->vendor.id));
		strcpy(data->vid,buf);
		strcpy(data->name,hd->model);
		strcpy(data->device,"/dev/mouse");
		strcpy(data->realdev,"<undefined>");
		strcpy(data->protocol,"Auto");
		data->buttons = -1;
		data->wheel   = 1;
		data->emulate = 1;
		data->next    = NULL;

		if (last != NULL) {
			last->next = data;
		}
		if (hd == first_dev) {
			first = data;
		}
		//===================================
		// save hddata to struct...
		// ----------------------------------
		di = hd->driver_info;
		if(di && di->any.type == di_mouse && di->mouse.xf86) {
			strcpy(data->protocol,di->mouse.xf86);
			if (di->mouse.buttons) {
				data->buttons = di->mouse.buttons;
			}
			if (di->mouse.wheels) {
				data->wheel   = di->mouse.wheels;
			}
			if (data->buttons) {
			if (
				(data->buttons >= 3) || 
				(strcmp(data->protocol,"imps/2") == 0) ||
				(strcmp(data->protocol,"explorerps/2") == 0)
			) {
				data->emulate = 0;
			}
			}
			if (data->wheel) {
			if (data->wheel >= 1) {
				data->buttons = (data->wheel * 2) + data->buttons;
			}
			}
		}
		if (hd->unix_dev_name) {
			strcpy(data->device,hd->unix_dev_name);
		}
		if (hd->unix_dev_names && hd->unix_dev_names->next) {
			str_list_t* str = hd->unix_dev_names;
			for (; str; str = str->next) {
			if (strstr (str->str,"by-id")) {
				strcpy(data->realdev,str->str);
			}
			}
		}
		last = data;
	}
	//===================================
	// Enable mouse
	//-----------------------------------
	if (haveDisplay) {
		enableMouse (dpy);
	}
	if (haveDisplay) {
		XCloseDisplay (dpy);
	}
	return(first);
}