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-19-2012, 08:26 PM #29
Originally posted by Correy View Post
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


GUI, and the "internal" coding.

I mean it's just button monitoring, variables, and a way to draw the menu :p
08-19-2012, 08:29 PM #30
Correy
I'm the Original
Originally posted by GAMER View Post
GUI, and the "internal" coding.

I mean it's just button monitoring, variables, and a way to draw the menu :p


who said i haven't changed this menu. Winky Winky ?
08-19-2012, 08:32 PM #31
Originally posted by Correy View Post
who said i haven't changed this menu. Winky Winky ?


looks like elite modz style. You fill up the menu, and then you draw based off of what menu is in your variables. I'm not going to blame you, and I'm really not trying to be an ass, but it is all the same really. We need a new system of doing things. What I think new picture, I think something not even menu like. Happy

The following user thanked Jakes625 for this useful post:

Correy
08-19-2012, 08:42 PM #32
Correy
I'm the Original
Originally posted by GAMER View Post
looks like elite modz style. You fill up the menu, and then you draw based off of what menu is in your variables. I'm not going to blame you, and I'm really not trying to be an ass, but it is all the same really. We need a new system of doing things. What I think new picture, I think something not even menu like. Happy


lets start fucking up the .zone. :happycry:
08-19-2012, 10:29 PM #33
Originally posted by Correy View Post
lets start fucking up the .zone. :happycry:


already fucked up.. xD

and anything aside from rawfiles are client side.
08-19-2012, 10:42 PM #34
Tony Stark
Do a barrel roll!
Uhh...
It's fucking AWESOME ! Well work !
08-22-2012, 08:24 PM #35
T RAW
Gym leader
Good patch and thanks for the codes!
08-23-2012, 01:29 PM #36
TOM DAINTY
Do a barrel roll!
Great work Correy. I love it Happy

The following 4 users say thank you to TOM DAINTY for this useful post:

Correy, Raul Villaman, Simple-_-Modz, Special-Modding
08-24-2012, 01:56 AM #37
thank you for

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo