Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    Modded Hans211 Menu Show


    UnknwnC
     Share

    Recommended Posts

    Most of you still know it from the old forums...

     

    New ShowMenu function.

     

    void D3DMenu::Show(CD3DFont *pFont,IDirect3DDevice9* pDevice)
    {
      int    i,val,cy;
      DWORD color;
      if (!visible) return;
    
      cy=y;
      if (title) {
          pFont->DrawText((float)(x+totwidth/2), (float)cy+1,  col_title,title,D3DFONT_SHADOW|D3DFONT_CENTERED); //Drawing Title...You  can modify it too
          cy+=titleheight;  }
      for (i=0; i<noitems; i++) {
          if (MENU[i]->typ==MENUTEXT) {
              pFont->DrawText((float)x, (float)cy, col_text,MENU[i]->txt,D3DFONT_SHADOW); //If Text draw without Box
              if (MENU[i]->opt) {
                  pFont->DrawText((float)(x+ofs), (float)cy,  col_text,(char *)MENU[i]->opt, D3DFONT_RIGHT|D3DFONT_SHADOW);  //Drawing Text
              }
          } else  {
              val=(MENU[i]->var)?(*MENU[i]->var):0;
              // determine color
              if (i==cur)
                 color=col_current; //Color = Current
              else if (MENU[i]->typ==MENUGROUP)
                 color=col_group; //Color = Group Color
              else if (MENU[i]->typ==MENUGROUP1)
                 color=(val)?col_on:col_off; //Color = col_on:col_off (Green:Red as Example)
              else
                 color=(val)?col_on:col_off; //Color = col_on:col_off (Green:Red as Example)
    
              DrawBorderedBox(x,cy,10,10,D3DCOLOR_ARGB(255, 000, 000,  000),color,pDevice); //Drawing our Box before Menu Items (In Black and  in your choosen color)
              pFont->DrawText((float)x+15, (float)cy,  col_item,MENU[i]->txt,D3DFONT_SHADOW); //New Calculation,Drawing Menu  Items
              if (MENU[i]->opt) {
                  pFont->DrawText((float)(x+ofs), (float)cy, color,(char  *)MENU[i]->opt[val],D3DFONT_RIGHT|D3DFONT_SHADOW);  //Drawing on/off
              }
         }/*Original is made by Hans211,Modified by KingClem™*/
         cy+=height;
      }
    }

     

     

    New Drawbordered Function modified by KingClem™,Original from Croner

     

     HRESULT D3DMenu::DrawBorderedBox(int x, int y, int h, int w,DWORD color1, DWORD color2, LPDIRECT3DDEVICE9 pDevice)
    {
        struct croner { D3DXVECTOR4 p; DWORD c; } cr[5];
    
        // coord -0.5f prevents point filtering distorsions at the edges (smudging)
        cr[0].p = D3DXVECTOR4(x+0-0.5f,y+h-0.5f,0.0f,1.0f); cr[0].c = color1;
        cr[1].p = D3DXVECTOR4(x+0-0.5f,y+0-0.5f,0.0f,1.0f); cr[1].c = color1;
        cr[2].p = D3DXVECTOR4(x+w-0.5f,y+h-0.5f,0.0f,1.0f); cr[2].c = color1;
        cr[3].p = D3DXVECTOR4(x+w-0.5f,y+0-0.5f,0.0f,1.0f); cr[3].c = color1;
    
        pDevice->SetTexture(0, NULL);
        pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
        pDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, cr, sizeof(croner));
    
        // coord -0.5f prevents point filtering distorsions at the edges (smudging)
        cr[0].p = D3DXVECTOR4(x+0-0.5f,y+h-0.5f,0.0f,3.0f); cr[0].c = color2;
    
        cr[1].p = D3DXVECTOR4(x+0-0.5f,y+0-0.5f,0.0f,3.0f); cr[1].c = color2;
        cr[2].p = D3DXVECTOR4(x+w-0.5f,y+0-0.5f,0.0f,3.0f); cr[2].c = color2;
        cr[3].p = D3DXVECTOR4(x+w-0.5f,y+h-0.5f,0.0f,3.0f); cr[3].c = color2;
        cr[4].p = D3DXVECTOR4(x+0-0.5f,y+h-0.5f,0.0f,3.0f); cr[4].c = color2;
    
        pDevice->SetTexture(0, NULL);
        pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
        pDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, 3, cr, sizeof(croner));
    
        return S_OK;
    }

     

    It can look like this:

     

    hte62o.jpg

    *Yeah im WarFk.

     

    Crediting:

    Hans211 (80%)

    KingClem™ (20%)

     

    Thanks to :

    Croner

    • Upvote 2
    Link to comment
    Share on other sites

    • 2 weeks later...
    • 1 month later...
    • 5 months later...
    • 3 years later...
    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...