See site in english Voir le site en francais
Website skin:
home  download  forum  link  contact

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Author Topic: Ummu Hud  (Read 1676 times)

0 Members and 1 Guest are viewing this topic.

Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
08 March 2010, 14:27:03
I had coding Ummu 2.0 into a vessels.  It had 1.5 which use  a different way to display the info about eva,....  

On 2.0 is using a HUD.  But I want to be able to switch the Ummu HUD off/on when needed and be able to see my vessels hud when the UMMU hud is off.

Here is my code.  The value HUDON is 0 if I want the Hudoff and 1 if I want it on.


void MOONBASEALPHA::clbkDrawHUD (int mode, const HUDPAINTSPEC *hps, HDC hDC)
{
    // draw the default HUD
    VESSEL2::clbkDrawHUD (mode, hps, hDC);
if(HUDON>0)
    // UMmu display messages
    if(dHudMessageDelay>0)
    {
        TextOut (hDC,5,hps->H/60*15,cUmmuHudDisplay,strlen(cUmmuHudDisplay));
        dHudMessageDelay-=oapiGetSimStep();
        if(dHudMessageDelay<0)
            dHudMessageDelay=0;
    }
}

   
   
void MOONBASEALPHA::HUD_Text(const HUDPAINTSPEC* pHPS, HDC hdc)  
   
{  
    char cbuf[128];
//  char cbuf2[128];
  int n, tx, ty, ty2, yoff, bs, ap,n1,ty3,ty4;
  double apd;
  GetTextMetrics(hdc, &tm);
  yoff = tm.tmHeight;
  tx = tm.tmAveCharWidth;
  ty4 = 10 * yoff;
  ty3 = 9 * yoff;
  ty = 10 * yoff;
  ty2 = 11 * yoff;

  //Rectangle (hdc, tx-2, ty-1, tx+120,ty+(yoff*7));
  SetTextColor (hdc, colRed);
  n1 = sprintf (cbuf, "CAMERA: %d", (CAM));
  TextOut(hdc,tx,ty3,cbuf,n1 );
  if (CAM==0) {n=sprintf (cbuf, "External ");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
  if (CAM==1) {n=sprintf (cbuf, "Pad#1TOP ");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
  if (CAM==2) {n=sprintf (cbuf, "Pad#1SIDEANGLE ");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
  if (CAM==3) {n=sprintf (cbuf, "Pad#1SIDE");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
 
  if (CAM==4) {n=sprintf (cbuf, "Pad#2TOP ");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
if (CAM==5) {n=sprintf (cbuf, "Pad#2SIDEANGLE ");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
if (CAM==6) {n=sprintf (cbuf, "Pad#2SIDE");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
if (CAM==7) {n=sprintf (cbuf, "Pad#3TOP");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
if (CAM==8) {n=sprintf (cbuf, "Pad#3SIDEANGLE");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
if (CAM==9) {n=sprintf (cbuf, "Pad#3SIDE");
  TextOut(hdc,tx+100,ty3,cbuf,n );}

if (CAM==10) {n=sprintf (cbuf, "Pad#4TOP ");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
if (CAM==11) {n=sprintf (cbuf, "Pad#4SIDEANGLE ");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
if (CAM==12) {n=sprintf (cbuf, "Pad#4SIDE");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
if (CAM==13) {n=sprintf (cbuf, "Pad#5TOP");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
if (CAM==14) {n=sprintf (cbuf, "Pad#5SIDEANGLE");
  TextOut(hdc,tx+100,ty3,cbuf,n );}
if (CAM==15) {n=sprintf (cbuf, "Pad#5SIDE");
  TextOut(hdc,tx+100,ty3,cbuf,n );}




  SetTextColor (hdc, colDodgerBlue);

  n = sprintf (cbuf, "Landing Pad Selected: %d", (APSel+1));
  TextOut(hdc,tx,ty,cbuf,n );

 
 
 
  TextOut(hdc,tx,ty2,"LANDING PAD STATUS",18);
bs=0;
 
    //Launch/attachment point status display Left Bay
   
     



     
           
sprintf (cbuf, "1: ");
TextOut(hdc,(tx),(ty2 + (yoff*1))+3,cbuf,strlen(cbuf) );
        if(GetAttachmentStatus(LP1)){
          oapiGetObjectName (GetAttachmentStatus(LP1), cbuf, 100);
        }else{
          sprintf (cbuf, "-----");
        }
          TextOut(hdc,(tx+14),(ty2 + (yoff*1))+3,cbuf,strlen(cbuf) );
     
sprintf (cbuf, "2: ");
TextOut(hdc,(tx),(ty2 + (yoff*2))+3,cbuf,strlen(cbuf) );        
         
          if(GetAttachmentStatus(LP2)){
          oapiGetObjectName (GetAttachmentStatus(LP2), cbuf, 100);
        }else{
          sprintf (cbuf, "-----");
        }
              TextOut(hdc,(tx+14),(ty2 + (yoff*2))+3,cbuf,strlen(cbuf) );

                     
sprintf (cbuf, "3: ");
TextOut(hdc,(tx),(ty2 + (yoff*3))+3,cbuf,strlen(cbuf) );
               
                    if(GetAttachmentStatus(LP3)){
          oapiGetObjectName (GetAttachmentStatus(LP3), cbuf, 100);
        }else{
          sprintf (cbuf, "-----");
        }
        TextOut(hdc,(tx+14),(ty2 + (yoff*3))+3,cbuf,strlen(cbuf) );
     
sprintf (cbuf, "4: ");
TextOut(hdc,(tx),(ty2 + (yoff*4))+3,cbuf,strlen(cbuf) );
         
                    if(GetAttachmentStatus(LP4)){
          oapiGetObjectName (GetAttachmentStatus(LP4), cbuf, 100);
        }else{
          sprintf (cbuf, "-----");
        }
                TextOut(hdc,(tx+14),(ty2 + (yoff*4))+3,cbuf,strlen(cbuf) );
     
sprintf (cbuf, "5: ");
TextOut(hdc,(tx),(ty2 + (yoff*5))+3,cbuf,strlen(cbuf) );
        if(GetAttachmentStatus(LP5)){
          oapiGetObjectName (GetAttachmentStatus(LP5), cbuf, 100);
        }else{
          sprintf (cbuf, "-----");
        }
                TextOut(hdc,(tx+14),(ty2 + (yoff*5))+3,cbuf,strlen(cbuf) );
 
}
//void MOONBASEALPHA::clbkDrawHUD(int iMode, const HUDPAINTSPEC* pHPS, HDC hdc)
//{
//    VESSEL2::clbkDrawHUD(iMode, pHPS, hdc);
//    HUD_Text(pHPS, hdc);
//}


Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
Reply #1 - 12 March 2010, 12:32:57
I redid my code so now both get displayed.

« Last Edit: 12 March 2010, 12:32:57 by gattico »