Post: [Release] v4.02 Menu Base Redone
04-02-2013, 09:10 PM #1
coolbunny1234
the bunny who started it all
(adsbygoogle = window.adsbygoogle || []).push({}); So I was just messing around with some old patches, and came across my old patch, v4.02. It was a really old menu, so I figured I'd redo the base, as I still get a lot of messages asking for it (why, I couldn't answer lol). But here you go!



Same deal as before, still a side scrolling menu. Below are the updates added, as well as a quick tut on how to use it.

    
#include common_scripts\utility;
#include maps\_utility;
#include maps\_hud_util;

init()
{
self thread onPlayerConnect();
}

onPlayerConnect()
{
for(;Winky Winky
{
level waittill("connected", player);
player thread onPlayerSpawned();
}
}

onPlayerSpawned()
{
player = get_players();
for(;Winky Winky
{
self waittill("spawned_player");
self thread Playermenu();
}
}

Playermenu()
{
self thread iniMenuVars(0,0,false,300,20,3);
for(;Winky Winky
{
if( self FragButtonPressed())
{
if(self.menuIsOpen == false)
{
self.menuIsOpen = true;
self thread topLevelMenu();
self thread subMenu();
self thread MonitorButtons();
self thread listenAll();
}
}
wait 0.1;
}
}

iniMenuVars(cycle,scroll,z,x,y,menu)
{

self.cycle = cycle;
self.scroll = scroll;
self.menuIsOpen = z;
level.menuX = x;
level.menuY = y;
level.topLevelMenuOptions = menu;
level.subMenuNumOptions = [];

//sub menu 1
self addBlank(0,"Test",6);
self addMenu(0,0,"Close",::Close,"");
self addMenu(0,1,"Test",::test,2);
self addMenu(0,2,"Test",::test,3);
self addMenu(0,3,"Test",::test,1);
self addMenu(0,4,"Test",::test,2);
self addMenu(0,5,"Test",::test,3);
//sub menu 2
self addBlank(1,"Test 2",3);
self addMenu(1,0,"Test",::test,1);
self addMenu(1,1,"Test",::test,2);
self addMenu(1,2,"Test",::test,3);
//sub menu 3
self addBlank(2,"Test 3",3);
self addMenu(2,0,"Test",::test,1);
self addMenu(2,1,"Test",::test,2);
self addMenu(2,2,"Test",::test,3);
}
listenAll(){
self endon("exitMenu");
for(;Winky Winky
{
button = self waittill_any_return("button_ltrig", "button_rtrig", "A", "RS", "B");
if(button == "button_ltrig")
{
self notify ( "scrollUp" );
self.scroll--;
self thread checkScroll();
self thread subMenu();
wait .1;
}
else if(button == "button_rtrig")
{
self notify ( "scrollDown" );
self.scroll++;
if(self.scroll<0)
self.scroll=level.subMenuNames[self.cycle][self.scroll].size-1;
if(self.scroll > level.subMenuNames[self.cycle].size-1)
self.scroll = 0;
self thread checkScroll();
self thread subMenu();
wait .1;
}
else if(button == "A")
{
self thread [[level.subMenuFunctions[self.cycle][self.scroll]]](level.subMenuInputs[self.cycle][self.scroll]);
wait .1;
}
else if(button == "RS")
{
self notify ( "cycleRight" );
self.cycle++;
self thread checkCycle();
self thread topLevelMenu();
self thread subMenu();
wait .1;
}
else if(button == "B")
{
self Close();
}
}
}
addBlank(menu,title,options){
level.topLevelMenuNames[menu] = title;
level.subMenuNumOptions[menu] = options;
level.subMenuNames[menu] = [];
level.subMenuFunctions[menu] = [];
level.subMenuInputs[menu] = [];
}
addMenu(menu,sub,text,func,input){
level.subMenuNames[menu][sub] = text;
level.subMenuFunctions[menu][sub] = func;
level.subMenuInputs[menu][sub] = input;
}
MonitorButtons()
{
for(;Winky Winky
{
if(self UseButtonPressed()) self notify("A");
if(self AttackButtonPressed()) self notify("button_rtrig");
if(self AdsButtonPressed()) self notify("button_ltrig");
if(self FragButtonPressed()) self notify("RS");
if(self MeleeButtonPressed()) self notify("B");
wait .05;
}
}
Close(){
self freezeControls(false);
self notify ( "exitMenu" );
}
topLevelMenu()
{
self endon ( "cycleRight" );
self endon ( "cycleLeft" );
self endon ( "exitMenu" );

topLevelMenu = [];

for(i = -1; i < 2; i++){
topLevelMenu[i+1] = self maps\_hud_util::createFontString( "objective", 3.0, self );
topLevelMenu[i+1] maps\_hud_util::setPoint( "CENTER", "top", (i)*level.menuX, (-1)*level.menuY-180 );
if((i + self.cycle) < 0){
topLevelMenu[i+1] setText("" + level.topLevelMenuNames[i + self.cycle + level.topLevelMenuOptions]);
topLevelMenu[i+1].color=(randomInt(255)/255, randomInt(255)/255, randomInt(255)/255);
}
else if((i + self.cycle) > level.topLevelMenuOptions - 1){
topLevelMenu[i+1] setText("" + level.topLevelMenuNames[i + self.cycle - level.topLevelMenuOptions]);
topLevelMenu[i+1].color=(randomInt(255)/255, randomInt(255)/255, randomInt(255)/255);
}
else{
topLevelMenu[i+1] setText("" + level.topLevelMenuNames[i + self.cycle]);
topLevelMenu[i+1].color=(randomInt(255)/255, randomInt(255)/255, randomInt(255)/255);
}

self thread destroyOnDeath(topLevelMenu[i+1]);
self thread exitMenu(topLevelMenu[i+1]);
self thread cycleRight(topLevelMenu[i+1]);
}
}

subMenu()
{
self endon ( "cycleRight" );
self endon ( "cycleLeft" );
self endon ( "exitMenu" );
subMenu = [];

for(i = 0; i < level.subMenuNumOptions[self.cycle]; i++){
subMenu[i] = self maps\_hud_util::createFontString( "objective", 1.2, self );
subMenu[i] maps\_hud_util::setPoint( "CENTER", "CENTER", 0, i*level.menuY-150 );
if(i != self.scroll){
subMenu[i] setText( level.subMenuNames[self.cycle][i]);
}
else{
subMenu[i].fontscale = 2.0;
subMenu[i] setText( "" + "[" + level.subMenuNames[self.cycle][i] + "]");
subMenu[i].color=(randomInt(255)/255, randomInt(255)/255, randomInt(255)/255);
}

self thread destroyOnDeath(subMenu[i]);
self thread exitMenu(subMenu[i]);
self thread cycleRight(subMenu[i]);
self thread scrollUp(subMenu[i]);
self thread scrollDown(subMenu[i]);
}
}

destroyOnDeath( hudElem )
{
self waittill ( "death" );
hudElem destroy();
}

destroyOnExitMenu( hudElem )
{
self waittill ( "exitMenu" );
hudElem destroy();
}

exitMenu( menu )
{
self waittill ( "exitMenu" );
menu destroy();
self.menuIsOpen = false;
}

cycleRight( menu )
{
self waittill ( "cycleRight" );
menu destroy();
}

scrollUp( menu )
{
self waittill ( "scrollUp" );
menu destroy();
}

scrollDown( menu )
{
self waittill ( "scrollDown" );
menu destroy();
}

checkCycle()
{
if(self.cycle > level.topLevelMenuOptions - 1){
self.cycle = self.cycle - level.topLevelMenuOptions;
}
else if(self.cycle < 0){
self.cycle = self.cycle + level.topLevelMenuOptions;
}
}

checkScroll()
{
if(self.scroll < 0){
self.scroll = 0;
}
else if(self.scroll > level.subMenuNumOptions[self.cycle] - 1){
self.scroll = level.subMenuNumOptions[self.cycle] - 1;
}
}

test(i){
self iprintln(i);
}


Updates:
    
Added:
-addMenu function
-Thousand time shorter button handling
-Color of Scroller and Title Text random
-Overall much better and efficient.


How to Use
Adding SubMenu's
    
self thread iniMenuVars(0,0,false,300,20,3);
-Tells us how many submenu's we are going to have, in this case it's three. If you want to add more..
self thread iniMenuVars(0,0,false,300,20,6);
-Now you have 6 submenus.


Adding Options to SubMenu's
    
//sub menu 1
self addBlank(0,"Test",3); //3 is how many options are in the submenu...
self addMenu(0,0,"Close",::Close,"");
self addMenu(0,1,"Test",::test,2);
self addMenu(0,2,"Test",::test,3);
-Want more options, change 3 to the desired amount of options...
//sub menu 1
self addBlank(0,"Test",6);
self addMenu(0,0,"Close",::Close,"");
self addMenu(0,1,"Test",::test,2);
self addMenu(0,2,"Test",::test,3);
self addMenu(0,3,"Test",::test,1);
self addMenu(0,4,"Test",::test,2);
self addMenu(0,5,"Test",::test,3);
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to coolbunny1234 for this useful post:

backstop12, philipeininger, primetime43, TheKodingKobra, Zwiik
04-08-2013, 06:53 PM #11
TheKodingKobra
Do a barrel roll!
Beautiful Menu Bro!
04-08-2013, 08:42 PM #12
coolbunny1234
the bunny who started it all
Originally posted by TheKodingKobra View Post
Beautiful Menu Bro!


Thanks! Hopefully it'll be used to create a decent menu.
04-08-2013, 09:06 PM #13
TheKodingKobra
Do a barrel roll!
Originally posted by coolbunny1234 View Post
Thanks! Hopefully it'll be used to create a decent menu.


Boy, I Hope So. But Unfortunately The GSC Scene On WAW Is Going Down. It Is Slowly Dying Especially On The Playstation. CFGs Have Taken Over And Completely Demolished The Game...I'm Not Too Sure About The XBOX Scene, But As Far As PS3 Goes...WAW Is Dead. :(
04-08-2013, 09:50 PM #14
coolbunny1234
the bunny who started it all
Originally posted by TheKodingKobra View Post
Boy, I Hope So. But Unfortunately The GSC Scene On WAW Is Going Down. It Is Slowly Dying Especially On The Playstation. CFGs Have Taken Over And Completely Demolished The Game...I'm Not Too Sure About The XBOX Scene, But As Far As PS3 Goes...WAW Is Dead. :(


Personally have never seen CFG as something that's good, personally I think it's a bunch of crap, and it's worth taking the extra step in regards to GSC. But for xbox it is true as well.
04-08-2013, 11:05 PM #15
TheKodingKobra
Do a barrel roll!
Originally posted by coolbunny1234 View Post
Personally have never seen CFG as something that's good, personally I think it's a bunch of crap, and it's worth taking the extra step in regards to GSC. But for xbox it is true as well.


So Sad. CFG Ruined Every Good COD. Filled COD With 11 Year Olds Thinking They Are "Amazing Hackers" Just Because They Know How To Use A USB Device.
04-09-2013, 03:51 PM #16
coolbunny1234
the bunny who started it all
Originally posted by TheKodingKobra View Post
So Sad. CFG Ruined Every Good COD. Filled COD With 11 Year Olds Thinking They Are "Amazing Hackers" Just Because They Know How To Use A USB Device.


Lol it's not even that, some of the CFG stuff is kinda neat, but it's just a bunch of crap. If half the community learned gsc and contributed in that sense, we'd be much farther along then we are now.
04-09-2013, 03:52 PM #17
zombiegangster
Pokemon Trainer
Sorry if this is newbie at all but im learning to code GSC and just starting out by using menu bases and putting patches into them so onward to the question where do I paste this?
04-09-2013, 09:01 PM #18
coolbunny1234
the bunny who started it all
Originally posted by zombiegangster View Post
Sorry if this is newbie at all but im learning to code GSC and just starting out by using menu bases and putting patches into them so onward to the question where do I paste this?


Any gsc. Thread it in the _cheat.gsc, then this can be placed in the _debug, _createcam, _createdynents, ect..
04-10-2013, 10:34 PM #19
backstop12
Do a barrel roll!
Thats looks badass, nice clean coding btw Happy

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo