bool TALON::clbkLoadGenericCockpit() {
return true;
}
bool TALON::clbkLoadVC(int id) { // ID is the Preset Camera Position
huds.size = 0.3;
huds.nmesh = 2;
mfdController->HandleLoadVC(id);
oapiVCRegisterHUD(&huds);
SURFHANDLE const tex1 = oapiGetTextureHandle(meshhg_VC, 9);
switch (id) {
case 0: // commander position
SetCameraOffset(_V(-0.41, 1.6, 2.241));
SetCameraDefaultDirection(_V(0, 0, 1));
SetCameraMovement(_V(0, 0, 0.2), 0, 0, _V(-0.3, 0, 0), 75 * RAD, -5 * RAD, _V(0.3, 0, 0), -20 * RAD, -27 * RAD);
oapiVCSetNeighbours(-1, 1, -1, 2);
break;
case 1: // pilot position
SetCameraOffset(_V(0.41, 1.6, 2.241));
SetCameraDefaultDirection(_V(0, 0, 1));
SetCameraMovement(_V(0, 0, 0.3), 0, 0, _V(-0.3, 0, 0), 20 * RAD, -27 * RAD, _V(0.3, 0, 0), -75 * RAD, -5 * RAD);
oapiVCSetNeighbours(0, -1, -1, 2);
break;
case 2: // pilot position
SetCameraOffset(_V(0, 1.7, 2.21));
SetCameraDefaultDirection(_V(0, 0, 1));
SetCameraMovement(_V(0, 0, 0.3), 0, 0, _V(-0.3, 0, 0), 20 * RAD, -27 * RAD, _V(0.3, 0, 0), -75 * RAD, -5 * RAD);
oapiVCSetNeighbours(0, -1, -1, 2);
break;
//tex1 = oapiGetTextureHandle(vcmesh_tpl, 12); //navmode tex
oapiVCRegisterArea(AID_NAVMODE, _R(0, 0, 128, 128), PANEL_REDRAW_MOUSE | PANEL_REDRAW_USER, PANEL_MOUSE_LBDOWN, PANEL_MAP_BACKGROUND, tex1);
oapiVCSetAreaClickmode_Quadrilateral(AID_NAVMODE,
_V(-.1462004f, 1.51039f, 2.844f),//2.822
_V(.1471258f, 1.509298f, 2.844f),
_V(-.1440155f, 1.492364f, 2.844f),
_V(.1465795f, 1.490726f, 2.844f));
}
return HandleLoadVC(id);
}
bool TALON::HandleLoadVC(UINT const id)
{
return true;
}
bool TALON::clbkVCMouseEvent(int id, int event, VECTOR3 &p)
{
bool result = false;
result = result || mfdController->HandleMouseEvent(id, event, p);
result = result || VCMouseEvent(id, event, p);
return result;
}
bool TALON::VCMouseEvent(int const id, int const event, VECTOR3& const p)
{
static int ctrl = 3;
switch (id) {
case AID_NAVMODE:
ctrl = (int)(p.x*262.0f);
if ((ctrl % 44) < 42) {
ToggleNavmode(6 - ctrl / 44);
// oapiTriggerPanelRedrawArea (0, AID_NAVMODE);
return true;
}
break;
}
return false; // We must return false, as we didn't processed the event!
}
bool TALON::clbkVCRedrawEvent(int id, int event, SURFHANDLE surf) {
bool result = false;
result = result || mfdController->HandleRedrawEvent(id, event, surf);
result = result || VCRedrawEvent(id, event, surf);
//case AID_NAVMODE:
// result = result || RedrawPanel_Navmode(surf);
// return true;
// {
// switch (id) {
// case AID_NAVMODE:
// RedrawPanel_Navmode(surf);
//sprintf(oapiDebugString(), "Fuel %f", fuel_percent);
// return true;
// }
// return false;
//}
return result;
}
bool TALON::VCRedrawEvent(int const id, int const event, SURFHANDLE const surf) {
return false;
}