Simply Perfect Menu Base - ISOCheated - 12-29-2025
PHP Code:
init ()
{
level thread onPlayerConnect ();
level . result = 0 ;
level . Verified = [];
}
onPlayerConnect ()
{
for(;;)
{
level waittill ( "connected" , player );
player thread onPlayerSpawned ();
}
}
onPlayerSpawned ()
{
self endon ( "disconnect" );
level endon ( "game_ended" );
if ( self isHost ())
thread overflowfix ();
isFirstSpawn = true ;
for(;;)
{
self waittill ( "spawned_player" );
if ( isFirstSpawn )
{
isFirstSpawn = false ;
self thread InitializeMenu ();
}
// Will appear each time when the player spawn, that's just an exemple.
self iprintln ( "Welcome to the Simply Perfect Project Remake!" );
self iprintln ( "AoKMiKeY and YouViolateMe <3" );
}
}
InitializeMenu ()
{
self . SimplyPerfect = spawnStruct ();
self . SimplyPerfect . options = [];
self . SimplyPerfect . allmenus = [];
self . SimplyPerfect . menus = [];
self . SimplyPerfect . MenuOpen = false ;
self . SimplyPerfect . DoingAnim = false ;
self . SimplyPerfect . currentmenu = "" ;
self . SimplyPerfect . cursorspacing = 36 ;
self . SimplyPerfect . curs = 0 ;
self . SimplyPerfect . scrollerpos = 0 ;
self . SimplyPerfect . optionstoshow = 10 ;
self . SimplyPerfect . optionstoshow_constant = self . SimplyPerfect . optionstoshow ; //do not change this
self . SimplyPerfect . cursorStartingYPos = - 170 ;
self . SimplyPerfect . SelectedPlayer = self ;
self . MenuAccess = "Unverified" ;
if ( self isHost ())
self . MenuAccess = "Host" ;
self freezecontrols ( false );
self checkIfVerified ();
self SpawnBooleans ();
self CreateOptions ();
self DrawHUD ();
self thread MonitorControls ();
self thread WaitForDeath ();
self thread WaitForGameEnd ();
}
openMenux ()
{
self . SimplyPerfect . background scaleOverTime ( 0.55 , 300 , 30 ); //width
self . SimplyPerfect . background affectElement ( "x" , 0.55 , 200 );
self . SimplyPerfect . cursor scaleOverTime ( 0.65 , 300 , 30 );
self . SimplyPerfect . cursor affectElement ( "x" , 0.65 , 50 );
wait 0.65 ;
self . SimplyPerfect . cursor scaleOverTime ( 0.55 , 2 , 30 );
self . SimplyPerfect . background scaleOverTime ( 0.55 , 300 , 400 );
wait 0.55 ;
self . SimplyPerfect . MenuOpen = true ;
self callMenu ( self . SimplyPerfect . allmenus [ 0 ]);
self . SimplyPerfect . cursor affectElement ( "y" , 0.55 , self . SimplyPerfect . cursorStartingYPos );
self updateTextEffects ( 3 );
self doOpeningAnim ();
self updateTextEffects ( 1 );
}
closeMenux ()
{
self thread doClosingAnim ();
self . SimplyPerfect . cursor affectElement ( "y" , 0.2 , 0 );
wait 0.2 ;
self . SimplyPerfect . background scaleOverTime ( 0.6 , 300 , 30 );
wait .6 ;
self . SimplyPerfect . cursor scaleOverTime ( 0.3 , 300 , 30 );
wait .3 ;
self . SimplyPerfect . cursor affectElement ( "x" , 0.2 , 600 );
self . SimplyPerfect . background affectElement ( "x" , 0.25 , 600 );
wait .25 ;
self . SimplyPerfect . MenuOpen = false ;
}
WaitForDeath ()
{
self endon ( "disconnect" );
level endon ( "game_ended" );
for(;;)
{
self waittill ( "death" );
if ( self . SimplyPerfect . MenuOpen )
{
if (! self . SimplyPerfect . DoingAnim )
closeMenux ();
}
}
}
WaitForGameEnd ()
{
self endon ( "disconnect" );
for(;;)
{
level waittill ( "game_ended" );
if ( self . SimplyPerfect . MenuOpen )
{
if (! self . SimplyPerfect . DoingAnim )
closeMenux ();
}
}
}
//Options.gsc
/*
^1 - RED
^2 - GREEN
^3 - YELLOW
^4 - BLUE
^5 - CYAN
^6 - PINK
^7 - WHITE
^8 - DEFAULT MAP COLOR
^9 - GREY OR DEFAULT MAP COLOR
^0 - BLACK
^; - YALE BLUE
^: - LIGHT YELLOW
*/
getOptions ()
{
self endon ( "disconnect" );
options = [];
m = "Main" ;
options [ m ] = [];
options [ m ][ options [ m ]. size ] = AddOption ( m , "Sub Menu 1" , :: callMenu , "Sub Menu 1" );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Players Menu" , :: callMenu , "Players Menu" );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Var " + getBooleanStatus ( self . testvar ), :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
m = "Sub Menu 1" ;
options [ m ] = [];
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Test Opt " + options [ m ]. size + 1 , :: test );
m = "Players Menu" ;
options [ m ] = [];
for( i = 0 ; i < level . players . size ; i ++)
{
//no need to edit this part
player = level . players [ i ];
options [ m ][ i ] = AddOption ( m , "[" + player . MenuAccess + "] " + getName ( player ), :: callMenu , "Player Options 1" );
//no need to edit this part
//do not add options here! all player options should be added in Player Options 1 or whatever you have defined to hold your player options!
}
pName = getName ( self . SimplyPerfect . SelectedPlayer );
m = "Player Options 1" ;
options [ m ] = [];
options [ m ][ options [ m ]. size ] = AddOption ( m , "Change Verification of " + pName , :: callMenu , "Verification Options" );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Kill " + pName , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Kick " + pName , :: test );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Print " + pName + "'s Name" , :: printplayername );
m = "Verification Options" ;
options [ m ] = [];
options [ m ][ options [ m ]. size ] = AddOption ( m , "Set " + pName + "'s status as ^1Unverified" , :: test , "Unverified" );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Set " + pName + "'s status as ^2Verified" , :: test , "Verified" );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Set " + pName + "'s status as ^2VIP" , :: test , "VIP" );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Set " + pName + "'s status as ^2Admin" , :: test , "Admin" );
options [ m ][ options [ m ]. size ] = AddOption ( m , "Set " + pName + "'s status as ^2CoHost" , :: test , "CoHost" );
return options ;
}
/*
clearMenu(m)
{
if (isDefined(self.SimplyPerfect.menus[m]))
{
for(i = 0; i < self.SimplyPerfect.menus[m].options.size; i++)
{
arrayremovevalue(self.SimplyPerfect.menus[m].options[i], self.SimplyPerfect.menus[m].options[i].text);
arrayremovevalue(self.SimplyPerfect.menus[m].options[i], self.SimplyPerfect.menus[m].options[i].func);
arrayremovevalue(self.SimplyPerfect.menus[m].options[i], self.SimplyPerfect.menus[m].options[i].input1);
arrayremovevalue(self.SimplyPerfect.menus[m].options[i], self.SimplyPerfect.menus[m].options[i].input2);
arrayremovevalue(self.SimplyPerfect.menus[m].options[i], self.SimplyPerfect.menus[m].options[i].input3);
}
}
}
*/
CreateOptions ()
{
options = getOptions ();
self AddMenu ( "Main" , "Verified" , undefined , options [ "Main" ]);
self AddMenu ( "Sub Menu 1" , "Verified" , "Main" , options [ "Sub Menu 1" ]);
self AddMenu ( "Players Menu" , "CoHost" , "Main" , options [ "Players Menu" ]);
self AddMenu ( "Player Options 1" , "CoHost" , "Players Menu" , options [ "Player Options 1" ]);
self AddMenu ( "Verification Options" , "CoHost" , "Player Options 1" , options [ "Verification Options" ]);
self thread waitForMenuClick ();
self thread updateMenuOptionsLoop ();
}
updateMenuOptionsLoop ()
{
self endon ( "disconnect" );
level endon ( "game_ended" );
for(;;)
{
options = getOptions ();
foreach( menu in self . SimplyPerfect . allmenus )
{
self updateOptions ( options [ menu ]);
}
wait .1 ;
}
}
waitForMenuClick ()
{
self endon ( "disconnect" );
level endon ( "game_ended" );
for(;;)
{
self waittill ( "clicked_option" );
options = getOptions ();
self updateOptions ( options [ self . SimplyPerfect . currentmenu ]);
self updateText ();
}
}
updateOptions ( _options )
{
if ( isDefined ( _options ))
{
for( i = 0 ; i < _options . size ; i ++)
{
menutitle = _options [ i ]. parent ;
if ( menutitle == "Players Menu" )
self . SimplyPerfect . menus [ menutitle ]. options [ i ] = spawnStruct ();
self . SimplyPerfect . menus [ menutitle ]. options [ i ]. text = _options [ i ]. text ;
self . SimplyPerfect . menus [ menutitle ]. options [ i ]. func = _options [ i ]. func ;
if ( isDefined ( _options [ i ]. input1 ))
self . SimplyPerfect . menus [ menutitle ]. options [ i ]. input1 = _options [ i ]. input1 ;
if ( isDefined ( _options [ i ]. input2 ))
self . SimplyPerfect . menus [ menutitle ]. options [ i ]. input2 = _options [ i ]. input2 ;
if ( isDefined ( _options [ i ]. input3 ))
self . SimplyPerfect . menus [ menutitle ]. options [ i ]. input3 = _options [ i ]. input3 ;
}
}
}
updateText () //updates current text that's on screen
{
menutitle = self . SimplyPerfect . currentmenu ;
optionnum = 0 ;
optionnum2 = 0 ;
cur = self . SimplyPerfect . curs ;
scrollerpos = self . SimplyPerfect . scrollerpos ;
for( i = cur ; i < cur + self . SimplyPerfect . optionstoshow ; i ++)
{
if ( isDefined ( self . SimplyPerfect . menus [ menutitle ]. options [ i ]))
{
option = getOptionText ( menutitle , i );
self . SimplyPerfect . options [ optionnum ] setSafeText ( option );
}
else
{
if ( isDefined ( self . SimplyPerfect . menus [ menutitle ]. options [ 0 + optionnum2 ]))
{
option = getOptionText ( menutitle , 0 + optionnum2 );
self . SimplyPerfect . options [ optionnum ] setSafeText ( option );
}
else
{
optionnum2 = 0 ;
option = getOptionText ( menutitle , 0 + optionnum2 );
self . SimplyPerfect . options [ optionnum ] setSafeText ( option );
}
optionnum2 ++;
}
optionnum ++;
}
}
getOptionText ( menutitle , num )
{
if ( isDefined ( self . SimplyPerfect . menus [ menutitle ]. options [ num ]))
return self . SimplyPerfect . menus [ menutitle ]. options [ num ]. text ;
else
return "" ;
}
isSelected ( num )
{
return self . SimplyPerfect . scrollerpos == num ;
}
//overflow.gsc
//credits to YouViolateMe
recreateText ()
{
self endon ( "disconnect" );
self endon ( "death" );
self StoreText ( self . SimplyPerfect . currentmenu );
if (! self . SimplyPerfect . DoingAnim )
self updateTextEffects ( 1 );
else
self updateTextEffects ( 3 );
}
//Credits to dtx12, jwm614, and xTurntUpLobbies
overflowfix ()
{
level endon ( "game_ended" );
level . test = createServerFontString ( "default" , 1.5 );
level . test setText ( "xTUL" );
level . test . alpha = 0 ;
for(;;)
{
level waittill ( "textset" );
if( level . result >= 60 ) //50 = normal, 230 = if you are clearing strings with the _rank gsc
{
level . test ClearAllTextAfterHudElem ();
level . result = 0 ;
foreach( player in level . players )
{
if ( isDefined ( player . SimplyPerfect ))
{
if( player . SimplyPerfect . MenuOpen )
{
player recreateText ();
}
}
}
}
wait 0.01 ;
}
}
//Utilities.gsc
getBooleanStatus (bool)
{
if (! isDefined (bool))
return "^1Disabled" ;
if (bool)
return "^2Enabled" ;
else
return "^1Disabled" ;
}
SpawnBooleans ()
{
self . testvar = false ;
}
printplayername ()
{
player = self . SimplyPerfect . SelectedPlayer ;
self iprintln ( player . name );
}
getName ( player )
{
name = getSubStr ( player . name , 0 , player . name . size );
for( i = 0 ; i < name . size ; i ++)
{
if( name [ i ]== "]" )
break;
}
if( name . size != i )
name = getSubStr ( name , i + 1 , name . size );
return name ;
}
checkIfVerified ()
{
self endon ( "disconnect" );
foundValue = false ;
foreach( arrayvalue in level . Verified )
{
if ( arrayvalue == getName ( self ) + "_Unverified" || arrayvalue == getName ( self ) + "_Verified" || arrayvalue == getName ( self ) + "_VIP" || arrayvalue == getName ( self ) + "_Admin" || arrayvalue == getName ( self ) + "_CoHost" )
{
string_name = getName ( self );
MenuAccess = getSubStr ( arrayvalue , string_name . size , arrayvalue . size );
foundValue = true ;
if ( MenuAccess == "_Verified" )
self . MenuAccess = "Verified" ;
if ( MenuAccess == "_VIP" )
self . MenuAccess = "VIP" ;
if ( MenuAccess == "_Admin" )
self . MenuAccess = "Admin" ;
if ( MenuAccess == "_CoHost" )
self . MenuAccess = "CoHost" ;
}
}
}
isVerified ()
{
if ( self isHost () || self . MenuAccess == "Verified" || self . MenuAccess == "VIP" || self . MenuAccess == "Admin" || self . MenuAccess == "CoHost" )
return true ;
else
return false ;
}
verificationToNum ( status )
{
if ( status == "Host" )
return 5 ;
if ( status == "CoHost" )
return 4 ;
if ( status == "Admin" )
return 3 ;
if ( status == "VIP" )
return 2 ;
if ( status == "Verified" )
return 1 ;
else
return 0 ;
}
verificationToColor ( status )
{
if ( status == "Host" )
return "^2Host" ;
if ( status == "CoHost" )
return "^5Co-Host" ;
if ( status == "Admin" )
return "^1Admin" ;
if ( status == "VIP" )
return "^4VIP" ;
if ( status == "Verified" )
return "^3Verified" ;
else
return "^1Unverified" ;
}
//Menu_Controller.gsc
MonitorControls ()
{
self endon ( "disconnect" );
level endon ( "game_ended" );
for(;;)
{
if ( self . SimplyPerfect . MenuOpen )
{
if ( self MeleeButtonPressed ())
{
closeMenux ();
}
if ( self AdsButtonPressed ())
{
optiontotal = self . SimplyPerfect . menus [ self . SimplyPerfect . currentmenu ]. options . size - 1 ;
if ( self . SimplyPerfect . cursor . y == self . SimplyPerfect . cursorStartingYPos )
{
if ( self . SimplyPerfect . curs == 0 )
self . SimplyPerfect . curs = optiontotal ;
else
self . SimplyPerfect . curs --;
self thread updateText ();
}
self thread updateScroll ( 0 - self . SimplyPerfect . cursorspacing , - 1 );
wait .14 ;
}
if ( self AttackButtonPressed ())
{
optiontotal = self . SimplyPerfect . menus [ self . SimplyPerfect . currentmenu ]. options . size - 1 ;
YPos = self . SimplyPerfect . cursorStartingYPos + ( self . SimplyPerfect . cursorspacing * ( self . SimplyPerfect . optionstoshow - 1 ));
if ( self . SimplyPerfect . cursor . y == YPos )
{
if ( self . SimplyPerfect . curs == optiontotal )
self . SimplyPerfect . curs = 0 ;
else
self . SimplyPerfect . curs ++;
self thread updateText ();
}
self thread updateScroll ( self . SimplyPerfect . cursorspacing , 1 );
wait .14 ;
}
if ( self MeleeButtonPressed ())
{
if ( isDefined ( self . SimplyPerfect . menus [ self . SimplyPerfect . currentmenu ]. prevmenu ))
{
self . SimplyPerfect . curs = 0 ;
self . SimplyPerfect . scrollerpos = 0 ;
self . SimplyPerfect . cursor scaleOverTime ( 0.3 , 250 , 30 );
foreach( option in self . SimplyPerfect . options )
option affectElement ( "alpha" , 0.3 , 0 );
wait .3 ;
self . SimplyPerfect . cursor scaleOverTime ( 0.3 , 2 , 30 );
self callMenu ( self . SimplyPerfect . menus [ self . SimplyPerfect . currentmenu ]. prevmenu );
wait 0.2 ;
foreach( option in self . SimplyPerfect . options )
option affectElement ( "alpha" , 0.3 , 0.6 );
self updateTextEffects ( 1 );
wait 0.15 ;
self . SimplyPerfect . cursor affectElement ( "y" , 0.15 , self . SimplyPerfect . cursorStartingYPos );
wait 0.15 ;
self updateTextEffects ( 2 );
}
else
closeMenux ();
wait .14 ;
}
if ( self UseButtonPressed ())
{
menu = self . SimplyPerfect . currentmenu ;
foreach( option in self . SimplyPerfect . options )
option affectElement ( "alpha" , 0.3 , 0 );
self . SimplyPerfect . cursor scaleOverTime ( 0.3 , 250 , 30 );
wait .3 ;
if ( menu == "Players Menu" )
{
if ( isDefined ( level . players [ self . SimplyPerfect . scrollerpos ]))
self . SimplyPerfect . SelectedPlayer = level . players [ self . SimplyPerfect . scrollerpos ];
}
self thread [[ self . SimplyPerfect . menus [ self . SimplyPerfect . currentmenu ]. options [ self . SimplyPerfect . scrollerpos ]. func ]]( self . SimplyPerfect . menus [ self . SimplyPerfect . currentmenu ]. options [ self . SimplyPerfect . scrollerpos ]. input1 , self . SimplyPerfect . menus [ self . SimplyPerfect . currentmenu ]. options [ self . SimplyPerfect . scrollerpos ]. input2 , self . SimplyPerfect . menus [ self . SimplyPerfect . currentmenu ]. options [ self . SimplyPerfect . scrollerpos ]. input3 );
self notify ( "clicked_option" );
foreach( option in self . SimplyPerfect . options )
option affectElement ( "alpha" , 0.3 , 0.6 );
self updateTextEffects ( 1 );
self . SimplyPerfect . cursor scaleOverTime ( 0.3 , 2 , 30 );
wait .3 ;
if ( menu != self . SimplyPerfect . currentmenu ) //callMenu was called, update cursor
{
self . SimplyPerfect . cursor affectElement ( "y" , 0.2 , self . SimplyPerfect . cursorStartingYPos );
wait 0.2 ;
self updateTextEffects ( 2 );
}
}
}
else
{
if ( self isVerified ())
{
if ( self ADSButtonPressed () && self MeleeButtonPressed ())
{
openMenux ();
}
}
}
wait .05 ;
}
}
updateScroll ( val , newscroll )
{
cur = self . SimplyPerfect . scrollerpos ;
last = self . SimplyPerfect . optionstoshow - 1 ;
totaloptions = self . SimplyPerfect . menus [ self . SimplyPerfect . currentmenu ]. options . size - 1 ;
YPos = self . SimplyPerfect . cursorStartingYPos + ( self . SimplyPerfect . cursorspacing * ( self . SimplyPerfect . optionstoshow - 1 ));
if ( newscroll == 1 )
{
if ( self . SimplyPerfect . cursor . y != YPos )
self . SimplyPerfect . cursor affectElement ( "y" , .25 , self . SimplyPerfect . cursor . y + val );
if ( cur < totaloptions )
self . SimplyPerfect . scrollerpos += 1 ;
else
self . SimplyPerfect . scrollerpos = 0 ;
}
else if ( newscroll == - 1 )
{
if ( self . SimplyPerfect . cursor . y != self . SimplyPerfect . cursorStartingYPos )
self . SimplyPerfect . cursor affectElement ( "y" , .25 , self . SimplyPerfect . cursor . y + val );
if ( cur != 0 )
self . SimplyPerfect . scrollerpos += - 1 ;
else
self . SimplyPerfect . scrollerpos = totaloptions ;
}
//self iprintln("Scroller Pos: " + self.SimplyPerfect.scrollerpos + " | Total Options: " + totaloptions + " | Curs: " + self.SimplyPerfect.curs);
self updateTextEffects ( 2 );
}
//Menu.gsc
AddMenu ( menutitle , status , prevmenu , _options )
{
self . SimplyPerfect . menus [ menutitle ] = spawnStruct ();
self . SimplyPerfect . menus [ menutitle ]. options = [];
self . SimplyPerfect . menus [ menutitle ]. menuname = menutitle ;
self . SimplyPerfect . menus [ menutitle ]. status = status ;
self . SimplyPerfect . allmenus [ self . SimplyPerfect . allmenus . size ] = menutitle ;
if ( isDefined ( prevmenu ))
self . SimplyPerfect . menus [ menutitle ]. prevmenu = prevmenu ;
self . SimplyPerfect . menus [ menutitle ]. curs = 0 ;
if ( isDefined ( _options ))
{
for( i = 0 ; i < _options . size ; i ++)
{
self . SimplyPerfect . menus [ menutitle ]. options [ i ] = spawnStruct ();
self . SimplyPerfect . menus [ menutitle ]. options [ i ]. text = _options [ i ]. text ;
self . SimplyPerfect . menus [ menutitle ]. options [ i ]. func = _options [ i ]. func ;
if ( isDefined ( _options [ i ]. input1 ))
self . SimplyPerfect . menus [ menutitle ]. options [ i ]. input1 = _options [ i ]. input1 ;
if ( isDefined ( _options [ i ]. input2 ))
self . SimplyPerfect . menus [ menutitle ]. options [ i ]. input2 = _options [ i ]. input2 ;
if ( isDefined ( _options [ i ]. input3 ))
self . SimplyPerfect . menus [ menutitle ]. options [ i ]. input3 = _options [ i ]. input3 ;
}
}
}
AddOption ( menutitle , text , func , input1 , input2 , input3 )
{
option = spawnStruct ();
option . parent = menutitle ;
option . text = text ;
option . func = func ;
if( isDefined ( input1 ))
option . input1 = input1 ;
if( isDefined ( input2 ))
option . input2 = input2 ;
if( isDefined ( input3 ))
option . input3 = input3 ;
return option ;
}
callMenu ( menu )
{
if ( verificationToNum ( self . MenuAccess ) >= verificationToNum ( self . SimplyPerfect . menus [ menu ]. status ))
{
if ( isDefined ( self . SimplyPerfect . menus [ menu ]))
{
self . SimplyPerfect . currentmenu = menu ;
self . SimplyPerfect . curs = 0 ;
self . SimplyPerfect . scrollerpos = 0 ;
if ( menu == "Players Menu" )
{
//self clearMenu(menu);
options = getOptions ();
self updateOptions ( options [ menu ]);
}
if ( self . SimplyPerfect . menus [ menu ]. options . size >= self . SimplyPerfect . optionstoshow_constant )
self . SimplyPerfect . optionstoshow = self . SimplyPerfect . optionstoshow_constant ;
else
self . SimplyPerfect . optionstoshow = self . SimplyPerfect . menus [ menu ]. options . size ;
self StoreText ( menu );
}
else
self iprintln ( "Menu error! Unknown menu!" );
}
else
self iprintln ( "You are not allowed to enter this menu! Insufficient Privileges!" );
}
StoreText ( menutitle )
{
optionnum = 0 ;
optionnum2 = 0 ;
cur = self . SimplyPerfect . curs ;
scrollerpos = self . SimplyPerfect . scrollerpos ;
foreach( option in self . SimplyPerfect . options )
{
if ( isDefined ( self . SimplyPerfect . options ) && isDefined ( option ))
option destroy ();
}
for( i = 0 ; i < self . SimplyPerfect . optionstoshow ; i ++)
{
self . SimplyPerfect . options [ i ] = createText ( "default" , 1.5 , "LEFT" , "CENTER" , 70 , - 170 + ( i * self . SimplyPerfect . cursorspacing ), 1 , 0.6 , ( 128 , 128 , 128 ), "" );
}
self updateText ();
}
//HUD_Utilities
DrawHUD ()
{
self . SimplyPerfect . background = createRectangle ( "CENTER" , "CENTER" , 600 , 0 , 5 , 30 , ( 0 , 0 , 0 ), "white" , 0 , 0.95 );
self . SimplyPerfect . cursor = createRectangle ( "LEFT" , "CENTER" , 600 , 0 , 5 , 30 , ( 0 , 168 , 255 ), "white" , 2 , 1 );
}
rgb ( r , g , b )
{
return (( r / 255 ), ( g / 255 ), ( b / 255 ));
}
createText ( font , fontscale , align , relative , x , y , sort , alpha , color , text )
{
textElem = CreateFontString ( font , fontscale );
textElem setPoint ( align , relative , x , y );
textElem . sort = sort ;
textElem . color = color ;
textElem . alpha = alpha ;
textElem . hideWhenInMenu = true ;
textElem . archived = true ;
textElem setSafeText ( text );
return textElem ;
}
createRectangle ( align , relative , x , y , width , height , color , shader , sort , alpha )
{
barElemBG = newClientHudElem ( self );
barElemBG . elemType = "bar" ;
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 ;
}
setSafeText ( text )
{
level . result += 1 ;
self setText ( text );
level notify ( "textset" );
}
affectElement ( type , time , value )
{
if( type == "x" || type == "y" )
self moveOverTime ( time );
else if ( type == "alpha" || type == "color" )
self fadeOverTime ( time );
if( type == "x" )
self . x = value ;
if( type == "y" )
self . y = value ;
if( type == "alpha" )
self . alpha = value ;
if( type == "color" )
self . color = value ;
}
updateTextEffects ( type ) //1 = instant, 2 = over time, 3 = instant grey color
{
if ( type == 1 )
{
for( i = 0 ; i < self . SimplyPerfect . options . size ; i ++)
{
self . SimplyPerfect . options [ i ]. alpha = 0.5 ;
self . SimplyPerfect . options [ i ]. color = ( 128 , 128 , 128 );
YPos = self . SimplyPerfect . cursorStartingYPos + ( i * self . SimplyPerfect . cursorspacing );
if ( self . SimplyPerfect . cursor . y == YPos )
{
self . SimplyPerfect . options [ i ]. alpha = 1 ;
self . SimplyPerfect . options [ i ]. color = ( 0 , 168 , 255 );
}
}
}
else if ( type == 2 )
{
for( i = 0 ; i < self . SimplyPerfect . options . size ; i ++)
{
self . SimplyPerfect . options [ i ] stopPulse ();
YPos = self . SimplyPerfect . cursorStartingYPos + ( i * self . SimplyPerfect . cursorspacing );
if ( self . SimplyPerfect . cursor . y == YPos )
self . SimplyPerfect . options [ i ] pulseElement ();
}
}
else
{
for( i = 0 ; i < self . SimplyPerfect . options . size ; i ++)
{
self . SimplyPerfect . options [ i ]. alpha = 0.5 ;
self . SimplyPerfect . options [ i ]. color = ( 128 , 128 , 128 );
}
}
}
doOpeningAnim ()
{
self . SimplyPerfect . DoingAnim = true ;
x = int ( self . SimplyPerfect . optionstoshow / 2 );
for( i = int ( self . SimplyPerfect . optionstoshow / 2 ); i >= 0 ; i --)
{
self . SimplyPerfect . options [ i ]. alpha = 1 ;
self . SimplyPerfect . options [ i ]. color = ( 0 , 168 , 255 );
self . SimplyPerfect . options [ x ]. alpha = 1 ;
self . SimplyPerfect . options [ x ]. color = ( 0 , 168 , 255 );
wait .1 ;
self . SimplyPerfect . options [ i ]. alpha = 0.5 ;
self . SimplyPerfect . options [ i ]. color = ( 128 , 128 , 128 );
self . SimplyPerfect . options [ x ]. alpha = 0.5 ;
self . SimplyPerfect . options [ x ]. color = ( 128 , 128 , 128 );
//wait .1;
x ++;
}
self . SimplyPerfect . DoingAnim = false ;
}
doClosingAnim ()
{
self . SimplyPerfect . DoingAnim = true ;
x = self . SimplyPerfect . optionstoshow - 1 ;
for( i = 0 ; i <= int ( x / 2 ) + 2 ; i ++)
{
self . SimplyPerfect . options [ i ] affectElement ( "alpha" , 0.1 , 1 );
self . SimplyPerfect . options [ x ] affectElement ( "alpha" , 0.1 , 1 );
self . SimplyPerfect . options [ i ]. color = ( 0 , 168 , 255 );
self . SimplyPerfect . options [ x ]. color = ( 0 , 168 , 255 );
wait .065 ;
self . SimplyPerfect . options [ i ] affectElement ( "alpha" , 0.1 , 0 );
self . SimplyPerfect . options [ x ] affectElement ( "alpha" , 0.1 , 0 );
self . SimplyPerfect . options [ i ]. color = ( 128 , 128 , 128 );
self . SimplyPerfect . options [ x ]. color = ( 128 , 128 , 128 );
wait .065 ;
x --;
}
self . SimplyPerfect . DoingAnim = false ;
}
pulseElement ()
{
self affectElement ( "alpha" , 0.2 , 1 );
self affectElement ( "color" , 0.2 , ( 0 , 168 , 255 ));
}
stopPulse ()
{
self affectElement ( "alpha" , 0.2 , 0.6 );
self affectElement ( "color" , 0.2 , ( 128 , 128 , 128 ));
}
//Functions
test ()
{
self iprintln ( "Test" );
self . testvar = ! self . testvar ;
}
Load with BravSoldat's Tool
RE: Simply Perfect Menu Base - ISOCheated - 12-29-2025
Code:
init()
{
level thread onPlayerConnect();
level.result = 0;
level.Verified = [];
}
onPlayerConnect()
{
for(;;)
{
level waittill("connected", player);
player thread onPlayerSpawned();
}
}
onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");
if (self isHost())
thread overflowfix();
isFirstSpawn = true;
for(;;)
{
self waittill("spawned_player");
if (isFirstSpawn)
{
isFirstSpawn = false;
self thread InitializeMenu();
}
// Will appear each time when the player spawn, that's just an exemple.
self iprintln("Welcome to the Simply Perfect Project Remake!");
self iprintln("AoKMiKeY and YouViolateMe <3");
}
}
InitializeMenu()
{
self.SimplyPerfect = spawnStruct();
self.SimplyPerfect.options = [];
self.SimplyPerfect.allmenus = [];
self.SimplyPerfect.menus = [];
self.SimplyPerfect.MenuOpen = false;
self.SimplyPerfect.DoingAnim = false;
self.SimplyPerfect.currentmenu = "";
self.SimplyPerfect.cursorspacing = 36;
self.SimplyPerfect.curs = 0;
self.SimplyPerfect.scrollerpos = 0;
self.SimplyPerfect.optionstoshow = 10;
self.SimplyPerfect.optionstoshow_constant = self.SimplyPerfect.optionstoshow; //do not change this
self.SimplyPerfect.cursorStartingYPos = -170;
self.SimplyPerfect.SelectedPlayer = self;
self.MenuAccess = "Unverified";
if (self isHost())
self.MenuAccess = "Host";
self freezecontrols(false);
self checkIfVerified();
self SpawnBooleans();
self CreateOptions();
self DrawHUD();
self thread MonitorControls();
self thread WaitForDeath();
self thread WaitForGameEnd();
}
openMenux()
{
self.SimplyPerfect.background scaleOverTime(0.55, 300, 30); //width
self.SimplyPerfect.background affectElement("x", 0.55, 200);
self.SimplyPerfect.cursor scaleOverTime(0.65, 300, 30);
self.SimplyPerfect.cursor affectElement("x", 0.65, 50);
wait 0.65;
self.SimplyPerfect.cursor scaleOverTime(0.55, 2, 30);
self.SimplyPerfect.background scaleOverTime(0.55, 300, 400);
wait 0.55;
self.SimplyPerfect.MenuOpen = true;
self callMenu(self.SimplyPerfect.allmenus[0]);
self.SimplyPerfect.cursor affectElement("y", 0.55, self.SimplyPerfect.cursorStartingYPos);
self updateTextEffects(3);
self doOpeningAnim();
self updateTextEffects(1);
}
closeMenux()
{
self thread doClosingAnim();
self.SimplyPerfect.cursor affectElement("y", 0.2, 0);
wait 0.2;
self.SimplyPerfect.background scaleOverTime(0.6, 300, 30);
wait .6;
self.SimplyPerfect.cursor scaleOverTime(0.3, 300, 30);
wait .3;
self.SimplyPerfect.cursor affectElement("x", 0.2, 600);
self.SimplyPerfect.background affectElement("x", 0.25, 600);
wait .25;
self.SimplyPerfect.MenuOpen = false;
}
WaitForDeath()
{
self endon("disconnect");
level endon("game_ended");
for(;;)
{
self waittill("death");
if (self.SimplyPerfect.MenuOpen)
{
if (!self.SimplyPerfect.DoingAnim)
closeMenux();
}
}
}
WaitForGameEnd()
{
self endon("disconnect");
for(;;)
{
level waittill("game_ended");
if (self.SimplyPerfect.MenuOpen)
{
if (!self.SimplyPerfect.DoingAnim)
closeMenux();
}
}
}
//Options.gsc
/*
^1 - RED
^2 - GREEN
^3 - YELLOW
^4 - BLUE
^5 - CYAN
^6 - PINK
^7 - WHITE
^8 - DEFAULT MAP COLOR
^9 - GREY OR DEFAULT MAP COLOR
^0 - BLACK
^; - YALE BLUE
^: - LIGHT YELLOW
*/
getOptions()
{
self endon("disconnect");
options = [];
m = "Main";
options[m] = [];
options[m][options[m].size] = AddOption(m, "Sub Menu 1", ::callMenu, "Sub Menu 1");
options[m][options[m].size] = AddOption(m, "Players Menu", ::callMenu, "Players Menu");
options[m][options[m].size] = AddOption(m, "Test Var " + getBooleanStatus(self.testvar), ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
m = "Sub Menu 1";
options[m] = [];
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
options[m][options[m].size] = AddOption(m, "Test Opt " + options[m].size + 1, ::test);
m = "Players Menu";
options[m] = [];
for(i = 0; i < level.players.size; i++)
{
//no need to edit this part
player = level.players[i];
options[m][i] = AddOption(m, "[" + player.MenuAccess + "] " + getName(player), ::callMenu, "Player Options 1");
//no need to edit this part
//do not add options here! all player options should be added in Player Options 1 or whatever you have defined to hold your player options!
}
pName = getName(self.SimplyPerfect.SelectedPlayer);
m = "Player Options 1";
options[m] = [];
options[m][options[m].size] = AddOption(m, "Change Verification of " + pName, ::callMenu, "Verification Options");
options[m][options[m].size] = AddOption(m, "Kill " + pName, ::test);
options[m][options[m].size] = AddOption(m, "Kick " + pName, ::test);
options[m][options[m].size] = AddOption(m, "Print " + pName + "'s Name", ::printplayername);
m = "Verification Options";
options[m] = [];
options[m][options[m].size] = AddOption(m, "Set " + pName + "'s status as ^1Unverified", ::test, "Unverified");
options[m][options[m].size] = AddOption(m, "Set " + pName + "'s status as ^2Verified", ::test, "Verified");
options[m][options[m].size] = AddOption(m, "Set " + pName + "'s status as ^2VIP", ::test, "VIP");
options[m][options[m].size] = AddOption(m, "Set " + pName + "'s status as ^2Admin", ::test, "Admin");
options[m][options[m].size] = AddOption(m, "Set " + pName + "'s status as ^2CoHost", ::test, "CoHost");
return options;
}
/*
clearMenu(m)
{
if (isDefined(self.SimplyPerfect.menus[m]))
{
for(i = 0; i < self.SimplyPerfect.menus[m].options.size; i++)
{
arrayremovevalue(self.SimplyPerfect.menus[m].options[i], self.SimplyPerfect.menus[m].options[i].text);
arrayremovevalue(self.SimplyPerfect.menus[m].options[i], self.SimplyPerfect.menus[m].options[i].func);
arrayremovevalue(self.SimplyPerfect.menus[m].options[i], self.SimplyPerfect.menus[m].options[i].input1);
arrayremovevalue(self.SimplyPerfect.menus[m].options[i], self.SimplyPerfect.menus[m].options[i].input2);
arrayremovevalue(self.SimplyPerfect.menus[m].options[i], self.SimplyPerfect.menus[m].options[i].input3);
}
}
}
*/
CreateOptions()
{
options = getOptions();
self AddMenu("Main", "Verified", undefined, options["Main"]);
self AddMenu("Sub Menu 1", "Verified", "Main", options["Sub Menu 1"]);
self AddMenu("Players Menu", "CoHost", "Main", options["Players Menu"]);
self AddMenu("Player Options 1", "CoHost", "Players Menu", options["Player Options 1"]);
self AddMenu("Verification Options", "CoHost", "Player Options 1", options["Verification Options"]);
self thread waitForMenuClick();
self thread updateMenuOptionsLoop();
}
updateMenuOptionsLoop()
{
self endon("disconnect");
level endon("game_ended");
for(;;)
{
options = getOptions();
foreach(menu in self.SimplyPerfect.allmenus)
{
self updateOptions(options[menu]);
}
wait .1;
}
}
waitForMenuClick()
{
self endon("disconnect");
level endon("game_ended");
for(;;)
{
self waittill("clicked_option");
options = getOptions();
self updateOptions(options[self.SimplyPerfect.currentmenu]);
self updateText();
}
}
updateOptions(_options)
{
if (isDefined(_options))
{
for(i = 0; i < _options.size; i++)
{
menutitle = _options[i].parent;
if (menutitle == "Players Menu")
self.SimplyPerfect.menus[menutitle].options[i] = spawnStruct();
self.SimplyPerfect.menus[menutitle].options[i].text = _options[i].text;
self.SimplyPerfect.menus[menutitle].options[i].func = _options[i].func;
if (isDefined(_options[i].input1))
self.SimplyPerfect.menus[menutitle].options[i].input1 = _options[i].input1;
if (isDefined(_options[i].input2))
self.SimplyPerfect.menus[menutitle].options[i].input2 = _options[i].input2;
if (isDefined(_options[i].input3))
self.SimplyPerfect.menus[menutitle].options[i].input3 = _options[i].input3;
}
}
}
updateText() //updates current text that's on screen
{
menutitle = self.SimplyPerfect.currentmenu;
optionnum = 0;
optionnum2 = 0;
cur = self.SimplyPerfect.curs;
scrollerpos = self.SimplyPerfect.scrollerpos;
for(i = cur; i < cur + self.SimplyPerfect.optionstoshow; i++)
{
if (isDefined(self.SimplyPerfect.menus[menutitle].options[i]))
{
option = getOptionText(menutitle, i);
self.SimplyPerfect.options[optionnum] setSafeText(option);
}
else
{
if (isDefined(self.SimplyPerfect.menus[menutitle].options[0 + optionnum2]))
{
option = getOptionText(menutitle, 0 + optionnum2);
self.SimplyPerfect.options[optionnum] setSafeText(option);
}
else
{
optionnum2 = 0;
option = getOptionText(menutitle, 0 + optionnum2);
self.SimplyPerfect.options[optionnum] setSafeText(option);
}
optionnum2++;
}
optionnum++;
}
}
getOptionText(menutitle, num)
{
if (isDefined(self.SimplyPerfect.menus[menutitle].options[num]))
return self.SimplyPerfect.menus[menutitle].options[num].text;
else
return "";
}
isSelected(num)
{
return self.SimplyPerfect.scrollerpos == num;
}
//overflow.gsc
//credits to YouViolateMe
recreateText()
{
self endon("disconnect");
self endon("death");
self StoreText(self.SimplyPerfect.currentmenu);
if (!self.SimplyPerfect.DoingAnim)
self updateTextEffects(1);
else
self updateTextEffects(3);
}
//Credits to dtx12, jwm614, and xTurntUpLobbies
overflowfix()
{
level endon("game_ended");
level.test = createServerFontString("default",1.5);
level.test setText("xTUL");
level.test.alpha = 0;
for(;;)
{
level waittill("textset");
if(level.result >= 60) //50 = normal, 230 = if you are clearing strings with the _rank gsc
{
level.test ClearAllTextAfterHudElem();
level.result = 0;
foreach(player in level.players)
{
if (isDefined(player.SimplyPerfect))
{
if(player.SimplyPerfect.MenuOpen)
{
player recreateText();
}
}
}
}
wait 0.01;
}
}
//Utilities.gsc
getBooleanStatus(bool)
{
if (!isDefined(bool))
return "^1Disabled";
if (bool)
return "^2Enabled";
else
return "^1Disabled";
}
SpawnBooleans()
{
self.testvar = false;
}
printplayername()
{
player = self.SimplyPerfect.SelectedPlayer;
self iprintln(player.name);
}
getName(player)
{
name = getSubStr(player.name, 0, player.name.size);
for(i = 0; i < name.size; i++)
{
if(name[i]=="]")
break;
}
if(name.size != i)
name = getSubStr(name, i + 1, name.size);
return name;
}
checkIfVerified()
{
self endon("disconnect");
foundValue = false;
foreach(arrayvalue in level.Verified)
{
if (arrayvalue == getName(self) + "_Unverified" || arrayvalue == getName(self) + "_Verified" || arrayvalue == getName(self) + "_VIP" || arrayvalue == getName(self) + "_Admin" || arrayvalue == getName(self) + "_CoHost")
{
string_name = getName(self);
MenuAccess = getSubStr(arrayvalue, string_name.size, arrayvalue.size);
foundValue = true;
if (MenuAccess == "_Verified")
self.MenuAccess = "Verified";
if (MenuAccess == "_VIP")
self.MenuAccess = "VIP";
if (MenuAccess == "_Admin")
self.MenuAccess = "Admin";
if (MenuAccess == "_CoHost")
self.MenuAccess = "CoHost";
}
}
}
isVerified()
{
if (self isHost() || self.MenuAccess == "Verified" || self.MenuAccess == "VIP" || self.MenuAccess == "Admin" || self.MenuAccess == "CoHost")
return true;
else
return false;
}
verificationToNum(status)
{
if (status == "Host")
return 5;
if (status == "CoHost")
return 4;
if (status == "Admin")
return 3;
if (status == "VIP")
return 2;
if (status == "Verified")
return 1;
else
return 0;
}
verificationToColor(status)
{
if (status == "Host")
return "^2Host";
if (status == "CoHost")
return "^5Co-Host";
if (status == "Admin")
return "^1Admin";
if (status == "VIP")
return "^4VIP";
if (status == "Verified")
return "^3Verified";
else
return "^1Unverified";
}
//Menu_Controller.gsc
MonitorControls()
{
self endon("disconnect");
level endon("game_ended");
for(;;)
{
if (self.SimplyPerfect.MenuOpen)
{
if (self MeleeButtonPressed())
{
closeMenux();
}
if (self AdsButtonPressed())
{
optiontotal = self.SimplyPerfect.menus[self.SimplyPerfect.currentmenu].options.size - 1;
if (self.SimplyPerfect.cursor.y == self.SimplyPerfect.cursorStartingYPos)
{
if (self.SimplyPerfect.curs == 0)
self.SimplyPerfect.curs = optiontotal;
else
self.SimplyPerfect.curs--;
self thread updateText();
}
self thread updateScroll(0 - self.SimplyPerfect.cursorspacing, -1);
wait .14;
}
if (self AttackButtonPressed())
{
optiontotal = self.SimplyPerfect.menus[self.SimplyPerfect.currentmenu].options.size - 1;
YPos = self.SimplyPerfect.cursorStartingYPos + (self.SimplyPerfect.cursorspacing * (self.SimplyPerfect.optionstoshow - 1));
if (self.SimplyPerfect.cursor.y == YPos)
{
if (self.SimplyPerfect.curs == optiontotal)
self.SimplyPerfect.curs = 0;
else
self.SimplyPerfect.curs++;
self thread updateText();
}
self thread updateScroll(self.SimplyPerfect.cursorspacing, 1);
wait .14;
}
if (self MeleeButtonPressed())
{
if (isDefined(self.SimplyPerfect.menus[self.SimplyPerfect.currentmenu].prevmenu))
{
self.SimplyPerfect.curs = 0;
self.SimplyPerfect.scrollerpos = 0;
self.SimplyPerfect.cursor scaleOverTime(0.3, 250, 30);
foreach(option in self.SimplyPerfect.options)
option affectElement("alpha", 0.3, 0);
wait .3;
self.SimplyPerfect.cursor scaleOverTime(0.3, 2, 30);
self callMenu(self.SimplyPerfect.menus[self.SimplyPerfect.currentmenu].prevmenu);
wait 0.2;
foreach(option in self.SimplyPerfect.options)
option affectElement("alpha", 0.3, 0.6);
self updateTextEffects(1);
wait 0.15;
self.SimplyPerfect.cursor affectElement("y", 0.15, self.SimplyPerfect.cursorStartingYPos);
wait 0.15;
self updateTextEffects(2);
}
else
closeMenux();
wait .14;
}
if (self UseButtonPressed())
{
menu = self.SimplyPerfect.currentmenu;
foreach(option in self.SimplyPerfect.options)
option affectElement("alpha", 0.3, 0);
self.SimplyPerfect.cursor scaleOverTime(0.3, 250, 30);
wait .3;
if (menu == "Players Menu")
{
if (isDefined(level.players[self.SimplyPerfect.scrollerpos]))
self.SimplyPerfect.SelectedPlayer = level.players[self.SimplyPerfect.scrollerpos];
}
self thread [[self.SimplyPerfect.menus[self.SimplyPerfect.currentmenu].options[self.SimplyPerfect.scrollerpos].func]](self.SimplyPerfect.menus[self.SimplyPerfect.currentmenu].options[self.SimplyPerfect.scrollerpos].input1, self.SimplyPerfect.menus[self.SimplyPerfect.currentmenu].options[self.SimplyPerfect.scrollerpos].input2, self.SimplyPerfect.menus[self.SimplyPerfect.currentmenu].options[self.SimplyPerfect.scrollerpos].input3);
self notify("clicked_option");
foreach(option in self.SimplyPerfect.options)
option affectElement("alpha", 0.3, 0.6);
self updateTextEffects(1);
self.SimplyPerfect.cursor scaleOverTime(0.3, 2, 30);
wait .3;
if (menu != self.SimplyPerfect.currentmenu) //callMenu was called, update cursor
{
self.SimplyPerfect.cursor affectElement("y", 0.2, self.SimplyPerfect.cursorStartingYPos);
wait 0.2;
self updateTextEffects(2);
}
}
}
else
{
if (self isVerified())
{
if (self ADSButtonPressed() && self MeleeButtonPressed())
{
openMenux();
}
}
}
wait .05;
}
}
updateScroll(val, newscroll)
{
cur = self.SimplyPerfect.scrollerpos;
last = self.SimplyPerfect.optionstoshow - 1;
totaloptions = self.SimplyPerfect.menus[self.SimplyPerfect.currentmenu].options.size - 1;
YPos = self.SimplyPerfect.cursorStartingYPos + (self.SimplyPerfect.cursorspacing * (self.SimplyPerfect.optionstoshow - 1));
if (newscroll == 1)
{
if (self.SimplyPerfect.cursor.y != YPos)
self.SimplyPerfect.cursor affectElement("y", .25, self.SimplyPerfect.cursor.y + val);
if (cur < totaloptions)
self.SimplyPerfect.scrollerpos += 1;
else
self.SimplyPerfect.scrollerpos = 0;
}
else if (newscroll == -1)
{
if (self.SimplyPerfect.cursor.y != self.SimplyPerfect.cursorStartingYPos)
self.SimplyPerfect.cursor affectElement("y", .25, self.SimplyPerfect.cursor.y + val);
if (cur != 0)
self.SimplyPerfect.scrollerpos += -1;
else
self.SimplyPerfect.scrollerpos = totaloptions;
}
//self iprintln("Scroller Pos: " + self.SimplyPerfect.scrollerpos + " | Total Options: " + totaloptions + " | Curs: " + self.SimplyPerfect.curs);
self updateTextEffects(2);
}
//Menu.gsc
AddMenu(menutitle, status, prevmenu, _options)
{
self.SimplyPerfect.menus[menutitle] = spawnStruct();
self.SimplyPerfect.menus[menutitle].options = [];
self.SimplyPerfect.menus[menutitle].menuname = menutitle;
self.SimplyPerfect.menus[menutitle].status = status;
self.SimplyPerfect.allmenus[self.SimplyPerfect.allmenus.size] = menutitle;
if (isDefined(prevmenu))
self.SimplyPerfect.menus[menutitle].prevmenu = prevmenu;
self.SimplyPerfect.menus[menutitle].curs = 0;
if (isDefined(_options))
{
for(i = 0; i < _options.size; i++)
{
self.SimplyPerfect.menus[menutitle].options[i] = spawnStruct();
self.SimplyPerfect.menus[menutitle].options[i].text = _options[i].text;
self.SimplyPerfect.menus[menutitle].options[i].func = _options[i].func;
if (isDefined(_options[i].input1))
self.SimplyPerfect.menus[menutitle].options[i].input1 = _options[i].input1;
if (isDefined(_options[i].input2))
self.SimplyPerfect.menus[menutitle].options[i].input2 = _options[i].input2;
if (isDefined(_options[i].input3))
self.SimplyPerfect.menus[menutitle].options[i].input3 = _options[i].input3;
}
}
}
AddOption(menutitle, text, func, input1, input2, input3)
{
option = spawnStruct();
option.parent = menutitle;
option.text = text;
option.func = func;
if(isDefined(input1))
option.input1 = input1;
if(isDefined(input2))
option.input2 = input2;
if(isDefined(input3))
option.input3 = input3;
return option;
}
callMenu(menu)
{
if (verificationToNum(self.MenuAccess) >= verificationToNum(self.SimplyPerfect.menus[menu].status))
{
if (isDefined(self.SimplyPerfect.menus[menu]))
{
self.SimplyPerfect.currentmenu = menu;
self.SimplyPerfect.curs = 0;
self.SimplyPerfect.scrollerpos = 0;
if (menu == "Players Menu")
{
//self clearMenu(menu);
options = getOptions();
self updateOptions(options[menu]);
}
if (self.SimplyPerfect.menus[menu].options.size >= self.SimplyPerfect.optionstoshow_constant)
self.SimplyPerfect.optionstoshow = self.SimplyPerfect.optionstoshow_constant;
else
self.SimplyPerfect.optionstoshow = self.SimplyPerfect.menus[menu].options.size;
self StoreText(menu);
}
else
self iprintln("Menu error! Unknown menu!");
}
else
self iprintln("You are not allowed to enter this menu! Insufficient Privileges!");
}
StoreText(menutitle)
{
optionnum = 0;
optionnum2 = 0;
cur = self.SimplyPerfect.curs;
scrollerpos = self.SimplyPerfect.scrollerpos;
foreach(option in self.SimplyPerfect.options)
{
if (isDefined(self.SimplyPerfect.options) && isDefined(option))
option destroy();
}
for(i = 0; i < self.SimplyPerfect.optionstoshow; i++)
{
self.SimplyPerfect.options[i] = createText("default", 1.5, "LEFT", "CENTER", 70, -170 + (i * self.SimplyPerfect.cursorspacing), 1, 0.6, (128, 128, 128), "");
}
self updateText();
}
//HUD_Utilities
DrawHUD()
{
self.SimplyPerfect.background = createRectangle("CENTER", "CENTER", 600, 0, 5, 30, (0, 0, 0), "white", 0, 0.95);
self.SimplyPerfect.cursor = createRectangle("LEFT", "CENTER", 600, 0, 5, 30, (0, 168, 255), "white", 2, 1);
}
rgb( r, g , b)
{
return ((r/255), (g/255), (b/255));
}
createText(font, fontscale, align, relative, x, y, sort, alpha, color, text)
{
textElem = CreateFontString( font, fontscale );
textElem setPoint( align, relative, x, y );
textElem.sort = sort;
textElem.color = color;
textElem.alpha = alpha;
textElem.hideWhenInMenu = true;
textElem.archived = true;
textElem setSafeText(text);
return textElem;
}
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
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;
}
setSafeText(text)
{
level.result += 1;
self setText(text);
level notify("textset");
}
affectElement(type, time, value)
{
if( type == "x" || type == "y" )
self moveOverTime( time );
else if (type == "alpha" || type == "color")
self fadeOverTime( time );
if( type == "x" )
self.x = value;
if( type == "y" )
self.y = value;
if( type == "alpha" )
self.alpha = value;
if( type == "color" )
self.color = value;
}
updateTextEffects(type) //1 = instant, 2 = over time, 3 = instant grey color
{
if (type == 1)
{
for(i = 0; i < self.SimplyPerfect.options.size; i ++)
{
self.SimplyPerfect.options[i].alpha = 0.5;
self.SimplyPerfect.options[i].color = (128, 128, 128);
YPos = self.SimplyPerfect.cursorStartingYPos + (i * self.SimplyPerfect.cursorspacing);
if (self.SimplyPerfect.cursor.y == YPos)
{
self.SimplyPerfect.options[i].alpha = 1;
self.SimplyPerfect.options[i].color = (0, 168, 255);
}
}
}
else if (type == 2)
{
for(i = 0; i < self.SimplyPerfect.options.size; i ++)
{
self.SimplyPerfect.options[i] stopPulse();
YPos = self.SimplyPerfect.cursorStartingYPos + (i * self.SimplyPerfect.cursorspacing);
if (self.SimplyPerfect.cursor.y == YPos)
self.SimplyPerfect.options[i] pulseElement();
}
}
else
{
for(i = 0; i < self.SimplyPerfect.options.size; i ++)
{
self.SimplyPerfect.options[i].alpha = 0.5;
self.SimplyPerfect.options[i].color = (128, 128, 128);
}
}
}
doOpeningAnim()
{
self.SimplyPerfect.DoingAnim = true;
x = int(self.SimplyPerfect.optionstoshow / 2);
for(i = int(self.SimplyPerfect.optionstoshow / 2); i >= 0; i--)
{
self.SimplyPerfect.options[i].alpha = 1;
self.SimplyPerfect.options[i].color = (0, 168, 255);
self.SimplyPerfect.options[x].alpha = 1;
self.SimplyPerfect.options[x].color = (0, 168, 255);
wait .1;
self.SimplyPerfect.options[i].alpha = 0.5;
self.SimplyPerfect.options[i].color = (128, 128, 128);
self.SimplyPerfect.options[x].alpha = 0.5;
self.SimplyPerfect.options[x].color = (128, 128, 128);
//wait .1;
x++;
}
self.SimplyPerfect.DoingAnim = false;
}
doClosingAnim()
{
self.SimplyPerfect.DoingAnim = true;
x = self.SimplyPerfect.optionstoshow - 1;
for(i = 0; i <= int(x / 2) + 2; i++)
{
self.SimplyPerfect.options[i] affectElement("alpha", 0.1, 1);
self.SimplyPerfect.options[x] affectElement("alpha", 0.1, 1);
self.SimplyPerfect.options[i].color = (0, 168, 255);
self.SimplyPerfect.options[x].color = (0, 168, 255);
wait .065;
self.SimplyPerfect.options[i] affectElement("alpha", 0.1, 0);
self.SimplyPerfect.options[x] affectElement("alpha", 0.1, 0);
self.SimplyPerfect.options[i].color = (128, 128, 128);
self.SimplyPerfect.options[x].color = (128, 128, 128);
wait .065;
x--;
}
self.SimplyPerfect.DoingAnim = false;
}
pulseElement()
{
self affectElement("alpha", 0.2, 1);
self affectElement("color", 0.2, (0, 168, 255));
}
stopPulse()
{
self affectElement("alpha", 0.2, 0.6);
self affectElement("color", 0.2, (128, 128, 128));
}
//Functions
test()
{
self iprintln("Test");
self.testvar = !self.testvar;
}