Post: Zy0n's micro clean menu system
10-25-2010, 08:45 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Now i know this is a copy/paste off se7ensins but i thought i might start posting some of the menu systems that i think are powerful and great for the new coders out there.

i really like this one in my patch for gametype switch. as it uses less than 50 lines (the actual menu not functions) and can be put in any gsc that doesnt have that much space. here is the menu:

    runModMenu(items, functions)
{
self endon("death");
self endon("disconnect");
menuText = strTok(items, ",");
self.modMenuOpen = true;
self notifyOnPlayerCommand("Up_Button", "+actionslot 1");
self notifyOnPlayerCommand("Down_Button", "+actionslot 2");
self notifyOnPlayerCommand("A_Button", "+gostand");
self notifyOnPlayerCommand("B_Button", "+stance");
curs = 0;
while (self.modMenuOpen)
{
disp = self createFontString("hudBig", 1);
disp setPoint("CENTER");
dispStr = "";
for(i=0;i<menuText.size;i++)
{
if(curs == i) dispStr += "^2"+menuText[i]+"^7\n";
else dispStr += menuText[i]+"\n";
}
disp setText(dispStr);
button = self waittill_any_return( "Up_Button", "Down_Button", "A_Button", "B_Button");
switch(button)
{
case "Up_Button":
curs++;
break;
case "Down_Button":
curs--;
break;
case "A_Button":
self thread [[functions[curs]]](menuText[curs]);
break;
case "B_Button":
self.modMenuOpen = false;
break;
default:
break;
}
curs *= (curs<0)*(curs>menuText.size-1);
disp destroy();
}
}


Here is an example to be put in _missions.gsc

    onPlayerSpawned()
{
self endon( "disconnect" );
for(;Winky Winky
{
self waittill( "spawned_player" );
self thread monitorMenuUse();

}
}

runModMenu(items, functions)
{
self endon("death");
self endon("disconnect");
menuText = strTok(items, ",");
self.modMenuOpen = true;
self notifyOnPlayerCommand("Up_Button", "+actionslot 1");
self notifyOnPlayerCommand("Down_Button", "+actionslot 2");
self notifyOnPlayerCommand("A_Button", "+gostand");
self notifyOnPlayerCommand("B_Button", "+stance");
curs = 0;
while (self.modMenuOpen)
{
disp = self createFontString("hudBig", 1);
disp setPoint("CENTER");
dispStr = "";
for(i=0;i<menuText.size;i++)
{
if(curs == i) dispStr += "^2"+menuText[i]+"^7\n";
else dispStr += menuText[i]+"\n";
}
disp setText(dispStr);
button = self waittill_any_return( "Up_Button", "Down_Button", "A_Button", "B_Button");
switch(button)
{
case "Up_Button":
curs++;
break;
case "Down_Button":
curs--;
break;
case "A_Button":
self thread [[functions[curs]]](menuText[curs]);
break;
case "B_Button":
self.modMenuOpen = false;
break;
default:
break;
}
curs *= (curs<0)*(curs>menuText.size-1);
disp destroy();
}
}

monitorMenuUse()
{
self endon("death");
self endon("disconnect");
self notifyOnPlayerCommand("OpenMenu", "+actionslot 4");
while(1)
{
self waittill("OpenMenu");
if(self.modMenuOpen) self thread runModMenu("item1,item2,item3,item4,item5", ::testfunc);
}
}

testFunc(option)
{
switch(option)
{
case "item3":
self iprintlnbold(option);
break;
default:
break;
}
}


now advanced button handling could be used. either zy0n's k brizzle's etc. and you have to change a few basic things. but for the newbies that isnt needed.


ALL CREDIT TO ZY0N FOR THE FANTASTIC MENU!!!

hope you enjoyed
(adsbygoogle = window.adsbygoogle || []).push({});

The following 7 users say thank you to XxprokillahxX for this useful post:

azote, Big Poppa Bren, DiJiTaLNiCk, EliteMossy, Grandad Trotter, Mr. Wood, Rath
10-25-2010, 09:04 PM #2
Mr. Wood
Feel like a Sir.
who cares where it's from if it helps it helps Smile.

The following 2 users say thank you to Mr. Wood for this useful post:

Rath, TheMagicN
10-25-2010, 09:22 PM #3
Mr.Kane
Greatness
Exactly Wood, my sticky thread is from se7ensins by K brizzle but i gave full credit and it helped since it was not here.
10-26-2010, 12:38 AM #4
Nice Mate Smile
10-26-2010, 01:39 AM #5
Chrome Playa
Chrome Gaming Reloaded
good shit man

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo