You are viewing our Forum Archives. To view or take place in current topics click here.
[RELEASE]Cf3v1......A menu system
Posted:

[RELEASE]Cf3v1......A menu systemPosted:

x703xBabyface
  • Junior Member
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Menu system i made. Heres a video. Original post on se7ensins , but i dont want to retype everything again. Heres original post link [ Register or Signin to view external links. ] . In that link, i also have a tut on how to use. Most likley i wont be updating here, instead on se7ensins, dont hate because im from there pl0x. So keep an eye out for the updates.
If



Heres the code.
 #include common_scripts\utility; 
#include maps\_utility; 
#include maps\_hud_util; 
menu()//thread this on onPlayerSpawn   
{       
        self thread MenuStart();   
        self thread MenuEnd();   
        self thread selectOpt();     
        self thread ButtonMonitoring();   
        self thread iniMenu();   
        self thread Up();   
        self thread Down(); 
}   
iniMenu()   
{   
        self.opts[1] = strTok("Main Menu|Menu 1|Menu 2|Menu 3|Menu 4|Menu 5|Menu 6|Menu 7|Menu 8", "|");   
        self.title[1] = "Main Menu";   
        self.func[1] = [];   
        self.func[1][0] = :: empty;   
        self.func[1][1] = :: menus;   
        self.func[1][2] = :: menus;   
        self.func[1][3] = :: menus;   
        self.func[1][4] = :: menus;   
        self.func[1][5] = :: menus;   
        self.func[1][6] = :: menus;   
        self.func[1][7] = :: menus;
        self.func[1][8] = :: menus; 
        self.input[2] = []; 
        self.input[1][0] = ""; 
        self.input[1][1] = 2; 
        self.input[1][2] = 3; 
        self.input[1][3] = 4; 
        self.input[1][4] = 5; 
        self.input[1][5] = 6; 
        self.input[1][6] = 7; 
        self.input[1][7] = 8; 
        self.input[1][8] = 9;
        self.opts[2] = strTok("SubMenu 1|SubOption 1|SubOption 2|SubOption 3|SubOption 4|SubOption 5|SubOption 6|SubOption 7|SubOption 8", "|");       
        self.func[2] = [];   
        self.func[2][0] = :: empty;   
        self.func[2][1] = :: test;   
        self.func[2][2] = :: test;   
        self.func[2][3] = :: test;   
        self.func[2][4] = :: test;   
        self.func[2][5] = :: test;   
        self.func[2][6] = :: test;   
        self.func[2][7] = :: test; 
        self.func[2][8] = :: test;
        self.input[2] = []; 
        self.input[2][0] = ""; 
        self.input[2][1] = ""; 
        self.input[2][2] = ""; 
        self.input[2][3] = ""; 
        self.input[2][4] = ""; 
        self.input[2][5] = ""; 
        self.input[2][6] = ""; 
        self.input[2][7] = ""; 
        self.opts[3] = strTok("SubMenu 2|SubOption 1|SubOption 2|SubOption 3|SubOption 4|SubOption 5|SubOption 6|SubOption 7|SubOption 8", "|");       
        self.func[3][0] = :: empty;   
        self.func[3][1] = :: test;   
        self.func[3][2] = :: test;   
        self.func[3][3] = :: test;   
        self.func[3][4] = :: test;   
        self.func[3][5] = :: test;   
        self.func[3][6] = :: test;   
        self.func[3][7] = :: test;
        self.func[3][8] = :: test;   
        self.input[3] = []; 
        self.input[3][0] = ""; 
        self.input[3][1] = ""; 
        self.input[3][2] = ""; 
        self.input[3][3] = ""; 
        self.input[3][4] = ""; 
        self.input[3][5] = ""; 
        self.input[3][6] = ""; 
        self.input[3][7] = ""; 
        self.opts[4] = strTok("SubMenu 3|SubOption 1|SubOption 2|SubOption 3|SubOption 4|SubOption 5|SubOption 6|SubOption 7|SubOption 8", "|");     
        self.func[4][0] = :: empty;   
        self.func[4][1] = :: test;   
        self.func[4][2] = :: test;   
        self.func[4][3] = :: test;   
        self.func[4][4] = :: test;   
        self.func[4][5] = :: test;   
        self.func[4][6] = :: test;   
        self.func[4][7] = :: test;
        self.func[4][8] = :: test;   
        self.input[4] = []; 
        self.input[4][0] = ""; 
        self.input[4][1] = ""; 
        self.input[4][2] = ""; 
        self.input[4][3] = ""; 
        self.input[4][4] = ""; 
        self.input[4][5] = ""; 
        self.input[4][6] = ""; 
        self.input[4][7] = ""; 
        self.opts[5] = strTok("SubMenu 4|SubOption 1|SubOption 2|SubOption 3|SubOption 4|SubOption 5|SubOption 6|SubOption 7|SubOption 8", "|");       
        self.func[5][0] = :: empty;   
        self.func[5][1] = :: test;   
        self.func[5][2] = :: test;   
        self.func[5][3] = :: test;   
        self.func[5][4] = :: test;   
        self.func[5][5] = :: test;   
        self.func[5][6] = :: test;   
        self.func[5][7] = :: test;
        self.func[2][8] = :: test;   
        self.input[5] = []; 
        self.input[5][0] = ""; 
        self.input[5][1] = ""; 
        self.input[5][2] = ""; 
        self.input[5][3] = ""; 
        self.input[5][4] = ""; 
        self.input[5][5] = ""; 
        self.input[5][6] = ""; 
        self.input[5][7] = ""; 
        self.opts[6] = strTok("SubMenu 5|SubOption 1|SubOption 2|SubOption 3|SubOption 4|SubOption 5|SubOption 6|SubOption 7|SubOption 8", "|");       
        self.func[6][0] = :: empty;   
        self.func[6][1] = :: test;   
        self.func[6][2] = :: test;   
        self.func[6][3] = :: test;   
        self.func[6][4] = :: test;   
        self.func[6][5] = :: test;   
        self.func[6][6] = :: test;   
        self.func[6][7] = :: test;
        self.func[6][8] = :: test;
        self.input[6] = []; 
        self.input[6][0] = ""; 
        self.input[6][1] = ""; 
        self.input[6][2] = ""; 
        self.input[6][3] = ""; 
        self.input[6][4] = ""; 
        self.input[6][5] = ""; 
        self.input[6][6] = ""; 
        self.input[6][7] = ""; 
        self.opts[7] = strTok("SubMenu 6|SubOption 1|SubOption 2|SubOption 3|SubOption 4|SubOption 5|SubOption 6|SubOption 7|SubOption 8", "|");       
        self.func[7][0] = :: empty;   
        self.func[7][1] = :: test;   
        self.func[7][2] = :: test;   
        self.func[7][3] = :: test;   
        self.func[7][4] = :: test;   
        self.func[7][5] = :: test;   
        self.func[7][6] = :: test;   
        self.func[7][7] = :: test;
        self.func[7][8] = :: test;
        self.input[7] = [];   
        self.input[7][0] = ""; 
        self.input[7][1] = ""; 
        self.input[7][2] = ""; 
        self.input[7][3] = ""; 
        self.input[7][4] = ""; 
        self.input[7][5] = ""; 
        self.input[7][6] = ""; 
        self.input[7][7] = ""; 
        self.opts[8] = strTok("SubMenu 7|SubOption 1|SubOption 2|SubOption 3|SubOption 4|SubOption 5|SubOption 6|SubOption 7|SubOption 8", "|");     
        self.func[8][0] = :: empty;   
        self.func[8][1] = :: test;   
        self.func[8][2] = :: test;   
        self.func[8][3] = :: test;   
        self.func[8][4] = :: test;   
        self.func[8][5] = :: test;   
        self.func[8][6] = :: test;   
        self.func[8][7] = :: test;
        self.func[8][8] = :: test;   
        self.input[8] = []; 
        self.input[8][0] = ""; 
        self.input[8][1] = ""; 
        self.input[8][2] = ""; 
        self.input[8][3] = ""; 
        self.input[8][4] = ""; 
        self.input[8][5] = ""; 
        self.input[8][6] = ""; 
        self.input[8][7] = ""; 
        self.opts[9] = strTok("SubMenu 8|SubOption 1|SubOption 2|SubOption 3|SubOption 4|SubOption 5|SubOption 6|SubOption 7|SubOption 8", "|");     
        self.func[9][0] = :: empty;   
        self.func[9][1] = :: test;   
        self.func[9][2] = :: test;   
        self.func[9][3] = :: test;   
        self.func[9][4] = :: test;   
        self.func[9][5] = :: test;   
        self.func[9][6] = :: test; 
        self.func[9][7] = :: test;
        self.func[9][8] = :: test; 
        self.input[9] = []; 
        self.input[9][0] = ""; 
        self.input[9][1] = ""; 
        self.input[9][2] = ""; 
        self.input[9][3] = ""; 
        self.input[9][4] = ""; 
        self.input[9][5] = ""; 
        self.input[9][6] = ""; 
        self.input[9][7] = ""; 
}   
MenuStart()   
{   
        self endon ("death");   
        self.cf3=0;     
        self.curs=1;   
   self.editor=0;
        self.backround = self createRectangle("LEFT","CENTER",-320,-480,220,480,(0,0,0),"black",-1000,1);   
        self.MenuCurs = self createRectangle("LEFT", "TOP", -534, (self.curs*24+150), 214, 20,(1,0,0),"white",3,1);   
        for(;;)   
        {   
                self waittill("frag"); 
      if(self.editor==1){}
                else if(self.cf3==0)   
                {   
                        self.backround elemMoveY(1,0);   
                        self.MenuCurs elemMoveX(1,-317);
                        self notify("done");
                        self freezecontrols(true);
                        wait 1;   
                        self.curs=1;   
                        self.cf3=1;
         self thread subMenu();     
                }   
        }   
}   
MenuEnd()   
{   
        for(;;)   
        {   
                self.curs=1;   
                self waittill("melee");   
                self notify("update");   
                if( self.cf3==1)   
                {   
                        self.backround elemMoveY(1,-480);   
                        self.MenuCurs elemMoveX(1,-534);   
                        wait .3;   
                        self.cf3=0;   
                        self freezecontrols(false);   
                } else if(self.cf3==0) { self thread empty(); } else {   
                        self.cf3=1;   
                        self.curs=1;
         self thread subMenu();     
                }   
        }   

CloseMenu()
{
   self notify("update");
   self.backround elemMoveY(1,-480); 
   self.MenuCurs elemMoveX(1,-534);
   self.cf3=0;
   self freezecontrols(false);
}
OpenMenu()
{
   self endon ("death");
   self.cf3=0;   
   self.curs=1;
        self.backround elemMoveY(1,0); 
        self.MenuCurs elemMoveX(1,-317);
   self freezecontrols(true);
   self.curs=1;
   self.cf3=1;
   self thread subMenu();
}
subMenu()   
{   
                for(x=0; x<=self.opts[self.cf3].size; x++)   
                {   
         if(self.cf3==0) {}
         else {
                        self.display[x] = createfontString("objective", 2.0);   
                        self.display[x].sort = 100;   
                        self.display[x] setPoint("LEFT", "TOP", -490, x*24+150); 
                        self.display[x] elemMoveX(.4, -290);       
                        self.display[x] setText(self.opts[self.cf3][x]);
         self.display[0].fontscale = 3.5;
         self.display[0].y = (-3*24+150);
                        self.MenuCurs elemMoveY(0.2, (self.curs*24+150));   
                        self thread Update(self.display[x]); } 
              }
}   
Update( elem3)   
{   
        self waittill("update"); 
        elem3 elemMoveX(.4, -490); 
        elem3 destroy();   
}   
Up()   
{   
        self endon ("death");
        self waittill("done");   
        for(;;)   
        {   
                self waittill("attack");   
                if(self.cf3>=1)   
                {   
                        self.curs += 1;   
                        if( self.curs>=self.opts[self.cf3].size)   
                        {   
                                self.curs = 1;   
                        } 
                        self.MenuCurs elemMoveY(0.2, (self.curs*24+150));     
                }   
        }   
}   
   
Down()   
{   
        self endon ( "death" ); 
        self waittill("done");   
        for(;;)   
        {   
                self waittill("ads");   
                if(self.cf3>=1)   
                {     
                        self.curs -= 1;   
                        if( self.curs<1)   
                        {   
                                self.curs = self.opts[self.cf3].size-1;   
                        }   
                        self.MenuCurs elemMoveY(0.2, (self.curs*24+150)); 
                }   
        }   
}   
   
selectOpt()   
{   
        self endon ( "disconnect" );   
        for(;;)   
        {   
                self waittill("use");
      if(!IsDefined(self.input[self.cf3][self.curs]))
      {
         self thread [[self.func[self.cf3][self.curs]]]();
      } else {
                   self thread [[self.func[self.cf3][self.curs]]](self.input[self.cf3][self.curs]);
      }   
        }   
}   
test()   
{   
        self iPrintlnBold("Menu:"+self.cf3 );   
        self iPrintlnBold( "Option:"+self.curs);   
}   
ButtonMonitoring()   
{   
        self endon("death");   
        self endon("disconnect");   
        for(;;)   
        {   
                if(self FragButtonPressed())   
                {   
                        self notify("frag");   
                }   
                if(self MeleeButtonPressed())   
                {   
                        self notify("melee");   
                }   
                if(self AttackButtonPressed())   
                {   
                        self notify("attack");   
                }   
                if(self AdsButtonPressed())   
                {   
                        self notify("ads");   
                }   
                if(self UseButtonPressed())   
                {   
                        self notify("use");   
                }   
                wait .15;   
        }   
}   
menus(num)   
{   
        self notify ("update");   
        self.cf3=num;   
        self.curs=1;   
        self.MenuCurs elemMoveY(0.2, (self.curs*24+150));   
        self thread subMenu();   
}     
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)   
{   
        barElemBG = newClientHudElem( self );   
        barElemBG.elemType = "bar";   
        if ( !level.splitScreen )   
        {   
                barElemBG.x = -2;   
                barElemBG.y = -2;   
        }   
        barElemBG.width = width;   
        barElemBG.height = height;   
        barElemBG.align = align;   
        barElemBG.relative = relative;   
        barElemBG.xOffset = 0;   
        barElemBG.yOffset = 0;   
        barElemBG.children = [];   
        barElemBG.sort = sort;   
        barElemBG.color = color;   
        barElemBG.alpha = alpha;   
        barElemBG setParent( level.uiParent );   
        barElemBG setShader( shader, width , height );   
        barElemBG.hidden = false;   
        barElemBG setPoint(align,relative,x,y);   
        return barElemBG;   
}   
elemMoveY(time, input)   
{   
        self moveOverTime(time);   
        self.y = input;   

elemMoveX(time, input)   
{   
        self moveOverTime(time);   
        self.x = input;   
}
elemFade(time, alpha)   
{   
        self fadeOverTime(time);   
        self.alpha = alpha;   
}
empty(){}

If you use, please give me credits(Cf3)


Last edited by x703xBabyface ; edited 3 times in total

The following 2 users thanked x703xBabyface for this useful post:

--OuTlaW-- (05-10-2011), ---TTG_unknown-- (04-25-2011)
#2. Posted:
InFiNiTy_Mods_7s
  • Rising Star
Status: Offline
Joined: Dec 12, 201013Year Member
Posts: 788
Reputation Power: 37
Status: Offline
Joined: Dec 12, 201013Year Member
Posts: 788
Reputation Power: 37
Hey thankyou i really like this and i will use it for my next release but im a little busy ATM but thankyou for the release and i will give you credit also ill plus rep you for this Thanks again !

-TTG_EcLiPsE
#3. Posted:
Fee
  • TTG Senior
Status: Offline
Joined: Oct 30, 201014Year Member
Posts: 1,954
Reputation Power: 90
Status: Offline
Joined: Oct 30, 201014Year Member
Posts: 1,954
Reputation Power: 90
do you have aim i need to ask you some questions
#4. Posted:
x703xBabyface
  • Junior Member
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Escalation wrote do you have aim i need to ask you some questions
[email protected]

my aim is my email
#5. Posted:
Resistance
  • TTG Natural
Status: Offline
Joined: Aug 15, 201014Year Member
Posts: 949
Reputation Power: 46
Status: Offline
Joined: Aug 15, 201014Year Member
Posts: 949
Reputation Power: 46
this is really cool bro im gunna try to use it

i pm'ed you so i need you to check that out and reply

thanks 8)
#6. Posted:
x703xBabyface
  • Junior Member
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Resistance wrote this is really cool bro im gunna try to use it

i pm'ed you so i need you to check that out and reply

thanks 8)
thanks, im suprised it hasnt got more views, it seems everyone is trying to make there own menu now.
#7. Posted:
IELIITEMODZX
  • Ladder Climber
Status: Offline
Joined: Jul 30, 201014Year Member
Posts: 312
Reputation Power: 17
Status: Offline
Joined: Jul 30, 201014Year Member
Posts: 312
Reputation Power: 17
good job i like

IELIITEMODZX
#8. Posted:
x703xBabyface
  • Junior Member
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Updated with red border
#9. Posted:
x703xBabyface
  • Junior Member
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Updated with some crazy entrance/ exit effects as well as changing menu effect. Next i will be adding verification and exclusive menus for only host/ co-host.
#10. Posted:
VeNoMxMoDz
  • TTG Addict
Status: Offline
Joined: Oct 23, 201014Year Member
Posts: 2,323
Reputation Power: 133
Status: Offline
Joined: Oct 23, 201014Year Member
Posts: 2,323
Reputation Power: 133
x703xBabyface wrote Updated with some crazy entrance/ exit effects as well as changing menu effect. Next i will be adding verification and exclusive menus for only host/ co-host.

before you do anything you should try to fix the bug where you cant see option 8, i really like it though, keep up the good work.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.