GSC Elite Mossy Style Menu Base

Procyon

BANNED
Messages
325
Reaction score
119
Points
43
So, I was a little bit bored today.
So I decided to make a Elite Mossy Style Menu Base!
I know that it isn't the greatest of bases ever made, but it is not made for actually being used.
It is more for people to look at, to get an understanding of how the scroller system works.
And no, it is not anything advanced within the base. Since I chose to stay away from it. (Simple edit of Shark's)
This is just something I made to figure out the scroller stuff meself.
Code:
#include maps\mp\gametypes\_hud_util;
init()
{
  level.result = 0;
  level thread onplayerconnect();
}
onplayerconnect()
{
  for( ;; )
  {
  level waittill( "connecting", player );
  if( player ishost() )
  player.status = "Host";
  else
  player.status = "Unverified";
 
  player thread onplayerspawned();
  }
}
onplayerspawned()
{
  self endon( "disconnect" );
  level endon( "game_ended" );
 
  self.ran = 0;
  isFirstSpawn = 1;
 
  for( ;; )
  {
  self waittill( "spawned_player" );
  if( self isV() )
  {
  if( !self.ran )
  {
  self.ran = 1;
  self thread Start();
  }
  if( isFirstSpawn && self ishost(  ) )
  {
  p7f15(  );
  isFirstSpawn = 0;
  }
  }
  }
}
drawText( text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort )
{
  hud = self createFontString( font, fontScale );
  hud setText( text );
  hud.x = x;
  hud.y = y;
  hud.color = color;
  hud.alpha = alpha;
  hud.glowColor = glowColor;
  hud.glowAlpha = glowAlpha;
  hud.sort = sort;
  hud.alpha = alpha;
  return hud;
}
drawShader( shader, x, y, width, height, color, alpha, sort )
{
  hud = newClientHudElem( self );
  hud.elemtype = "icon";
  hud.color = color;
  hud.alpha = alpha;
  hud.sort = sort;
  hud.children = [];
  hud setParent( level.uiParent );
  hud setShader( shader, width, height );
  hud.x = x;
  hud.y = y;
  return hud;
}
verificationToColor( status )
{
  if ( status == "Host" )
  return "^2Host";
  if ( status == "Co-Host" )
  return "^2Full Access";
  if ( status == "Admin" )
  return "^2Admin Access";
  if ( status == "Verified" )
  return "^2Menu Given";
  if ( status == "Unverified" )
  return "^1Not Given";
}
changeVerificationMenu( player, verlevel )
{
  if( player.status != verlevel && !player ishost())
  { 
  player.status = verlevel;

  if( player.status == "Unverified" )
  self thread destroyMenu( player );
  else
  player Start();
  }
  else
  {
  if( player ishost() )
  self iprintln( "You Cannot Change The Access Level Of The Host" );
  else
  self iprintln( "Access Level For " + player.name + " Is Already Set To " + player.status );
  }
}
isH()
{
  if( self.status == "Co-Host" || self.status == "Host" )
  return 1;
  else
  return 0;
}
isA()
{
  if( self.status == "Admin" || self.status == "Co-Host" || self.status == "Host" )
  return 1;
  else
  return 0;
}
isV()
{
  if( self.status == "Verified" || self.status == "Admin" || self.status == "Co-Host" || self.status == "Host" )
  return 1;
  else
  return 0;
}
CreateMenu()
{
  self add_menu( "Main Menu", undefined );
 
  if( self isV() )
  self add_option( "Main Menu", "Sub Menu 1", ::submenu, "SubMenu1", "Sub Menu 1" );
  self add_menu( "SubMenu1", "Main Menu" );
  self add_option( "SubMenu1", "Option 1" );
 
  if( self isA() )
  self add_option( "Main Menu", "Sub Menu 2", ::submenu, "SubMenu2", "Sub Menu 2" );
  self add_menu( "SubMenu2", "Main Menu" );
  self add_option( "SubMenu2", "Option 1" );
 
  if( self isH() )
  self add_option( "Main Menu", "Client Menu", ::submenu, "PlayersMenu", "Players" ); 
  self add_menu( "PlayersMenu", "Main Menu");
  for ( i = 0; i < 12; i++ )
  {
  self add_menu( "pOpt " + i, "PlayersMenu");
  }
}
updatePlayersMenu()
{
  self.menu.menucount["PlayersMenu"] = 0;
  for ( i = 0; i < 12; i++ )
  {
  player = level.players[i];
  name = player.name;
 
  playersizefixed = level.players.size - 1;
  if( self.menu.curs["PlayersMenu"] > playersizefixed )
  {
  self.menu.scrollerpos["PlayersMenu"] = playersizefixed;
  self.menu.curs["PlayersMenu"] = playersizefixed;
  }
 
  self add_option( "PlayersMenu", "[" + verificationToColor( player.status ) + "^7] " + player.name, ::submenu, "pOpt " + i, "[" + verificationToColor( player.status ) + "^7] " + player.name );
 
  self add_menu( "pOpt " + i, "PlayersMenu" );
  self add_option( "pOpt " + i, "Give Full Access", ::changeVerificationMenu, player, "Co-Host" );
  self add_option( "pOpt " + i, "Give Admin Access", ::changeVerificationMenu, player, "Admin" );
  self add_option( "pOpt " + i, "Give The Menu", ::changeVerificationMenu, player, "Verified" );
  self add_option( "pOpt " + i, "Take The Menu", ::changeVerificationMenu, player, "Unverified" );
  }
}
add_menu( Menu, prevmenu )
{
  self.menu.getmenu[Menu] = Menu;
  self.menu.scrollerpos[Menu] = 0;
  self.menu.curs[Menu] = 0;
  self.menu.menucount[Menu] = 0;
  self.menu.previousmenu[Menu] = prevmenu;
}
add_option( Menu, Text, Func, arg1, arg2 )
{
  Menu = self.menu.getmenu[Menu];
  Num = self.menu.menucount[Menu];
  self.menu.menuopt[Menu][Num] = Text;
  self.menu.menufunc[Menu][Num] = Func;
  self.menu.menuinput[Menu][Num] = arg1;
  self.menu.menuinput1[Menu][Num] = arg2;
  self.menu.menucount[Menu] += 1;
}
openMenu()
{
  self freezeControls( 0 );
  self text( "Main Menu", "Elite Mossy Style Base" );
  self setblur( 15, .2 );
  self setClientUiVisibilityFlag( "hud_visible", 0 );
  self.bg = drawShader( "white", 0, -250, 1000, 1000, ( 0, 0, 0 ), .6, 1 );
  self.menu.open = 1;
}
closeMenu()
{
  for( i = 0; i < self.text["option"].size; i++ )
  {
  self.text["option"][i].alpha = 0;
  }
  self setClientUiVisibilityFlag( "hud_visible", 1 );
  self setblur( 0, .2 );
  self.bg destroy();
  self.text["current"].alpha = 0;
  self.menu.open = 0;
}
destroyMenu( player )
{
  player closeMenu();
  wait 1;
  player.text["option"] destroy();
  player.text["current"] destroy();
  player.ran = 0;
  player notify( "menuDestroyed" );
}
scroll()
{
  for( R = 0; R < self.menu.menuopt[self.menu.currentmenu].size; R++ )
  {
  if( self.menu.curs[self.menu.currentmenu] < 0 )
  self.menu.curs[self.menu.currentmenu] = self.menu.menuopt[self.menu.currentmenu].size - 1;
 
  if( self.menu.curs[self.menu.currentmenu] > self.menu.menuopt[self.menu.currentmenu].size - 1 )
  self.menu.curs[self.menu.currentmenu] = 0;
 
  if( R == self.menu.curs[self.menu.currentmenu] )
  {
  self.text["option"][R].glowcolor = ( ( randomint( 255 )/255 ), ( randomint( 255 )/255 ), ( randomint( 255 )/255 ) );
  self.text["option"][R].glowalpha = 1;
  self.text["option"][R].fontscale = 2;
  self.text["option"][R] fadeovertime( .3 );
 
  /*if ( self.text["option"][R] == self.text["option"][0] )
  self.text["option"][R].y = self.text["option"][R].y;
  else
  self.text["option"][R].y = self.text["option"][R].y - 5;*/
  }
  else
  {
  self.text["option"][R].glowalpha = 0;
  self.text["option"][R].fontscale = 1.6;
  }
  }
}
text( menu, title )
{
  self.menu.currentmenu = menu;
  glow = ( ( randomint( 255 )/255 ), ( randomint( 255 )/255 ), ( randomint( 255 )/255 ) );
  self.text["current"] destroy();
  self.text["current"] = drawText( title, "objective", 2.5, 0, 30, ( 1, 1, 1 ), 0, glow, 1, 2 );
  self.text["current"].alpha = 1;
  self.text["current"] fadeovertime( .05 );
 
  for( i = 0; i < self.menu.menuopt[menu].size; i++ )
  {
  self.text["option"][i] destroy();
  self.text["option"][i] = drawText( self.menu.menuopt[menu][i], "objective", 1.6, 0, 68 + ( i*20 ), ( 1, 1, 1 ), 0, ( 0, 0, 0 ), 0, 2 );
  self.text["option"][i] fadeovertime( .3 );
  self.text["option"][i].alpha = 1;
  self scroll();
  }
}
Start()
{
  level endon( "game_ended" );
  self endon ( "menuDestroyed" );
 
  self.menu = spawnstruct();
  self.menu.open = 0;

  self CreateMenu();
 
  for( ;; )
  {
  if( self MeleeButtonPressed() && self adsbuttonpressed() && !self.menu.open )
  openMenu();
  if( self.menu.open )
  {
  if( self usebuttonpressed() )
  {
  if( isDefined( self.menu.previousmenu[self.menu.currentmenu] ) )
  self submenu( self.menu.previousmenu[self.menu.currentmenu] );
  else
  closeMenu();
  wait .3;
  }
  if( self actionslotonebuttonpressed() )
  {
  self.menu.curs[self.menu.currentmenu]--;
  self scroll();
  }
  if( self actionslottwobuttonpressed() )
  {
  self.menu.curs[self.menu.currentmenu]++;
  self scroll();
  }
  if( self jumpbuttonpressed() )
  {
  self thread [[self.menu.menufunc[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]]]] (self.menu.menuinput[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]], self.menu.menuinput1[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]] );
  wait .3;
  }
  }
  wait .05;
  }
}
submenu( input, title )
{
  for( i = 0; i < self.text["option"].size; i++ )
  { self.text["option"][i] destroy(); }
 
  if( input == "Main Menu" )
  self thread text( input, "Elite Mossy Style Base" );
  else if ( input == "PlayersMenu" )
  {
  self updatePlayersMenu();
  self thread text( input, "Players" );
  }
  else
  self thread text( input, title );
 
  self.currenttitle = title;
 
  self.menu.scrollerpos[input] = self.menu.curs[input];
  self.menu.curs[input] = self.menu.scrollerpos[input];
}
p7f15(  )//String overflow fix
{
  level endon( "game_ended" );
   
  level.test = createServerFontString( "default", 1.5 );
  level.test setText( "Fix" );
  level.test.alpha = 0;
   
  for ( ;; )
  {
  level waittill( "textset" );
  if( level.result >= 45 )
  {
  level.test ClearAllTextAfterHudElem(  );
  level.result = 0;
  foreach( player in level.players )
  if( player.menu.open )
  self thread submenu( self.menu.currentmenu, self.currenttitle );
  }
  wait .01;
  }
}
EeT3cgb6IG1KlzvhVmAupuoVs-MH5DZpdpx9t4h8fquLgAfjlsw4ww8bLfcCKzQLXGlTHxj2S4MNGBR3SAimMT13UHdPBGTf0yAEsF4yPUTwbGolDC9_mHHlrUdcLQaK5pGnErV3WYpOrls7pWjwaKoDjFnR3vpWVUDtk5FaoAW9jeD3rW-pdyD1VkXqtkF0fVSoyK4BdZJRNexDh8zDex7zJ9Epj53uKOd1eGRCVY17AUfhZhkQsOOeWlO8ZnBYDArSNhGOKwIyEi29kraq2Ta5oVOgkdlH1OgzjboDGrR9Cr69EQ-R-QbQOtdNr05LEqi4q8bIMH5g2ihfYqrv-NcNvYRsj9JLlyliiOSTGOPRF-aFv8ODkpyUDOZ93Fzxy1gnpJW8SEMsyheGRaX96CGpesJ0TL-xMYnooR04z4BkQgalfE0jq_CI3iSyIJ0bVcO4729-Y_ZehR1aejJk9nF3cqBZUDmC7fXmfgtpUojbJthhE3PU2ENi1T7kxUf3TeUCZ2C86EJWWeUZYBMeLwGXCLonIX-ABVI-yuZDBrCjtEn61R6IzX2vqGFKY-S5WbNPuiv68yT8hmXEZ6Cvj_WarY0mwg=w883-h662-no

^Quality image suggested to me by the one and only @BaDSooD !
It does contain a string overflow fix, but I don't even know if it works. I am to lazy to test it.
Shark
Taylor
xTurntUpLobbies
CraigChrist
YVM
Jwm614
dtx12?

 
Last edited:

The Dark Side

Former Staff Member
Messages
1,008
Reaction score
783
Points
768
This thread is a troll. ( ͡° ͜ʖ ͡°)

Doesn't work. Why post something that doesn't work? I wouldn't expect it from you. Btw QUALITY image.
 

BaDSooD

Old CCM Member
Premium Member
Messages
586
Reaction score
312
Points
688
Simple menu base but I like it,
I prefere to don't see back but see a correct presentation of the menu :smile:

Thank's for the release
 
Top