PHP Code:
{
menuDef
{
name "assault_american"
rect 0 0 640 480
focuscolor GLOBAL_FOCUSED_COLOR
style WINDOW_STYLE_EMPTY
blurWorld 5.0
onEsc
{
close assault_american;
}
onOpen
{
show greasegun_info;
show weapon_propertiestext;
show tabungas;
show tabungas_replace;
show frag;
}
onClose
{
hide greasegun_info;
hide thompson_info;
hide shotgun_info;
hide frag;
hide tabungas;
hide tabungas_replace;
}
#include "ui_mp/custom/templates.inc"
DRAWSHADER_NODVAR( "gradient", 0 0, 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN, 1 1 1 .9, "gradient", 1 )
#include "ui/bars.menu"
#include "ui_mp/custom/teamicon_allies.inc"
#include "ui_mp/custom/menu_wireframe.inc"
// #include "ui_mp/custom/sidearm.inc"
#include "ui_mp/custom/allied_special_grenades.inc"
DRAWTEXT_NODVAR( "title", 0 0 50 50 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP, ORIGIN_TITLE, 1 1 1 1, "@Assault Class", 1, UI_FONT_NORMAL, GLOBAL_HEADER_SIZE, 0, 0, ITEM_TEXTSTYLE_SHADOWED )
//********* MENU CHOICES ****************
execKey "1" { play "mouse_click"; scriptMenuResponse "greasegun_mp"; }
execKey "2" { play "mouse_click"; scriptMenuResponse "thompson_mp"; }
execKey "3" { play "mouse_click"; scriptMenuResponse "shotgun_mp"; }
//--- GREASEGUN ----
CHOICE_BUTTON( "button_greasegun", 1, RECTANGLE, ORIGIN_CHOICE1, GLOBAL_UNFOCUSED_COLOR, "@MPUI_1_GREASEGUN", UI_FONT_NORMAL, GLOBAL_TEXT_SIZE, ITEM_TEXTSTYLE_SHADOWED, 20, "ui_allow_greasegun", "1", "greasegun_mp", thompson_info, shotgun_info, "", greasegun_info, weapon_propertiestext )
CHOICE_DIS_BUTTON( "button_greasegun_disabled", 1, RECTANGLE, ORIGIN_CHOICE1, "@MPUI_1_GREASEGUN", UI_FONT_NORMAL, GLOBAL_TEXT_SIZE, ITEM_TEXTSTYLE_SHADOWED, 20, "ui_allow_greasegun", "1", thompson_info, shotgun_info, greasegun_info, weapon_propertiestext, frag, tabungas, tabungas_replace, disabled_info )
//--- THOMPSON ----
CHOICE_BUTTON( "button_thompson", 1, RECTANGLE, ORIGIN_CHOICE2, GLOBAL_UNFOCUSED_COLOR, "@2. Thompson", UI_FONT_NORMAL, GLOBAL_TEXT_SIZE, ITEM_TEXTSTYLE_SHADOWED, 20, "ui_allow_thompson", "1", "thompson_mp", greasegun_info, shotgun_info, "", thompson_info, weapon_propertiestext )
CHOICE_DIS_BUTTON( "button_thompson_disabled", 1, RECTANGLE, ORIGIN_CHOICE2, "@2. Thompson", UI_FONT_NORMAL, GLOBAL_TEXT_SIZE, ITEM_TEXTSTYLE_SHADOWED, 20, "ui_allow_thompson", "1", thompson_info, shotgun_info, greasegun_info, weapon_propertiestext, frag, tabungas, tabungas_replace, disabled_info )
//--- SHOTGUN ----
CHOICE_BUTTON( "button_shotgun", 1, RECTANGLE, ORIGIN_CHOICE3, GLOBAL_UNFOCUSED_COLOR, "@3. M1897 Trench Gun", UI_FONT_NORMAL, GLOBAL_TEXT_SIZE, ITEM_TEXTSTYLE_SHADOWED, 20, "ui_allow_shotgun", "1", "shotgun_mp", greasegun_info, thompson_info, "", shotgun_info, weapon_propertiestext )
CHOICE_DIS_BUTTON( "button_shotgun_disabled", 1, RECTANGLE, ORIGIN_CHOICE3, "@3. M1897 Trench Gun", UI_FONT_NORMAL, GLOBAL_TEXT_SIZE, ITEM_TEXTSTYLE_SHADOWED, 20, "ui_allow_shotgun", "1", thompson_info, shotgun_info, greasegun_info, weapon_propertiestext, frag, tabungas, tabungas_replace, disabled_info )
//*************** PERK ICONS *********************
//--- TABUN GAS ---
DRAWSHADER( "tabungas_perk", ORIGN_PERK_1, PERK_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, .7 .7 .7 .7, "specialty_weapon_tabungas", "scr_demon_allow_tabungas", "1", 1 )
HIDESHADER( "null", ORIGN_PERK_1, PERK_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, .7 .7 .7 .7, "specialty_null", "scr_demon_allow_tabungas", "1", 1 )
//--- STOPPING POWER ---
DRAWSHADER( "stopping_power", ORIGN_PERK_2, PERK_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, .7 .7 .7 .7, "specialty_bulletdamage", "scr_demon_allow_bulletdamage", "1", 1 )
HIDESHADER( "null", ORIGN_PERK_2, PERK_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, .7 .7 .7 .7, "specialty_null", "scr_demon_allow_bulletdamage", "1", 1 )
//--- MARTYRDOM ---
DRAWSHADER( "martyrdom", ORIGN_PERK_3, PERK_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, .7 .7 .7 .7, "specialty_grenadepulldeath", "scr_demon_allow_martyrdom", "1", 1 )
HIDESHADER( "null", ORIGN_PERK_3, PERK_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, .7 .7 .7 .7, "specialty_null", "scr_demon_allow_martyrdom", "1", 1 )
//*************** PERK TEXT ***********************
//--- TABUN GAS ---
DRAWTEXT( "tabungas_perk", DESCRIP_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, PERK_DES_1, 1 1 1 1, "@Tabun Gas", "scr_demon_allow_tabungas", "1", 1, UI_FONT_NORMAL, .18, 7, 7, ITEM_TEXTSTYLE_SHADOWED )
HIDETEXT( "tabungas_perk", DESCRIP_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, PERK_DES_1, 1 1 1 1, "@DISABLED", "scr_demon_allow_tabungas", "1", 1, UI_FONT_NORMAL, .18, 7, 7, ITEM_TEXTSTYLE_SHADOWED )
//--- STOPPING POWER ---
DRAWTEXT( "stopping_power", DESCRIP_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, PERK_DES_2, 1 1 1 1, "@Stopping Power", "scr_demon_allow_bulletdamage", "1", 1, UI_FONT_NORMAL, .18, 7, 0, ITEM_TEXTSTYLE_SHADOWED )
HIDETEXT( "stopping_power", DESCRIP_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, PERK_DES_2, 1 1 1 1, "@DISABLED", "scr_demon_allow_bulletdamage", "1", 1, UI_FONT_NORMAL, .18, 7, 7, ITEM_TEXTSTYLE_SHADOWED )
//--- MARTYRDOM ---
DRAWTEXT( "martyrdom", DESCRIP_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, PERK_DES_3, 1 1 1 1, "@Martyrdom", "scr_demon_allow_martyrdom", "1", 1, UI_FONT_NORMAL, .18, 7, 7, ITEM_TEXTSTYLE_SHADOWED )
HIDETEXT( "martyrdom", DESCRIP_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, PERK_DES_3, 1 1 1 1, "@DISABLED", "scr_demon_allow_martyrdom", "1", 1, UI_FONT_NORMAL, .18, 7, 7, ITEM_TEXTSTYLE_SHADOWED )
//******************* WEAPON IMAGES ********************
//--- GREASEGUN ----
DRAWSHADER_NODVAR( "greasegun_info", ORIGIN_WEAPONIMAGE_1, WEAPONIMAGE_SIZE HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP, 1 1 1 1, "weapon_greasegun", 0 )
//--- THOMPSON ---
DRAWSHADER_NODVAR( "thompson_info", ORIGIN_WEAPONIMAGE_1, WEAPONIMAGE_SIZE HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP, 1 1 1 1, "weapon_thompson", 0 )
//--- SHOTGUN ----
DRAWSHADER_NODVAR( "shotgun_info", ORIGIN_WEAPONIMAGE_1, WEAPONIMAGE_SIZE HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP, 1 1 1 1, "weapon_shotgun", 0 )
//*************** WEAPON PROPERTIES ***************
DRAWTEXT_NODVAR( "weapon_propertiestext", 0 0 20 50 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, ORIGIN_WEAPONPROPERTIESTEXT_1, 1 1 1 1, "@MPUI_ACCURACY_DAMAGE_MOBILITY", 0, UI_FONT_NORMAL, GLOBAL_TEXT_SIZE, 0, 0, ITEM_TEXTSTYLE_SHADOWED )
//--- GREASEGUN ----
DRAWSHADER_NODVAR( "greasegun_info", ORIGIN_WEAPONACCURACY_1, 0 0 128 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 .125, "white", 0 )
DRAWSHADER_NODVAR( "greasegun_info", ORIGIN_WEAPONACCURACY_1, 0 0 70 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 1, "white", 0 )
DRAWSHADER_NODVAR( "greasegun_info", ORIGIN_WEAPONDAMAGE_1, 0 0 128 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 .125, "white", 0 )
DRAWSHADER_NODVAR( "greasegun_info", ORIGIN_WEAPONDAMAGE_1, 0 0 75 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 1, "white", 0 )
DRAWSHADER_NODVAR( "greasegun_info", ORIGIN_WEAPONMOBILITY_1, 0 0 128 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 .125, "white", 0 )
DRAWSHADER_NODVAR( "greasegun_info", ORIGIN_WEAPONMOBILITY_1, 0 0 96 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 1, "white", 0 )
//--- THOMPSON ---
DRAWSHADER_NODVAR( "thompson_info", ORIGIN_WEAPONACCURACY_1, 0 0 128 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 .125, "white", 0 )
DRAWSHADER_NODVAR( "thompson_info", ORIGIN_WEAPONACCURACY_1, 0 0 56 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 1, "white", 0 )
DRAWSHADER_NODVAR( "thompson_info", ORIGIN_WEAPONDAMAGE_1, 0 0 128 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 .125, "white", 0 )
DRAWSHADER_NODVAR( "thompson_info", ORIGIN_WEAPONDAMAGE_1, 0 0 83 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 1, "white", 0 )
DRAWSHADER_NODVAR( "thompson_info", ORIGIN_WEAPONMOBILITY_1, 0 0 128 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 .125, "white", 0 )
DRAWSHADER_NODVAR( "thompson_info", ORIGIN_WEAPONMOBILITY_1, 0 0 96 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 1, "white", 0 )
//---- SHOTGUN ----
DRAWSHADER_NODVAR( "shotgun_info", ORIGIN_WEAPONACCURACY_1, 0 0 128 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 .125, "white", 0 )
DRAWSHADER_NODVAR( "shotgun_info", ORIGIN_WEAPONACCURACY_1, 0 0 35 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 1, "white", 0 )
DRAWSHADER_NODVAR( "shotgun_info", ORIGIN_WEAPONDAMAGE_1, 0 0 128 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 .125, "white", 0 )
DRAWSHADER_NODVAR( "shotgun_info", ORIGIN_WEAPONDAMAGE_1, 0 0 100 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 1, "white", 0 )
DRAWSHADER_NODVAR( "shotgun_info", ORIGIN_WEAPONMOBILITY_1, 0 0 128 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 .125, "white", 0 )
DRAWSHADER_NODVAR( "shotgun_info", ORIGIN_WEAPONMOBILITY_1, 0 0 80 10 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER, 1 1 1 1, "white", 0 )
//******************** SIDEARM ************************
DRAWSHADER( "colt", ORIGIN_PISTOL, PISTOL_IMAGE_SIZE HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, 1 1 1 1, "weapon_colt45", "ui_sidearm_colt", "1", 1 )
DRAWSHADER( "magnum", ORIGIN_PISTOL, 0 4 75 75 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, 1 1 1 1, "weapon_magnum", "ui_sidearm_magnum", "1", 1 )
DRAWSHADER( "knife", ORIGIN_PISTOL, 0 0 95 95 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, 1 1 1 1, "weapon_knife", "ui_sidearm_knife", "1", 1 )
/////////////////// EDIT BUTTON /////////////////////////////
EDIT_BUTTON( "edit_sidearm", 1, PISTOL_RECT HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_CENTER, SIDEARM_EDIT_ORG, EDIT_COLOR, .18, 15, 0, "popup_sidearm" )
//************* MISC BUTTONS *************************
//BACK BUTTON
itemDef
{
#include "ui_mp/button_back.menu"
action
{
play "mouse_click";
close medic_american;
close gunner_american;
close assault_american;
close engineer_american;
close officer_american;
close sniper_american;
open class_allies;
}
mouseEnter
{
play "mouse_over";
}
}
// MAIN MENU
itemDef
{
#include "ui_mp/button_mainmenu.menu"
action
{
play "mouse_click";
close assault_american;
open main;
}
mouseEnter
{
play "mouse_over";
}
}
}
}
And here are the Macros it uses:
PHP Code:
#define EDIT_BUTTON( nameArg, visArg, rectArg, originArg, colorArg, scaleArg, alignYArg, alignXArg, menuArg ) \
itemDef \
{ \
name nameArg \
type ITEM_TYPE_BUTTON \
visible visArg \
rect rectArg \
origin originArg \
forecolor colorArg \
text "@[ CLICK TO EDIT ]" \
textfont UI_FONT_NORMAL \
textscale scaleArg \
textstyle ITEM_TEXTSTYLE_SHADOWED \
textaligny alignYArg \
textalignx alignXArg \
action \
{ \
play "mouse_click"; \
open menuArg; \
} \
mouseEnter \
{ \
play "mouse_over"; \
} \
}\
#define CHOICE_BUTTON( nameArg, visArg, rectArg, originArg, colorArg, textArg, fontArg, scaleArg, styleArg, alignYArg, dvarArg, valueArg, responseArg, hideArg1, hideArg2, hideArg3, showArg1, showArg2 ) \
itemDef \
{ \
name nameArg \
type ITEM_TYPE_BUTTON \
visible visArg \
rect rectArg \
origin originArg \
forecolor colorArg \
text textArg \
textfont fontArg \
textscale scaleArg \
textstyle styleArg \
textaligny alignYArg \
dvartest dvarArg \
showDvar { valueArg } \
action \
{ \
play "mouse_click"; \
scriptMenuResponse responseArg; \
} \
onFocus \
{ \
hide hideArg1; \
hide hideArg2; \
hide hideArg3; \
show showArg1; \
show showArg2; \
} \
mouseEnter \
{ \
play "mouse_over"; \
} \
}
#define CHOICE_DIS_BUTTON( nameArg, visArg, rectArg, originArg, textArg, fontArg, scaleArg, styleArg, alignYArg, dvarArg, valueArg, hideArg1, hideArg2, hideArg3, hideArg4, hideArg5, hideArg6, hideArg7, showArg ) \
itemDef \
{ \
name nameArg \
type ITEM_TYPE_BUTTON \
visible visArg \
rect rectArg \
origin originArg \
forecolor GLOBAL_DISABLED_COLOR \
text textArg \
textfont fontArg \
textscale scaleArg \
textstyle styleArg \
textaligny alignYArg \
dvartest dvarArg \
hideDvar { valueArg } \
decoration \
mouseEnter \
{ \
hide hideArg1; \
hide hideArg2; \
hide hideArg3; \
hide hideArg4; \
hide hideArg5; \
hide hideArg6; \
hide hideArg7; \
hide hideArg8; \
show showArg; \
} \
mouseExit \
{ \
hide showArg; \
show hideArg5; \
show hideArg6; \
show hideArg7; \
} \
}
#define DRAWSHADER( nameArg, originArg, rectArg, colorArg, shaderArg, dvarArg, valueArg, visArg ) \
itemDef \
{ \
name nameArg \
style WINDOW_STYLE_SHADER \
visible visArg \
rect rectArg \
origin originArg \
forecolor colorArg \
background shaderArg \
dvartest dvarArg \
showDvar { valueArg } \
}
#define HIDESHADER( nameArg, originArg, rectArg, colorArg, shaderArg, dvarArg, valueArg, visArg ) \
itemDef \
{ \
name nameArg \
style WINDOW_STYLE_SHADER \
visible visArg \
rect rectArg \
origin originArg \
forecolor colorArg \
background shaderArg \
dvartest dvarArg \
hideDvar { valueArg } \
}
#define DRAWSHADER_NODVAR( nameArg, originArg, rectArg, colorArg, shaderArg, visArg ) \
itemDef \
{ \
name nameArg \
style WINDOW_STYLE_SHADER \
visible visArg \
rect rectArg \
origin originArg \
forecolor colorArg \
background shaderArg \
}
#define DRAWTEXT( nameArg, rectArg, originArg, colorArg, textArg, dvarArg, valueArg, visArg, fontArg, scaleArg, alignYArg, alignXArg, fontStyleArg ) \
itemDef \
{ \
name nameArg \
type ITEM_TYPE_TEXT \
visible visArg \
rect rectArg \
origin originArg \
forecolor colorArg \
text textArg \
textfont fontArg \
textscale scaleArg \
textstyle fontStyleArg \
textaligny alignYArg \
textalignx alignXArg \
dvartest dvarArg \
showDvar { valueArg } \
}
#define HIDETEXT( nameArg, rectArg, originArg, colorArg, textArg, dvarArg, valueArg, visArg, fontArg, scaleArg, alignYArg, alignXArg, fontStyleArg ) \
itemDef \
{ \
name nameArg \
type ITEM_TYPE_TEXT \
visible visArg \
rect rectArg \
origin originArg \
forecolor colorArg \
text textArg \
textfont fontArg \
textscale scaleArg \
textstyle fontStyleArg \
textaligny alignYArg \
textalignx alignXArg \
dvartest dvarArg \
hideDvar { valueArg } \
}
#define DRAWTEXT_NODVAR( nameArg, rectArg, originArg, colorArg, textArg, visArg, fontArg, scaleArg, alignYArg, alignXArg, fontStyleArg ) \
itemDef \
{ \
name nameArg \
type ITEM_TYPE_TEXT \
visible visArg \
rect rectArg \
origin originArg \
forecolor colorArg \
text textArg \
textfont fontArg \
textscale scaleArg \
textstyle fontStyleArg \
textaligny alignYArg \
textalignx alignXArg \
}
Which produces the rather beautiful (if I don't say so myself) Assault Class menu: