Results 1 to 5 of 5
  1. #1
    gusdnide's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Posts
    287
    Reputation
    15
    Thanks
    1,847
    My Mood
    Amazed

    Simples Menu D3D Class With Items and CheckBox's

    My Menu.h
    Code:
    #include <Windows.h>
    #include <stdio.h>
    #include <d3d9.h>
    #include <d3dx9.h>
    #include <detours.h>
    
    #pragma comment( lib, "d3d9.lib" )
    #pragma comment( lib, "d3dx9.lib" )
    
    class Menu
    {
    protected:
    	DWORD CorFundo;
    	DWORD CorBorda;
    	DWORD CorEscrita;
    	int TamanhoChk = 20;
    	POINT MenuLoc;
    	POINT MenuTamanho;
    	char* MenuTitulo; 
    	int ItemInicio;
    	VOID FillRGB(INT x, INT y, INT w, INT h, D3DCOLOR Color, LPDIRECT3DDEVICE9 pDevice)
    	{
    		D3DRECT rec = { x, y, x + w, y + h };
    		pDevice->Clear(1, &rec, D3DCLEAR_TARGET, Color, 0, 0);
    	} //Fill Space 
    	VOID DrawBorder(INT x, INT y, INT w, INT h, INT px, DWORD Color, LPDIRECT3DDEVICE9 pDevice)
    	{
    		FillRGB(x, (y + h - px), w, px, Color, pDevice);
    		FillRGB(x, y, px, h, Color, pDevice);
    		FillRGB(x, y, w, px, Color, pDevice);
    		FillRGB((x + w - px), y, px, h, Color, pDevice);
    	} //Draw Border
    	VOID DrawRect(LPDIRECT3DDEVICE9 pDevice, INT x, INT y, INT w, INT h, DWORD Color)
    	{
    		D3DRECT rec;
    		rec.x1 = x;
    		rec.x2 = x + w;
    		rec.y1 = y;
    		rec.y2 = y + h;
    		pDevice->Clear(1, &rec, D3DCLEAR_TARGET, Color, 0, 0);
    	} //DrawRectangle with Background
    	VOID Escrever(INT x, INT y, D3DCOLOR Color, CHAR *String)
    	{
    		RECT Rect;
    		SetRect(&Rect, x, y, x, y);
    		PFont->DrawTextA(0, String, -1, &Rect, DT_LEFT | DT_NOCLIP, Color);
    	} //WriteText
    	bool VerificarPressionado(int x, int y, int w, int h)
    	{
    		POINT Mouse;
    		GetCursorPos(&Mouse);
    		ScreenToClient(GetForegroundWindow(), &Mouse);
    		if (GetAsyncKeyState(VK_LBUTTON))
    		{
    			if ((Mouse.x > x) && (Mouse.x < x + w) && (Mouse.y > y) && (Mouse.y < y + h))
    			{
    				Sleep(250);
    				return true;
    			}
    
    		}
    		return false;
    	}  //If LBUTTON Pressed in Location :) ret True;
    public:
    
    	void SetupMenu(int x, int y, int w, int h, char* Titulo, DWORD CorF, DWORD CorB, DWORD CorE) // Config Menu
    	{
    		MenuLoc.x = x; // Location Menu X
    		MenuLoc.y = y; // Location Menu Y
    		ItemInicio = y + 23; // Items Begin Y
    		MenuTamanho.x = w; // Menu Width
    		MenuTamanho.y = h; // Menu Hegth
    		MenuTitulo = Titulo; //Menu Title
    		CorFundo = CorF; // Menu  BackGround Color
    		CorBorda = CorB; //  Menu Border Color
    		CorEscrita = CorE; // Menu Text Color
    	}
    	VOID DesenharMenu(LPDIRECT3DDEVICE9 pDevice) //Draw Menu
    	{
    		DrawRect(pDevice, MenuLoc.x, MenuLoc.y, MenuTamanho.x, MenuTamanho.y, CorFundo); //Draw BackGround Menu
    		DrawBorder(MenuLoc.x, MenuLoc.y, MenuTamanho.x, MenuTamanho.y, 2, CorBorda, pDevice ); //Draw Border Menu
    		DrawBorder(MenuLoc.x, MenuLoc.y, MenuTamanho.x, 21, 2, CorBorda, pDevice); //Draw Box Titulo
    		Escrever((MenuTamanho.x / 2 )- MenuLoc.x , MenuLoc.y + 2, CorEscrita, MenuTitulo); // Draw Text Titulo
    	}
    
    	VOID AdicionarCheckBox(char* Texto, bool &Var, int Item, LPDIRECT3DDEVICE9 pDevice) // Add Item ( CheckBox )
    	{
    		int x = MenuLoc.x + 4; 
    		int y = ItemInicio + (TamanhoChk * Item); 
    		int w = 17;
    		int h = 17;
    		FillRGB(x, y, w, h, D3DCOLOR_ARGB(0, 0, 0, 100), pDevice);  // Draw Back BOX
    		Escrever(x + 21, y, CorEscrita, Texto); // Draw Text 
    		if (VerificarPressionado(x, y, w, h))Var = !Var; //If Click Mouse in Area of CheckBox
    		if (Var)
    		{
    			FillRGB(x + 1, y + 1, w - 2, h - 2, D3DCOLOR_ARGB(255, 255, 255, 51), pDevice); // Draw Box Selected
    		}
    
    	}
    
    }cMenu;

    How to use?
    In DLL MAIN:
    Code:
    cMenu.SetupMenu(X Menu, Y Menu, W Menu, H Menu, Title Menu, Back Color, Border Color, Text Color);
    
    Example:
    cMenu.SetupMenu(10, 10, 234, 285, "gusdnide", D3DCOLOR_RGBA(47, 45, 45, 255), D3DCOLOR_RGBA(77, 72, 72, 100), D3DCOLOR_ARGB(255, 255, 140, 000));
    In Render Func:
    Code:
    cMenu.DesenharMenu(pDevice);
    Example Add Item:
    Code:
    //cMenu.AdicionarCheckBox(Texto,Variable, Number Location, Device);
    
    cMenu.AdicionarCheckBox("WallHack", Wall, 1, pDevice);
    cMenu.AdicionarCheckBox("Chams", Chams, 2, pDevice);
    cMenu.AdicionarCheckBox("NoFog", Fog,  3, pDevice);
    Result:


    Credits:
    @gusdnide
    64com <- UNK (Some Draws)

  2. The Following 3 Users Say Thank You to gusdnide For This Useful Post:

    LilinFromYT (03-20-2019),Maggkollin (07-08-2015),WhiteHat PH (09-29-2015)

  3. #2
    viking911's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Location
    ViKiNGHOOK
    Posts
    214
    Reputation
    10
    Thanks
    2,219
    My Mood
    Devilish
    Very nice menu, thanks :-)
    FAKEEDGEBOY$ - B4RB0$$4

  4. #3
    Maggkollin's Avatar
    Join Date
    May 2015
    Gender
    male
    Posts
    49
    Reputation
    10
    Thanks
    900
    My Mood
    Yeehaw
    Nice menu bor +REP
    Cheater Since 2013



    Trade Stat

    ✔ Trade Complete : 17
    ✖ Trade Scammed : 1

  5. #4
    WhiteHat PH's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    Some Where I Belong
    Posts
    1,350
    Reputation
    25
    Thanks
    3,099
    My Mood
    Aggressive
    Check Box menu is very nice!






    When Im gone dont forget me cause I will come back someday.



    Youtube Channel


     


  6. #5
    milanousa's Avatar
    Join Date
    Feb 2016
    Gender
    male
    Posts
    5
    Reputation
    10
    Thanks
    3
    nice one man

Similar Threads

  1. [WTS] Cpt 2nd Class with Firebird and megas!
    By windstrukt in forum Alliance of Valiant Arms (AVA) Selling / Trading / Buying
    Replies: 24
    Last Post: 05-16-2014, 02:40 PM
  2. [WTS] Master sgt. 4th class with xm8 and dsr-1
    By Lauritz in forum Alliance of Valiant Arms (AVA) Selling / Trading / Buying
    Replies: 2
    Last Post: 02-11-2014, 12:15 PM
  3. [WTS] Warz 4 Accounts With Items And GC 10 $
    By can1357 in forum Selling Accounts/Keys/Items
    Replies: 0
    Last Post: 06-01-2013, 01:24 AM
  4. [WTT] Account Major 5th class with FG42 And Mp40 and more!!!
    By edo96juve in forum Alliance of Valiant Arms (AVA) Selling / Trading / Buying
    Replies: 0
    Last Post: 03-31-2013, 03:21 AM
  5. [Patched] (My First Hack) Simple Hack for CFPH - With Key And Sound
    By Jhem in forum CrossFire Philippines Hacks
    Replies: 48
    Last Post: 08-22-2012, 08:09 AM