Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,035
    Reputation
    340
    Thanks
    2,784
    My Mood
    Sad

    Eclair source code.



    Remember that shitty release Eclair from a while back? Well now you can see my bad coding styles, and the coding styles I love to embrace but never follow myself.

    Part of my source code - this is the Eclair menu that you see below (screenshot).

    More coming soon

    Code:
    #include"StdAfx.h"
    #include"Pivot.h"
    usingnamespacestd;
    PivotHost::PivotHost(void){height=0;AnimationOffset=0;scrollOffset=0;reservedInt=0;smallIncrementCounter=0;bottomAlpha=0;sliderColor=D3DCOLOR_ARGB(255,30,30,30);descBarColor=D3DCOLOR_ARGB(100,10,10,10);selectedItem=-1;selectedItemSpot=0;descBarHeight=0;dLeftMouse=0;dRightMouse=0;mouseOverLength=0;addToMouseOverLength=false;selectedSubItem=-1;lastSelectedSubItem=-1;lastSelectedSubItemDescOpac=0;selectedSubItemDescOpac=0;selectedSubItemDescOffset=0;quickHoverSelectedSubItem=-1;}PivotHost::~PivotHost(void){}voidPivotHost::AddItem(PivotItempiv){Columns.push_back(piv);}voidPivotHost::D3DObjects(LPDIRECT3DDEVICE9pDevice){for(it=Columns.begin();it<Columns.end();it++){it->D3DObjects(pDevice);for(it->it=it->Items.begin();it->it<it->Items.end();it->it++)it->it->SetTextSize();}for(inti=0;i<Columns.size();i++){for(intj=0;j<Columns[i].Items.size();j++){PivotSubItemTitleFont->GetTextExtent(Columns[i].Items[j].hotkey->friendlyName,&Columns[i].Items[j].hotkey->textSize);}}}voidPivotHost::Draw(LPDIRECT3DDEVICE9pDevice,SpriteBatch*sprite){if(Input::IsKeyDown(xLBUTTON)){dLeftMouse2++;}elsedLeftMouse2=0;if(Input::IsKeyDown(xRBUTTON)){dRightMouse2++;}elsedRightMouse2=0;if(height>0){dx::FillRGB(0,sys::screenSize.cy-height-descBarHeight,sys::screenSize.cx,descBarHeight,descBarColor,pDevice);if(selectedSubItem>=0){font::fontSegoe14->DrawTextA(5,sys::screenSize.cy-height-descBarHeight+selectedSubItemDescOffset+2,D3DCOLOR_ARGB(selectedSubItemDescOpac,255,255,255),(TCHAR*)Columns[selectedItem].Items[selectedSubItem].text);if(lastSelectedSubItem>=0)font::fontSegoe14->DrawTextA(5,sys::screenSize.cy-height-descBarHeight+2,D3DCOLOR_ARGB(lastSelectedSubItemDescOpac,255,255,255),(TCHAR*)Columns[selectedItem].Items[lastSelectedSubItem].text);}dx::FillRGB(0,sys::screenSize.cy-height,sys::screenSize.cx,height,sliderColor,pDevice);spot=PivotItemMargin;reservedInt=AnimationOffset+scrollOffset;count=0;for(it=Columns.begin();it<Columns.end();it++){if(MouseState::isIn(spot+reservedInt,sys::screenSize.cy-height,it->titleSize.cx+PivotItemHorizontalSpacing,100)){PivotItemFont->DrawTextA(spot+reservedInt,sys::screenSize.cy-55,D3DCOLOR_ARGB(bottomAlpha,180,180,180),it->title);if(dLeftMouse2==1&&selectedItem!=count){selectedItem=count;lastSelectedSubItem=-1;selectedSubItem=-1;}}elsePivotItemFont->DrawTextA(spot+reservedInt,sys::screenSize.cy-55,D3DCOLOR_ARGB(bottomAlpha,255,255,255),it->title);it->spot=spot;spot+=it->titleSize.cx+PivotItemHorizontalSpacing;count++;}for(inti=0;i<Columns.size();i++){if(i==selectedItem){intspot2=sys::screenSize.cy-PivotSubItemDistanceFromBottom;intspot3=Columns[selectedItem].spot+scrollOffset+AnimationOffset;for(intj=Columns[selectedItem].Items.size()-1;j>=0;j--){if(Columns[selectedItem].Items[j].activation==ACTIVATION_NORMAL){if(MouseState::isIn(spot3,spot2+Columns[selectedItem].verticalOffset,Columns[selectedItem].Items[j].titleSize.cx<150?150:Columns[selectedItem].Items[j].titleSize.cx,PivotSubItemLineSpacing)){if(Columns[selectedItem].Items[j].modifer[0]){PivotSubItemTitleFont->DrawTextA(spot3<0?0:spot3,spot2+Columns[selectedItem].verticalOffset,bottomAlpha<250?D3DCOLOR_ARGB(bottomAlpha,sys::accentTR,sys::accentTG,sys::accentTB):D3DCOLOR_ARGB(Columns[selectedItem].Alpha,sys::accentTR,sys::accentTG,sys::accentTB),(TCHAR*)Columns[selectedItem].Items[j].title);PivotSubItemSuperScriptFont->DrawTextA(spot3<0?0+Columns[selectedItem].Items[j].titleSize.cx:spot3+Columns[selectedItem].Items[j].titleSize.cx,spot2+Columns[selectedItem].verticalOffset,bottomAlpha<250?D3DCOLOR_ARGB(bottomAlpha,sys::accentTR,sys::accentTG,sys::accentTB):D3DCOLOR_ARGB(Columns[selectedItem].Alpha,sys::accentTR,sys::accentTG,sys::accentTB),Columns[selectedItem].Items[j].itemType==TYPE_TEXT_MASK?(TCHAR*)Columns[selectedItem].Items[j].textmask[Columns[selectedItem].Items[j].modifer[0]-1].c_str():(TCHAR*)Columns[selectedItem].Items[j].displayValue);}else{PivotSubItemTitleFont->DrawTextA(spot3<0?0:spot3,spot2+Columns[selectedItem].verticalOffset,bottomAlpha<250?D3DCOLOR_ARGB(bottomAlpha,255,255,255):D3DCOLOR_ARGB(Columns[selectedItem].Alpha,255,255,255),(TCHAR*)Columns[selectedItem].Items[j].title);}if(j!=selectedSubItem&&mouseOverLength>50&&selectedItem==i){lastSelectedSubItem=selectedSubItem;lastSelectedSubItemDescOpac=255;selectedSubItemDescOpac=0;selectedSubItemDescOffset=30;selectedSubItem=j;mouseOverLength=0;}elseif(j!=quickHoverSelectedSubItem&&selectedItem==i){quickHoverSelectedSubItem=j;mouseOverLength=0;addToMouseOverLength=false;}elseif(selectedItem==i)addToMouseOverLength=true;else{mouseOverLength==0;addToMouseOverLength=false;}if(dLeftMouse2==1||dLeftMouse>40){switch(Columns[selectedItem].Items[j].itemType){caseTYPE_BOOL:Columns[selectedItem].Items[j].modifer[0]=!Columns[selectedItem].Items[j].modifer[0];break;caseTYPE_TEXT_MASK:if(Columns[selectedItem].Items[j].modifer[0]>0)Columns[selectedItem].Items[j].modifer[0]--;break;caseTYPE_INT:if(Columns[selectedItem].Items[j].modifer[0]>0)Columns[selectedItem].Items[j].modifer[0]--;if(Columns[selectedItem].Items[j].modifer[0]>0)sprintf_s(Columns[selectedItem].Items[j].displayValue,sizeof(Columns[selectedItem].Items[j].displayValue),"%d",Columns[selectedItem].Items[j].modifer[0]);elsesprintf_s(Columns[selectedItem].Items[j].displayValue,sizeof(Columns[selectedItem].Items[j].displayValue),"");break;caseTYPE_INT_MASK_AS_FLOAT:if(Columns[selectedItem].Items[j].modifer[0]>0)Columns[selectedItem].Items[j].modifer[0]--;if(Columns[selectedItem].Items[j].modifer[0]>0)sprintf_s(Columns[selectedItem].Items[j].displayValue,sizeof(Columns[selectedItem].Items[j].displayValue),"%.1f",1+(float)Columns[selectedItem].Items[j].modifer[0]/10);elsesprintf_s(Columns[selectedItem].Items[j].displayValue,sizeof(Columns[selectedItem].Items[j].displayValue),"");break;}}if(dRightMouse2==1||dRightMouse>40){switch(Columns[selectedItem].Items[j].itemType){caseTYPE_BOOL:Columns[selectedItem].Items[j].modifer[0]=!Columns[selectedItem].Items[j].modifer[0];break;caseTYPE_TEXT_MASK:if(Columns[selectedItem].Items[j].modifer[0]<Columns[selectedItem].Items[j].MaximumValue)Columns[selectedItem].Items[j].modifer[0]++;break;caseTYPE_INT:if(Columns[selectedItem].Items[j].modifer[0]<Columns[selectedItem].Items[j].MaximumValue)Columns[selectedItem].Items[j].modifer[0]++;sprintf_s(Columns[selectedItem].Items[j].displayValue,sizeof(Columns[selectedItem].Items[j].displayValue),"%d",Columns[selectedItem].Items[j].modifer[0]);break;caseTYPE_INT_MASK_AS_FLOAT:if(Columns[selectedItem].Items[j].modifer[0]<Columns[selectedItem].Items[j].MaximumValue)Columns[selectedItem].Items[j].modifer[0]++;sprintf_s(Columns[selectedItem].Items[j].displayValue,sizeof(Columns[selectedItem].Items[j].displayValue),"%.1f",1+(float)Columns[selectedItem].Items[j].modifer[0]/10);break;}}}else{if(Columns[selectedItem].Items[j].modifer[0]){PivotSubItemTitleFont->DrawTextA(spot3<0?0:spot3,spot2+Columns[selectedItem].verticalOffset,bottomAlpha<250?D3DCOLOR_ARGB(bottomAlpha,sys::accentR,sys::accentG,sys::accentB):D3DCOLOR_ARGB(Columns[selectedItem].Alpha,sys::accentR,sys::accentG,sys::accentB),(TCHAR*)Columns[selectedItem].Items[j].title);PivotSubItemSuperScriptFont->DrawTextA(spot3<0?0+Columns[selectedItem].Items[j].titleSize.cx:spot3+Columns[selectedItem].Items[j].titleSize.cx,spot2+Columns[selectedItem].verticalOffset,bottomAlpha<250?D3DCOLOR_ARGB(bottomAlpha,sys::accentR,sys::accentG,sys::accentB):D3DCOLOR_ARGB(Columns[selectedItem].Alpha,sys::accentR,sys::accentG,sys::accentB),Columns[selectedItem].Items[j].itemType==TYPE_TEXT_MASK?(TCHAR*)Columns[selectedItem].Items[j].textmask[Columns[selectedItem].Items[j].modifer[0]-1].c_str():(TCHAR*)Columns[selectedItem].Items[j].displayValue);}else{PivotSubItemTitleFont->DrawTextA(spot3<0?0:spot3,spot2+Columns[selectedItem].verticalOffset,bottomAlpha<250?D3DCOLOR_ARGB(bottomAlpha,200,200,200):D3DCOLOR_ARGB(Columns[selectedItem].Alpha,200,200,200),(TCHAR*)Columns[selectedItem].Items[j].title);}}}else{PivotSubItemTitleFont->DrawTextA(spot3<0?0:spot3,spot2+Columns[selectedItem].verticalOffset,bottomAlpha<250?D3DCOLOR_ARGB(bottomAlpha,100,100,100):D3DCOLOR_ARGB(Columns[selectedItem].Alpha,100,100,100),(TCHAR*)Columns[selectedItem].Items[j].title);}spot2-=PivotSubItemLineSpacing;}}elseif(Columns[i].Alpha>0){intspot2=sys::screenSize.cy-PivotSubItemDistanceFromBottom;intspot3=Columns[i].spot+scrollOffset+AnimationOffset;for(Columns[i].rit=Columns[i].Items.rbegin();Columns[i].rit<Columns[i].Items.rend();Columns[i].rit++){PivotSubItemTitleFont->DrawTextA(spot3<0?0:spot3,spot2+Columns[i].verticalOffset,D3DCOLOR_ARGB(Columns[i].Alpha,180,180,180),(TCHAR*)Columns[i].rit->title);spot2-=PivotSubItemLineSpacing;}}}}}voidPivotHost::KeyUpdate(SHotkey*menuHotkey){kMenu[0]=Input::IsKeyDown(menuHotkey->vKey);if(MouseState::left[0])dLeftMouse++;elsedLeftMouse=0;if(MouseState::right[0])dRightMouse++;elsedRightMouse=0;}voidPivotHost::KeyComplete(){kMenu[1]=kMenu[0];}boolPivotHost::smallIncrement(intincrement){if(smallIncrementCounter==0||smallIncrementCounter%increment==0)returntrue;returnfalse;}voidPivotHost::Update(SHotkey*menuHotkey){KeyUpdate(menuHotkey);smallIncrementCounter++;if(kMenu[0]&&!kMenu[1]){isShown=!isShown;
    #ifdefNDEBUGif(*(int*)GAMEADDRESS_GAMESTATUS==1){keybd_event(xESCAPE,0,NULL,NULL);keybd_event(xESCAPE,0,KEYEVENTF_KEYUP,NULL);}
    #endifif(isShown){for(it=Columns.begin();it<Columns.end();it++){it->Alpha=0;it->verticalOffset=0;}AnimationOffset=100;scrollOffset=0;bottomAlpha=0;selectedItem=-1;selectedSubItem=-1;lastSelectedSubItem=-1;lastSelectedSubItemDescOpac=0;selectedSubItemDescOpac=0;}}if(isShown){if(addToMouseOverLength)mouseOverLength++;if(height<PivotHeight)height+=5;elseif(descBarHeight<DescriptionBarHeight&&smallIncrement(2))descBarHeight++;if(AnimationOffset>10)AnimationOffset-=5;elseif(scrollOffset>-55&&smallIncrement(4))scrollOffset--;if(bottomAlpha<240)bottomAlpha+=10;elseif(bottomAlpha<255)bottomAlpha=255;if(selectedSubItemDescOpac<255)selectedSubItemDescOpac+=15;if(lastSelectedSubItemDescOpac>0)lastSelectedSubItemDescOpac-=15;if(selectedSubItemDescOffset>0)selectedSubItemDescOffset-=2;}elseif(!isShown&&height>0){descBarHeight--;height-=5;bottomAlpha-=15;}if(isShown){for(inti=0;i<Columns.size();i++){if(i==selectedItem){if(Columns[i].Alpha<250)Columns[i].Alpha+=10;if(Columns[i].verticalOffset>-30)Columns[i].verticalOffset-=2;}else{if(Columns[i].Alpha>0)Columns[i].Alpha-=20;if(Columns[i].verticalOffset<0)Columns[i].verticalOffset+=2;}}}if(smallIncrementCounter>3600)smallIncrementCounter=0;KeyComplete();}


  2. The Following 8 Users Say Thank You to freedompeace For This Useful Post:

    CheeseTea (03-20-2011),DRAKE` (03-30-2011),NOOB (03-20-2011),NOOBJr (03-20-2011),S0aD (03-20-2011),Tony Stark` (03-20-2011),Turbulence (03-23-2011),UKnownError (04-02-2011)

  3. #2
    [E]xiled's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    Melbourne, Australia.
    Posts
    180
    Reputation
    84
    Thanks
    273
    My Mood
    Breezy
    Nice job freedompeace, very sexy.
    | Buy Premium MC accounts CHEAP Click here |
    Respected seller.
    Check my vouches in the first post of the above MC account thread ^

  4. #3
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,404
    My Mood
    In Love
    Y u do this
    No I do not make game hacks anymore, please stop asking.


    Been MPGH Minion: 6 July 2011 - 1 August 2012

  5. #4
    Lost-Soul's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    132
    Reputation
    7
    Thanks
    7
    My Mood
    Amazed
    Good job

  6. #5
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,035
    Reputation
    340
    Thanks
    2,784
    My Mood
    Sad
    Quote Originally Posted by flameswor10 View Post
    Y u do this
    Do what? Lol.

  7. #6
    aeronyx's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    /210/
    Posts
    11,238
    Reputation
    1211
    Thanks
    4,972
    Holy shit. Mindraping menus anyone? ;O

  8. #7
    mushdoomx's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    123 CUNTMUFFIN drive
    Posts
    222
    Reputation
    2
    Thanks
    11
    My Mood
    Dead
    i love your stuff freedompeace but one time it asploded my computer what the fuck was that?

  9. #8
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,035
    Reputation
    340
    Thanks
    2,784
    My Mood
    Sad
    Quote Originally Posted by mushdoomx View Post
    i love your stuff freedompeace but one time it asploded my computer what the fuck was that?
    Ahhhh, now that, that is called a bomb =)

  10. The Following User Says Thank You to freedompeace For This Useful Post:

    Sympathy Hero (03-30-2011)

  11. #9
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,404
    My Mood
    In Love
    Quote Originally Posted by freedompeace View Post


    Do what? Lol.
    Y U release your EPIC Menu Source
    Makes my one look like shit xD
    No I do not make game hacks anymore, please stop asking.


    Been MPGH Minion: 6 July 2011 - 1 August 2012

  12. #10
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,170
    Reputation
    490
    Thanks
    2,252
    this whole thread for 6 lines of code

  13. #11
    CheeseTea's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    Canadialand.
    Posts
    1,367
    Reputation
    41
    Thanks
    80
    My Mood
    Cheerful
    That's the sexiest menu I've ever seen.

    I want it in ever single hack ever made from this point forward.

  14. #12
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,035
    Reputation
    340
    Thanks
    2,784
    My Mood
    Sad
    Quote Originally Posted by CheeseTea View Post
    That's the sexiest menu I've ever seen.

    I want it in ever single hack ever made from this point forward.
    hehe well now you have it

    Quote Originally Posted by whit View Post
    this whole thread for 6 lines of code
    It's actually 3 lines of code... but MPGH code box split it

  15. #13
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,323
    My Mood
    Doh
    Can I have all of it? Tehe could be fun to learn off of

  16. #14
    luccss's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    484
    Reputation
    183
    Thanks
    3,430
    My Mood
    Breezy
    Good job man , send source for I work on CABR

  17. The Following User Says Thank You to luccss For This Useful Post:

    speedforyou (03-20-2011)

  18. #15
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    4,922
    My Mood
    Cool
    Hmm freedom did you use DirectInput?

    FREEDOM.. you should use [HIGHLIGHT=cpp]
    to do your code


    [HIGHLIGHT=CPP]

    void PivotHost::KeyComplete()
    {
    kMenu|1|=kMenu|0|;
    }

    bool PivotHost::smallIncrement(int increment)
    {
    if(smallIncrementCounter==0 || smallIncrementCounter % increment==0)
    return true;
    return false;
    }
    [/highlight]
    Last edited by topblast; 03-20-2011 at 08:37 AM.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

Page 1 of 3 123 LastLast