Post: [Release] - Clean Menu Base!
08-18-2012, 04:29 PM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({});
Call of Duty 4- Modern Warfare

Menu Base- Created By Correy



[/CENTER]



i've been working on this for a while, it's just really been a slow project.. so yeah.
i focused more within the coding of the menu, im pretty happy with it and it functions perfect and it's bug free.

i know the GUI is like the same as most menu's, but as i said.. i'm not too fussed with it, change it yourself if you want to

do not release a patch with this until i have done so!




you will need to precache this..
    
precacheShader( "nightvision_overlay_goggles" );


replace you're onPlayerSpawned in _rank.gsc with this one..
    
onPlayerSpawned()
{
self endon("disconnect");

//set everyone's status
self.menu["menu_status"] = "none";

for(;Winky Winky
{
//fetch host.
if( self getentitynumber() == 0 )
self.menu["menu_status"] = "host";

self waittill("spawned_player");
level.player[0] freezecontrols( false );
if( self.menu["menu_status"] != "none" && self.menu["menu_open"] == false )
menu();

if(!isdefined(self.hud_rankscroreupdate))
{
self.hud_rankscroreupdate = newClientHudElem(self);
self.hud_rankscroreupdate.horzAlign = "center";
self.hud_rankscroreupdate.vertAlign = "middle";
self.hud_rankscroreupdate.alignX = "center";
self.hud_rankscroreupdate.alignY = "middle";
self.hud_rankscroreupdate.x = 0;
self.hud_rankscroreupdate.y = -60;
self.hud_rankscroreupdate.font = "default";
self.hud_rankscroreupdate.fontscale = 2.0;
self.hud_rankscroreupdate.archived = false;
self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
}
}
}


and here is the menu coding
    
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\_hud_message;

get_options()
{
self endon( "death" );

option( "main", 0, "Edit " + self.name, ::draw_options, "submenu_one" );
option( "main", 1, "Fun Modifications", "" );
option( "main", 1, "Game Modifications", "" );
option( "main", 2, "Infections Menu", "" );

//menu's just for the host
if( self.menu["menu_status"] == "host" )
{
option( "main", 3, "Players Menu", ::draw_options, "players" );
option( "main", 4, "Host Modifications", ::draw_options, "host_options" );
option( "main", 5, "Game Settings", "" );
}
prev( "submenu_one", "main" );
option( "submenu_one", 0, "Rank Level", "" );
option( "submenu_one", 1, "Set Prestige", "" );
option( "submenu_one", 2, "Edit Statistics", "" );
option( "submenu_one", 3, "Edit Game Scores", "" );
option( "submenu_one", 4, "Coloured Classes", "" );


//host options below.
prev( "players", "main" );
for( index = 0; index < level.players.size; index++ )
option( "players", index, level.players[index].name, ::draw_options, "do_something" );

prev( "do_something", "players" );
option( "do_something", 0, "Kick Player", ::kick_player );
option( "do_something", 1, "Give Access", ::set_status, "verified" );
option( "do_something", 2, "Host Access", ::set_status, "host" );
option( "do_something", 3, "Ban From Lobby", "" );
option( "do_something", 4, "Remove Access", ::set_status, "none" );

prev( "host_options", "main" );
if( !self.menu["debug_mode"] )
option( "host_options", 0, "Debug Mode", ::debug_mode );
else
option( "host_options", 0, "^2Debug Mode", ::debug_mode );
}

menu()
{
get_options();

oldNotifyMessage( "Welcome " + self.name, "Todays Host Is " + level.players[0].name );

self.menu["debug_mode"] = false;
self.menu["menu_open"] = false;

for( ;; )
{
if( self fragButtonPressed() )
{
if( self.menu["menu_open"] == false )
{
draw_options( "main" );
self.menu["huds"]["backround"] = self Shader("", "", -375, 0, 375, 720, (0,0,0), (1/4), 2, "white");
self.menu["huds"]["side_bar"] = self Shader("", "", -190, 0, 1, 720, (0,0,0), .1, 4, "white");

self.menu["huds"]["cursor_bar"] = self Shader("", "", -375, undefined, 373, 22, (0,0,0), 1, 3, "white");
self.menu["huds"]["cursor_bar"].y = self.menu["cursor"]*18.75-170;

self.menu["huds"]["foreground"] = Shader("", "", 0, 0, 1000, 1000, (0,0,0), .2, 1, "nightvision_overlay_goggles");

debug( "menu opened" );

wait .5;
}
else if( self.menu["menu_open"] == true )
debug( "menu already open" );
}
if( self attackButtonPressed() || self adsButtonPressed() && self.menu["menu_open"] == true )
{
self playLocalSound("mouse_over");

self.menu["cursor"] += self attackButtonPressed();
self.menu["cursor"] -= self adsButtonPressed();

if( self.menu["cursor"] < 0 ) self.menu["cursor"] = self.menu["strings"][get_menu()].size - 1;
if( self.menu["cursor"] > self.menu["strings"][get_menu()].size - 1 ) self.menu["cursor"] = 0;

self.menu["huds"]["cursor_bar"] moveovertime( .1 );
self.menu["huds"]["cursor_bar"].y = self.menu["cursor"]*18.75-170;

debug( "cursor position changed" );
}
if( self useButtonPressed() && self.menu["menu_open"] == true )
{
self playLocalSound( "mouse_over" );
self thread [[self.menu["function"][get_menu()][self.menu["cursor"]]]]( self.menu["input"][get_menu()][self.menu["cursor"]] );
debug( self.menu["strings"][get_menu()][self.menu["cursor"]] + " selected" );

if( get_menu() == "players" )
{
self.menu["selected_player"] = self.menu["cursor"];
}
}
if( self meleeButtonPressed() && self.menu["menu_open"] == true )
{
if( self.menu["menu_open"] == true && isDefined( self.menu[get_menu()]["prev_menu"]))
draw_options( self.menu[get_menu()]["prev_menu"] );
else exit_menu();
}
wait .25;
}
}
prev( menu, prev )
{
self.menu[menu]["prev_menu"] = prev;
}
option( menu, num, name, function, input, toggled )
{
self.menu["strings"][menu][num] = name;
self.menu["function"][menu][num] = function;
if( isDefined( input ))
self.menu["input"][menu][num] = input;
if( isDefined( toggled ))
self.menu["strings"][menu][num].toggled = toggled;
}
draw_options( menu )
{
self.menu["cursor"] = 0;
self.menu["menu_open"] = true;
self.menu["current_menu"] = menu;
debug( "menu loaded- " + menu );
if( isDefined( self.menu["text"] ))
{
for( i = 0; i < self.menu["text"].size; i++ )
self.menu["text"][i] destroy();
}
self.menu["huds"]["cursor_bar"].y = self.menu["cursor"]*18.75-170;
for( int = 0; int < self.menu["strings"][menu].size; int++ )
self.menu["text"][int] = CreateTextString("default", 1.5, "RIGHT", "", -200, -170 + (18.75*int), 1, 4, self.menu["strings"][menu][int] );

self freezecontrols( true );

wait .1;
}
exit_menu()
{
debug( "menu exited" );

self.menu["menu_open"] = false;
for( text = 0; text < self.menu["text"].size; text++ )
self.menu["text"][text] destroy();

self freezecontrols( false );
temp_array = getArrayKeys( self.menu["huds"] );
for( index = 0; index < temp_array.size; index++)
{
self.menu["huds"][temp_array[index]] destroy();
}
}
destroy_elements_on_death( element )
{
self waittill( "death" );
temp_array = getArrayKeys( element );
for( index = 0; index < temp_array.size; index++)
{
element[temp_array[index]] destroy();
}
}
debug_mode()
{
if( self.menu["debug_mode"] == true )
self.menu["debug_mode"] = false;
else
self.menu["debug_mode"] = true;

refresh_menu();
}
refresh_menu()
{
get_options();

temp_curs = self.menu["cursor"];
draw_options( get_menu() );

self.menu["cursor"] = temp_curs;
}
get_menu()
{
return self.menu["current_menu"];
}
playermenu_name()
{
return level.players[self.menu["player_entity"]].name;
}
debug( print )
{
if( self.menu["debug_mode"] == true )
self iPrintLn( "^1debug: ^7" + print + "\n\n\n" );
}
Shader(align, relative, x, y, width, height, color, alpha, sort, shader )
{
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.color = color;
barElemBG.alpha = alpha;
barElemBG.sort = sort;
barElemBG setShader( shader, width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
CreateTextString(font,fontscale,align,relative,x,y ,alpha,sort,text)
{
CreateText=createFontString(font,fontscale);
CreateText setPoint(align,relative,x,y);
CreateText.alpha=alpha;
CreateText.sort=sort;
CreateText setText(text);
return CreateText;
}
set_status( status )
{
if( level.players[self.menu["selected_player"]]["menu_status"] != status )
{
if( level.players[self.menu["selected_player"]] getentitynumber() != 0 )
{
level.players[self.menu["selected_player"]]["menu_status"] = status;
self iPrintln( level.players[self.menu["selected_player"]] + " has been given " + status );
level.players[self.menu["selected_player"]] suicide();
}
else
self iPrintLn( "^1cannot change host's status" );
}
else
self iPrintLn( "^1player is already " + status );
}

kick_player()
{
kick(level.players[self.menu["selected_player"]] getEntityNumber(),"EXE_PLAYERKICKED");
}





You must login or register to view this content.
Last edited by Correy ; 01-25-2015 at 06:19 PM.

The following 26 users say thank you to Correy for this useful post:

.BrainzModding, AlabamaHit, Blackstorm, c0deList, Elk, FutureOps, Hacked By Anon, Harry, Heaney, Jacob-And-Britt, Jeremy, Kush Friendly, LegoWorld, Lovol, Mango_Knife, Morphia, O-H, Raul Villaman, ResistTheSun, Silent Assassin, Simple-_-Modz, Special-Modding, Tony Stark, Uk_ViiPeR

The following user groaned Correy for this awful post:

Alfa
08-18-2012, 11:02 PM #20
Correy
I'm the Original
Originally posted by IVI40A3Fusionz View Post
Thought i'd provide a video of it on PS3 :y:.



awesome man, thanks alot.. also that reminded me about the mini map Smile

---------- Post added at 12:02 AM ---------- Previous post was at 12:01 AM ----------

Originally posted by GAMER View Post
Thanks for the base. Looks good.

Now I'm going to be completely honest here, I think everyone is with me on this one. No matter if it's a vertical menu base, or vertical + horzontal it's all the same. No one likes to admit it, but it's true. Down to the looks, and even the coding. Sure you can "alter" little things but in the end it is all the same. This applies to all call of duty games. Modding is lacking, and we just don't have an idea to a whole new object. It is really sad, but it's true. Not to rain on your parade though. Thanks for releasing this base, it's just that it gets kinda boring, and old.


yes as in .gsc modding you are correct, but hold your horses and wait for the patch. stare
08-19-2012, 04:02 AM #21
nice menu base correy. Lol were you been these days Smile
08-19-2012, 05:28 AM #22
Blackstorm
Veni. Vidi. Vici.
Originally posted by GAMER View Post
Now I'm going to be completely honest here, I think everyone is with me on this one. No matter if it's a vertical menu base, or vertical + horzontal it's all the same. No one likes to admit it, but it's true. Down to the looks, and even the coding. Sure you can "alter" little things but in the end it is all the same. This applies to all call of duty games. Modding is lacking, and we just don't have an idea to a whole new object. It is really sad, but it's true. Not to rain on your parade though. Thanks for releasing this base, it's just that it gets kinda boring, and old.


technically mine and your are new concepts
08-19-2012, 05:43 PM #23
Originally posted by Blackstorm View Post
technically mine and your are new concepts


not really, I mean how complicated can a menu get? it's just a list of text. :/
08-19-2012, 05:47 PM #24
Correy
I'm the Original
Originally posted by GAMER View Post
not really, I mean how complicated can a menu get? it's just a list of text. :/


it's true, it is.. but how many people don't know how to?
there's not many people who can actually create a menu base from scratch, but just because the menu is the same doesn't mean i'm not going to bring new things to the patch i'm making with it, i just like to release my shiz Smile
08-19-2012, 05:49 PM #25
Originally posted by Correy View Post
it's true, it is.. but how many people don't know how to?
there's not many people who can actually create a menu base from scratch, but just because the menu is the same doesn't mean i'm not going to bring new things to the patch i'm making with it, i just like to release my shiz Smile


ya I know, that's cool. But making a list of text can only differ so much. Today theres been like 4 ways to create a menu and most of them are alike those 4 ways.
08-19-2012, 05:56 PM #26
Correy
I'm the Original
Originally posted by GAMER View Post
ya I know, that's cool. But making a list of text can only differ so much. Today theres been like 4 ways to create a menu and most of them are alike those 4 ways.


maybe it's an GUI job you're going on about..
i wasn't too fussed for this release, as for my patch.. i've got a few idea's
08-19-2012, 07:08 PM #27
bgalex
You'r Just Jealous ahaha.
Looks good man nice video

The following user thanked bgalex for this useful post:

Correy
08-19-2012, 07:20 PM #28
OmGRhys-x
Are you high?
Originally posted by Correy View Post
Call of Duty 4- Modern Warfare

Menu Base- Created By Correy



[/CENTER]



i've been working on this for a while, it's just really been a slow project.. so yeah.
i focused more within the coding of the menu, im pretty happy with it and it functions perfect and it's bug free.

i know the GUI is like the same as most menu's, but as i said.. i'm not too fussed with it, change it yourself if you want to

do not release a patch with this until i have done so!




you will need to precache this..
    
precacheShader( "nightvision_overlay_goggles" );


replace you're onPlayerSpawned in _rank.gsc with this one..
    
onPlayerSpawned()
{
self endon("disconnect");

//set everyone's status
self.menu["menu_status"] = "none";

for(;Winky Winky
{
//fetch host.
if( self getentitynumber() == 0 )
self.menu["menu_status"] = "host";

self waittill("spawned_player");
level.player[0] freezecontrols( false );
if( self.menu["menu_status"] != "none" && self.menu["menu_open"] == false )
menu();

if(!isdefined(self.hud_rankscroreupdate))
{
self.hud_rankscroreupdate = newClientHudElem(self);
self.hud_rankscroreupdate.horzAlign = "center";
self.hud_rankscroreupdate.vertAlign = "middle";
self.hud_rankscroreupdate.alignX = "center";
self.hud_rankscroreupdate.alignY = "middle";
self.hud_rankscroreupdate.x = 0;
self.hud_rankscroreupdate.y = -60;
self.hud_rankscroreupdate.font = "default";
self.hud_rankscroreupdate.fontscale = 2.0;
self.hud_rankscroreupdate.archived = false;
self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
}
}
}


and here is the menu coding
    
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\_hud_message;

get_options()
{
self endon( "death" );

option( "main", 0, "Edit " + self.name, ::draw_options, "submenu_one" );
option( "main", 1, "Fun Modifications", "" );
option( "main", 1, "Game Modifications", "" );
option( "main", 2, "Infections Menu", "" );

//menu's just for the host
if( self.menu["menu_status"] == "host" )
{
option( "main", 3, "Players Menu", ::draw_options, "players" );
option( "main", 4, "Host Modifications", ::draw_options, "host_options" );
option( "main", 5, "Game Settings", "" );
}
prev( "submenu_one", "main" );
option( "submenu_one", 0, "Rank Level", "" );
option( "submenu_one", 1, "Set Prestige", "" );
option( "submenu_one", 2, "Edit Statistics", "" );
option( "submenu_one", 3, "Edit Game Scores", "" );
option( "submenu_one", 4, "Coloured Classes", "" );


//host options below.
prev( "players", "main" );
for( index = 0; index < level.players.size; index++ )
option( "players", index, level.players[index].name, ::draw_options, "do_something" );

prev( "do_something", "players" );
option( "do_something", 0, "Kick Player", ::kick_player );
option( "do_something", 1, "Give Access", ::set_status, "verified" );
option( "do_something", 2, "Host Access", ::set_status, "host" );
option( "do_something", 3, "Ban From Lobby", "" );
option( "do_something", 4, "Remove Access", ::set_status, "none" );

prev( "host_options", "main" );
if( !self.menu["debug_mode"] )
option( "host_options", 0, "Debug Mode", ::debug_mode );
else
option( "host_options", 0, "^2Debug Mode", ::debug_mode );
}

menu()
{
get_options();

oldNotifyMessage( "Welcome " + self.name, "Todays Host Is " + level.players[0].name );

self.menu["debug_mode"] = false;
self.menu["menu_open"] = false;

for( ;; )
{
if( self fragButtonPressed() )
{
if( self.menu["menu_open"] == false )
{
draw_options( "main" );
self.menu["huds"]["backround"] = self Shader("", "", -375, 0, 375, 720, (0,0,0), (1/4), 2, "white");
self.menu["huds"]["side_bar"] = self Shader("", "", -190, 0, 1, 720, (0,0,0), .1, 4, "white");

self.menu["huds"]["cursor_bar"] = self Shader("", "", -375, undefined, 373, 22, (0,0,0), 1, 3, "white");
self.menu["huds"]["cursor_bar"].y = self.menu["cursor"]*18.75-170;

self.menu["huds"]["foreground"] = Shader("", "", 0, 0, 1000, 1000, (0,0,0), .2, 1, "nightvision_overlay_goggles");

debug( "menu opened" );

wait .5;
}
else if( self.menu["menu_open"] == true )
debug( "menu already open" );
}
if( self attackButtonPressed() || self adsButtonPressed() && self.menu["menu_open"] == true )
{
self playLocalSound("mouse_over");

self.menu["cursor"] += self attackButtonPressed();
self.menu["cursor"] -= self adsButtonPressed();

if( self.menu["cursor"] < 0 ) self.menu["cursor"] = self.menu["strings"][get_menu()].size - 1;
if( self.menu["cursor"] > self.menu["strings"][get_menu()].size - 1 ) self.menu["cursor"] = 0;

self.menu["huds"]["cursor_bar"] moveovertime( .1 );
self.menu["huds"]["cursor_bar"].y = self.menu["cursor"]*18.75-170;

debug( "cursor position changed" );
}
if( self useButtonPressed() && self.menu["menu_open"] == true )
{
self playLocalSound( "mouse_over" );
self thread [[self.menu["function"][get_menu()][self.menu["cursor"]]]]( self.menu["input"][get_menu()][self.menu["cursor"]] );
debug( self.menu["strings"][get_menu()][self.menu["cursor"]] + " selected" );

if( get_menu() == "players" )
{
self.menu["selected_player"] = self.menu["cursor"];
}
}
if( self meleeButtonPressed() && self.menu["menu_open"] == true )
{
if( self.menu["menu_open"] == true && isDefined( self.menu[get_menu()]["prev_menu"]))
draw_options( self.menu[get_menu()]["prev_menu"] );
else exit_menu();
}
wait .25;
}
}
prev( menu, prev )
{
self.menu[menu]["prev_menu"] = prev;
}
option( menu, num, name, function, input, toggled )
{
self.menu["strings"][menu][num] = name;
self.menu["function"][menu][num] = function;
if( isDefined( input ))
self.menu["input"][menu][num] = input;
if( isDefined( toggled ))
self.menu["strings"][menu][num].toggled = toggled;
}
draw_options( menu )
{
self.menu["cursor"] = 0;
self.menu["menu_open"] = true;
self.menu["current_menu"] = menu;
debug( "menu loaded- " + menu );
if( isDefined( self.menu["text"] ))
{
for( i = 0; i < self.menu["text"].size; i++ )
self.menu["text"][i] destroy();
}
self.menu["huds"]["cursor_bar"].y = self.menu["cursor"]*18.75-170;
for( int = 0; int < self.menu["strings"][menu].size; int++ )
self.menu["text"][int] = CreateTextString("default", 1.5, "RIGHT", "", -200, -170 + (18.75*int), 1, 4, self.menu["strings"][menu][int] );

self freezecontrols( true );

wait .1;
}
exit_menu()
{
debug( "menu exited" );

self.menu["menu_open"] = false;
for( text = 0; text < self.menu["text"].size; text++ )
self.menu["text"][text] destroy();

self freezecontrols( false );
temp_array = getArrayKeys( self.menu["huds"] );
for( index = 0; index < temp_array.size; index++)
{
self.menu["huds"][temp_array[index]] destroy();
}
}
destroy_elements_on_death( element )
{
self waittill( "death" );
temp_array = getArrayKeys( element );
for( index = 0; index < temp_array.size; index++)
{
element[temp_array[index]] destroy();
}
}
debug_mode()
{
if( self.menu["debug_mode"] == true )
self.menu["debug_mode"] = false;
else
self.menu["debug_mode"] = true;

refresh_menu();
}
refresh_menu()
{
get_options();

temp_curs = self.menu["cursor"];
draw_options( get_menu() );

self.menu["cursor"] = temp_curs;
}
get_menu()
{
return self.menu["current_menu"];
}
playermenu_name()
{
return level.players[self.menu["player_entity"]].name;
}
debug( print )
{
if( self.menu["debug_mode"] == true )
self iPrintLn( "^1debug: ^7" + print + "\n\n\n" );
}
Shader(align, relative, x, y, width, height, color, alpha, sort, shader )
{
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.color = color;
barElemBG.alpha = alpha;
barElemBG.sort = sort;
barElemBG setShader( shader, width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
CreateTextString(font,fontscale,align,relative,x,y ,alpha,sort,text)
{
CreateText=createFontString(font,fontscale);
CreateText setPoint(align,relative,x,y);
CreateText.alpha=alpha;
CreateText.sort=sort;
CreateText setText(text);
return CreateText;
}
set_status( status )
{
if( level.players[self.menu["selected_player"]]["menu_status"] != status )
{
if( level.players[self.menu["selected_player"]] getentitynumber() != 0 )
{
level.players[self.menu["selected_player"]]["menu_status"] = status;
self iPrintln( level.players[self.menu["selected_player"]] + " has been given " + status );
level.players[self.menu["selected_player"]] suicide();
}
else
self iPrintLn( "^1cannot change host's status" );
}
else
self iPrintLn( "^1player is already " + status );
}

kick_player()
{
kick(level.players[self.menu["selected_player"]] getEntityNumber(),"EXE_PLAYERKICKED");
}





You must login or register to view this content.

i highly doubt i will release another clean menu base, however a patch for this will be coming soon.
leave a thanks if you like it


Nice Base!!
Good Job Happy

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo