What's new

Mod Menu [Release] Small Menu System.

F

FR34k

Newbie
Messages
21
Reaction score
2
Benefits:
[*] Standalone menu handling (Uses RB to increase cursor, and LB to decrease, A to select, and B to exit.
[*] It's small, and only uses ONE hud element.
[*] Only allows one menu open at a time.
[*] Easy control of function threading when selection is made.

Menu Function
Code:
standardMenu(array, name, highlight){
self endon("disconnect");
self endon("standardMenu_END");

if(!self.ModMenuOpen){
self.ModMenuOpen = true;
for(disp = createFontString("default", 1);;){
if(self FragButtonPressed()) cursPos +=1;
if(self secondaryoffhandbuttonpressed()) cursPos -=1;
cursPos *= (cursPos<array.size)*(cursPos>0);
if(self UsebuttonPressed()) self notify("selection_made", name, array[cursPos]);
if(self meleebuttonpressed()){
disp destroy();
self.ModMenuOpen = false;
self notify("standardMenu_END");
}
for(i=0;i<array.size;i++){
if(i==cursPos) string += highlight+array[i]+"\n";
else string += array[i]+"\n";
wait .05;
}
disp setText(string);
wait (self FragButtonPressed()+self secondaryoffhandbuttonpressed())*.2+(self UsebuttonPressed())*.5+.05;
}		
} else self iPrintlnBold("You already have a menu open!");
}

monitorMenu_Actions(name, func){
self endon("disconnect");
self endon(name+" Menu_END");
for(;;){
self waittill(name+" menu_selection_made", select )
self thread [[func]](select);
}
}
}

Example usage:
Code:
items = strTok("Test1, Test2, Test3, Test4, Test5", ", ");
self thread standardMenu(items, "testMenu", "^3", ::testFunc);


Bonus:
Small kick menu featuring my multi-line One HUD element design.

Code:
k(){
self endon("disconnect");
disp = createFontString("default", 1);
for(c=0, inst = "^2[{+frag}] to switch [{+usereload}] to Kick \n";;){
if(self getStance() == "prone" && self FragButtonPressed())c+=1;
c *= (c<level.players.size);
if(self getStance() == "prone"){
for(i=0;i<level.players.size;i++){
if(i==c) string += "^2" + level.players[i].name+"\n";
else string += level.players[i].name+"\n";
wait .05;
}
disp setText(string + inst);
}
if(self getStance() == "prone" && self UsebuttonPressed()) kick( level.players[c] getEntityNumber());
wait (self FragButtonPressed())*.2+(self UsebuttonPressed())*.5+.05;
}
}
 
SnD Scrub

SnD Scrub

The Warez kings humble Protégé
Messages
3,035
Reaction score
412
nice
 
Bballchace

Bballchace

Enthusiast
Messages
152
Reaction score
33
Kind of looks like zy0n's to me.... but good work though.
 
Dazee

Dazee

The World Is Yours
Fabled Veteran Bright Idea Grammar Nazi
Messages
6,969
Reaction score
3,077
Thx.

Thx.

Thx.
 
Top Bottom