Exemplo n.º 1
0
void Dragonfly::RedrawPanel_SensorInfo (SURFHANDLE surf)
{
	bool engaged = false;
	OBJHANDLE hObj = GetDockStatus (GetDockHandle (0));
	HDC hDC = oapiGetDC (surf);
//	SelectObject (hDC, g_Param.font[1]);
	SetTextColor (hDC, RGB(0,255,0));
	SetBkMode (hDC, TRANSPARENT);
	if (!sensormode) {
		TextOut (hDC, 0, 0, "LOCAL", 5);
		engaged = (hObj != NULL);
	} else {
		TextOut (hDC, 0, 0, "REMOTE", 6);
		if (remoteport >= 0) {
			char cbuf[20];
			sprintf (cbuf, "DOCK %d", remoteport+1);
			TextOut (hDC, 0, 10, cbuf, strlen(cbuf));
			engaged = (GetDockStatus (oapiGetDockHandle (hObj, remoteport)) != NULL);
		} else 
			TextOut (hDC, 0, 10, "NO DATA", 7);
	}
	if (engaged) {
		SetTextColor (hDC, 0);
		SetBkColor (hDC, RGB(255,255,0));
		SetBkMode (hDC, OPAQUE);
		TextOut (hDC, 50, 0, "ENG", 3);
	}
	oapiReleaseDC (surf, hDC);
};
Exemplo n.º 2
0
// Finish setup
void Atlantis_SRB::clbkPostCreation ()
{
	// find out which side of the ET we are attached to
	OBJHANDLE hTank = GetDockStatus (GetDockHandle (0));
	if (hTank) {
		for (UINT i = 1; i <= 2; i++) {
			OBJHANDLE hSRB = oapiGetDockStatus (oapiGetDockHandle (hTank, i));
			if (hSRB == GetHandle()) {
				srbpos = (i == 1 ? SRB_LEFT : SRB_RIGHT);
				break;
			}
		}
	}
	if (srbpos != SRB_UNDEFINED)
		SetThrusterDir(th_bolt, srbpos == SRB_LEFT ? _V(-0.4,-0.9165,0) : _V(-0.4,0.9165,0));
}
Exemplo n.º 3
0
int MMU::clbkConsumeBufferedKey (DWORD key, bool down, char *kstate)
{
	if (!down) return 0; // only process keydown events

	if (KEYMOD_SHIFT (kstate)) {
	} else if (KEYMOD_CONTROL (kstate)) {
	} else { // unmodified keys
		switch (key) {
		case OAPI_KEY_E: {  // end EVA
			DOCKHANDLE hDock = GetDockHandle (0);
			OBJHANDLE mate = GetDockStatus (hDock);
			if (mate) {
				oapiSetFocusObject(mate);
				oapiDeleteVessel (GetHandle(), mate);
			}
			} return 1;
		}
	}
	return 0;
}