Results 1 to 6 of 6
  1. #1
    phoenixraider's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    21

    [Source] Keyboard Menu 2.0

    Title: Keyboard Menu 2.0
    Author: Str1k3r21
    Credits: Cobra (making a Tutorial with Highlights)

    Update Log
    1. Added Multi-State Options
    2. Switched from "Use Unicode Character Set" to "Use Multi-Byte Character Set ".
    3. Added Arrow Key Left usage
    4. Added AddHotkeys();

    Code:
    #include "font.h"
    #include <fstream>
    
    void AddItem( char* string2, int hack, int i );
    void SetHighlights(int menusize);
    
    struct positions{
        float x;
        float y;
        float MaxItems;
        char *Title;
    }Menu;
    
    struct hacks{
        int hack1;
        int hack2;
    }Hack;
    
    int highlight[2] = {1,0};
    
    bool CH_Menu = false;
    
    void AddHotkeys(){
        if(highlight[1] == 1 && (GetAsyncKeyState(VK_RIGHT)&1)) if(Hack.hack1 <= 2){Hack.hack1++;}
        if(highlight[1] == 1 && (GetAsyncKeyState(VK_LEFT)&1)) if(Hack.hack1 != 0){Hack.hack1--;}
        if(Hack.hack1>2)Hack.hack1=0;
        if(highlight[2] == 1 && (GetAsyncKeyState(VK_RIGHT)&1)) if(Hack.hack2 <= 5){Hack.hack2++;}
        if(highlight[2] == 1 && (GetAsyncKeyState(VK_LEFT)&1)) if(Hack.hack2 != 0){Hack.hack2--;}
        if(Hack.hack2>5)Hack.hack2=0;
    }
    
    int current;
    char Saveit[25];
    
    void DrawMenu(LPDIRECT3DDEVICE8 pDevice)
    {
        Menu.x = 10;
        Menu.y = 70;
        Menu.MaxItems = 2;
        Menu.Title = "Phoenix Menu";
    
    if (GetAsyncKeyState(VK_INSERT)&1)
    {
        CH_Menu = !CH_Menu;
    }
    
    if (CH_Menu)
    {
        // How Many Hacks //
        SetHighlights(Menu.MaxItems);
    
        // Menu Background //
        Box(pDevice, 1, Menu.x - 5, Menu.y - 5, 120, 60, TBlue, White);
    
        // Menu Title //
        Text(Font10, Menu.Title, 1, Menu.x, Menu.y, Yellow, 0);
    
        AddHotkeys();
    
        // Menu Items //
        AddItem("Option1", Hack.hack1, 1);
        AddItem("Option2", Hack.hack2, 2);
    
    }
    }
    
    void AddItem( char* string2, int hack, int i )
    {
    current = hack;
    sprintf(Saveit, "%i", current);
    
    float Equation = i * 15;
    float x = Menu.x + 5;
    float xs = Menu.x + 88;
    float y = Menu.y + Equation;
    
    if(highlight[i]==1)
    Text(Font8, string2, 1, x, y, Red, 0);
    else
    Text(Font8, string2, 1, x, y, White, 0);
    if(hack){
    if(highlight[i]==1)
    Text(Font8, Saveit, 1, xs, y, Red, 0);
    else
    Text(Font8, Saveit, 1, xs, y, White, 0);}
    else if(!hack){
    if(highlight[i]==1)
    Text(Font8, Saveit, 1, xs, y, Red, 0);
    else
    Text(Font8, Saveit, 1, xs, y, White, 0);}
    }
    
    void SetHighlights(int menusize)
    {
    if(GetAsyncKeyState(VK_UP)&1)
    {
        for(int i=0; i < menusize+1; i++)
        {
            if (highlight[i] == 1)
            {
                int a = i-1;
    
                if(a < 0)
                break;
    
            else
            {
                highlight[a]=1;
                highlight[i]=0;
                break;
            }
            }
        }
    }
    
    if(GetAsyncKeyState(VK_DOWN)&1)
    {
        for(int i=0; i < menusize+2; i++)
        {
            if (highlight[i] == 1)
            {
                int a = i+1;
    
                if(a > menusize)
                break;
    
            else
            {
                highlight[a]=1;
                highlight[i]=0;
                break;
            }
            }
        }
    }
    }
    Note:
    This was my first attempt at a Multi-State Menu.

    Picture
    [IMG]https://www.*********.com/forum/attachments/d3d-programming/9587d1260001384-keyboard-menu-2-0-1-multistate-menu.jpg[/IMG]
    My private D3D

    [img]https://i279.photobucke*****m/albums/kk147/crusher233/PR.png[/img]

    X-Mas Hook in Action (version 1.0)
    [YOUTUBE]XET-y-2PZig[/YOUTUBE]

  2. #2
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Shouldn't you give us what's in font.h? I think that would help us understand a little more.

  3. #3
    Matrix_NEO006's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    240
    Reputation
    12
    Thanks
    33
    My Mood
    Lonely
    d3d8 sux in these days but thx for the source.

  4. #4
    phoenixraider's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    21
    Quote Originally Posted by Davidm44 View Post
    Shouldn't you give us what's in font.h? I think that would help us understand a little more.

    font.h is just my ..
    CreateD3DFont / RemoveD3DFont functions
    My private D3D

    [img]https://i279.photobucke*****m/albums/kk147/crusher233/PR.png[/img]

    X-Mas Hook in Action (version 1.0)
    [YOUTUBE]XET-y-2PZig[/YOUTUBE]

  5. #5
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Well, a while ago, I was looking around the web for a tutorial on how to draw over D3D environment using the addresses and I wasn't able to find anything. So I think this would really help me and alot of other people if you could post whatever's in font.h

  6. #6
    TheRealVB's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    Missouri
    Posts
    191
    Reputation
    -51
    Thanks
    23
    My Mood
    Busy
    Quote Originally Posted by Davidm44 View Post
    Well, a while ago, I was looking around the web for a tutorial on how to draw over D3D environment using the addresses and I wasn't able to find anything. So I think this would really help me and alot of other people if you could post whatever's in font.h
    for once i actually agree wit sum 1 on this site >,<
    Raging On CA Under VB-ReBoRn

Similar Threads

  1. [Help] ERRO Source base menu combined
    By franpanpan in forum Combat Arms Coding Help & Discussion
    Replies: 4
    Last Post: 11-13-2010, 03:19 PM
  2. [Tutorial] Warrock Source For Menu
    By Gh0sts~l1f3 in forum WarRock Hack Source Code
    Replies: 7
    Last Post: 11-11-2010, 03:15 PM
  3. [Source]Simple menu class
    By Void in forum C++/C Programming
    Replies: 44
    Last Post: 10-04-2010, 08:21 PM
  4. [Source]Keyboard recorded, watcher
    By /b/oss in forum Visual Basic Programming
    Replies: 36
    Last Post: 08-14-2010, 05:37 PM
  5. [Source] Checkbox Menu by Str1k3r21 *D3D8*
    By phoenixraider in forum C++/C Programming
    Replies: 7
    Last Post: 03-31-2009, 05:24 PM