253 lines
14 KiB
Text
253 lines
14 KiB
Text
|
#include "ui/menudef.h"
|
||
|
#include "ui_mp/common_macro.inc"
|
||
|
|
||
|
#define CHOICE_SIZE_X //150
|
||
|
#define CHOICE_SIZE_Y 22
|
||
|
|
||
|
#ifdef CONSOLE
|
||
|
#define CHOICE_X_START 0
|
||
|
#define CHOICE_Y_START 34
|
||
|
#else
|
||
|
#define CHOICE_X_START 30
|
||
|
#define CHOICE_Y_START 40
|
||
|
#endif
|
||
|
|
||
|
#define CHOICE_SEP_OFFSET_Y -2
|
||
|
#define CHOICE_SEP_1 5
|
||
|
|
||
|
//#define CHOICE_SEP_1 2
|
||
|
|
||
|
#include "ui_mp/menustyle.inc"
|
||
|
#include "ui/choices_setup_common.menu"
|
||
|
|
||
|
#define PC_INGAME
|
||
|
#include "ui_mp/overlaybg.inc"
|
||
|
|
||
|
#define MENU_LOCKED_COLOR 0.25 0.25 0.25 1
|
||
|
|
||
|
#define ORIGIN_BUTTON_BACK 52 438
|
||
|
#define ORIGIN_MENU_TREE 54 64
|
||
|
#define ORIGIN_MENU_TITLE_MARINES 178 64
|
||
|
#define ORIGIN_MENU_TITLE_OPFOR 170 64
|
||
|
#define TREE_COLOR 1 1 1 0.5
|
||
|
#define LABEL_TEXT_COLOR 0.7 0.75 0.75 1
|
||
|
|
||
|
#define HIGH_BOUND "1000"
|
||
|
|
||
|
#undef NEW_X_OFFSET
|
||
|
#define NEW_X_OFFSET (-CHOICE_SIZE_Y)
|
||
|
|
||
|
// ------
|
||
|
|
||
|
#define STAT_XP statGetInDvarUsingTable( 2301, ui_stat_rankxp );
|
||
|
|
||
|
{
|
||
|
menuDef
|
||
|
{
|
||
|
name "changeclass"
|
||
|
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
|
||
|
focuscolor COLOR_FOCUSED
|
||
|
style WINDOW_STYLE_EMPTY
|
||
|
#ifdef CONSOLE
|
||
|
blurWorld 7.0
|
||
|
#endif
|
||
|
onOpen
|
||
|
{
|
||
|
// update player's XP
|
||
|
STAT_XP
|
||
|
|
||
|
execnow "set ui_class_offset 200; set ui_multi_s "HIGH_BOUND"; set ui_multi_dt 0";
|
||
|
setfocusbydvar "ui_customclass_selected";
|
||
|
//focusFirst
|
||
|
}
|
||
|
onEsc
|
||
|
{
|
||
|
scriptMenuResponse "back";
|
||
|
}
|
||
|
|
||
|
#ifndef PC
|
||
|
execkeyint BUTTON_START
|
||
|
{
|
||
|
close self;
|
||
|
}
|
||
|
#endif
|
||
|
#ifdef PC
|
||
|
BACKGROUND_BLACK_LETTERBOX_BLURWORLD( 1.0 )
|
||
|
OVERLAY_BACKGROUND
|
||
|
#else
|
||
|
itemDef {
|
||
|
style WINDOW_STYLE_FILLED
|
||
|
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
|
||
|
backcolor 0 0 0 .75 //0 0.05 0.15 0.5
|
||
|
visible 1
|
||
|
decoration
|
||
|
}
|
||
|
// gradient_top
|
||
|
itemDef {
|
||
|
style WINDOW_STYLE_SHADER
|
||
|
rect 0 0 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0
|
||
|
background "gradient_top"
|
||
|
visible 1
|
||
|
decoration
|
||
|
}
|
||
|
// gradient_bottom
|
||
|
itemDef {
|
||
|
style WINDOW_STYLE_SHADER
|
||
|
rect 0 410 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0
|
||
|
background "gradient_bottom"
|
||
|
visible 1
|
||
|
decoration
|
||
|
}
|
||
|
#endif // background overlay
|
||
|
|
||
|
// ------------------ TREE TITLE ------------------
|
||
|
|
||
|
CHOICE_MENU_TITLE_NO_STRIP( "@MPUI_CHOOSE_CLASS_CAP" )
|
||
|
|
||
|
// ------------------ buttons ---------------------
|
||
|
#define BACK_OPEN close self;
|
||
|
#include "ui_mp/navcontrols.inc"
|
||
|
|
||
|
//=========================================================================
|
||
|
//================ MENU SELECTION FOR ONLINE/OFFLINE GAME =================
|
||
|
//=========================================================================
|
||
|
|
||
|
/*
|
||
|
#ifdef PC
|
||
|
#define ONLINE_MODE ( dvarBool(onlinegame) )
|
||
|
#define OFFLINE_MODE ( !dvarBool(onlinegame) )
|
||
|
#else // #ifdef PC
|
||
|
#define ONLINE_MODE ( !dvarBool(splitscreen) && !dvarBool(systemlink) )
|
||
|
#define OFFLINE_MODE ( dvarBool(splitscreen) || dvarBool(systemlink) )
|
||
|
#endif // #else // #ifdef PC
|
||
|
*/
|
||
|
|
||
|
/* =================================== default classes ================================= */
|
||
|
|
||
|
// PC widescreen fix
|
||
|
//#ifdef PC
|
||
|
// #undef CHOICE_X_START
|
||
|
// #define CHOICE_X_START -320
|
||
|
//
|
||
|
// #undef CHOICE_HORIZONTAL_ALIGN
|
||
|
// #define CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER
|
||
|
//#endif
|
||
|
|
||
|
#define PRESTIGE 2326
|
||
|
#define CUSTOM_OPEN 260
|
||
|
|
||
|
#define FOCUS_CHECK( pnum ) \
|
||
|
dvartest "ui_customclass_selected" focusdvar { pnum }
|
||
|
|
||
|
#define ACTION_COMMON( pnum ) \
|
||
|
setDvar ui_customclass_selected pnum;
|
||
|
|
||
|
CHOICE_BUTTON_FOCUS_VIS_EX_ADV( 1, dvarString( customclass1 ), scriptMenuResponse "custom1,0"; ACTION_COMMON( 6 ), setdvar ui_custom_class_highlighted "0"; exec "set ui_multi_s 0; set ui_multi_dt "HIGH_BOUND;, ;, when( stat(CUSTOM_OPEN) >= 1 ), FOCUS_CHECK( 6 ), stat(CUSTOM_OPEN) >= 1 )
|
||
|
CHOICE_DBUTTON_VIS( 1, dvarString( customclass1 ), when( stat( CUSTOM_OPEN ) < 1 ) )
|
||
|
|
||
|
CHOICE_BUTTON_FOCUS_VIS_EX_ADV( 2, dvarString( customclass2 ), scriptMenuResponse "custom2,0"; ACTION_COMMON( 7 ), setdvar ui_custom_class_highlighted "10"; exec "set ui_multi_s 0; set ui_multi_dt "HIGH_BOUND;, ;, when( stat(CUSTOM_OPEN) >= 1 ), FOCUS_CHECK( 7 ), stat(CUSTOM_OPEN) >= 1 )
|
||
|
CHOICE_DBUTTON_VIS( 2, dvarString( customclass2 ), when( stat( CUSTOM_OPEN ) < 1 ) )
|
||
|
|
||
|
CHOICE_BUTTON_FOCUS_VIS_EX_ADV( 3, dvarString( customclass3 ), scriptMenuResponse "custom3,0"; ACTION_COMMON( 8 ), setdvar ui_custom_class_highlighted "20"; exec "set ui_multi_s 0; set ui_multi_dt "HIGH_BOUND;, ;, when( stat(CUSTOM_OPEN) >= 1 ), FOCUS_CHECK( 8 ), stat(CUSTOM_OPEN) >= 1 )
|
||
|
CHOICE_DBUTTON_VIS( 3, dvarString( customclass3 ), when( stat( CUSTOM_OPEN ) < 1 ) )
|
||
|
|
||
|
CHOICE_BUTTON_FOCUS_VIS_EX_ADV( 4, dvarString( customclass4 ), scriptMenuResponse "custom4,0"; ACTION_COMMON( 9 ), setdvar ui_custom_class_highlighted "30"; exec "set ui_multi_s 0; set ui_multi_dt "HIGH_BOUND;, ;, when( stat(CUSTOM_OPEN) >= 1 ), FOCUS_CHECK( 9 ), stat(CUSTOM_OPEN) >= 1 )
|
||
|
CHOICE_DBUTTON_VIS( 4, dvarString( customclass4 ), when( stat( CUSTOM_OPEN ) < 1 ) )
|
||
|
|
||
|
CHOICE_BUTTON_FOCUS_VIS_EX_ADV( 5, dvarString( customclass5 ), scriptMenuResponse "custom5,0"; ACTION_COMMON( 10 ), setdvar ui_custom_class_highlighted "40"; exec "set ui_multi_s 0; set ui_multi_dt "HIGH_BOUND;, ;, when( stat(CUSTOM_OPEN) >= 1 ), FOCUS_CHECK( 10 ), stat(CUSTOM_OPEN) >= 1 )
|
||
|
CHOICE_DBUTTON_VIS( 5, dvarString( customclass5 ), when( stat( CUSTOM_OPEN ) < 1 ) )
|
||
|
|
||
|
CHOICE_SEPARATOR( CHOICE_SEP_1 )
|
||
|
|
||
|
CHOICE_BUTTON_BG( 6, 1 )
|
||
|
CHOICE_HIGHLIGHT( 6, 1 )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 6, "@CLASS_CLASS1", scriptMenuResponse "assault_mp,0"; ACTION_COMMON( 1 ), execnow "set ui_class_offset 200; set ui_multi_s "HIGH_BOUND"; set ui_multi_dt 0", ;, when( (stat( CUSTOM_OPEN ) < 1 || stat(PRESTIGE) == 0 ) && !dvarBool( presell ) ), FOCUS_CHECK( 1 ) )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 6, "@CLASS_CLASS1", scriptMenuResponse "assault_mp,1"; ACTION_COMMON( 1 ), execnow "set ui_class_offset 200; set ui_multi_s "HIGH_BOUND"; set ui_multi_dt 0", ;, when( (stat( CUSTOM_OPEN ) < 1 || stat(PRESTIGE) == 0 ) && dvarBool( presell ) ), FOCUS_CHECK( 1 ) )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 6, dvarString( prestigeclass1 ), scriptMenuResponse "prestige1,0"; ACTION_COMMON( 11 ), setdvar ui_custom_class_highlighted "1000"; exec "set ui_multi_s 0; set ui_multi_dt "HIGH_BOUND;, ;, when( (stat(PRESTIGE) > 0 && ( stat( CUSTOM_OPEN ) >= 1 ) ) ), FOCUS_CHECK( 11 ) )
|
||
|
|
||
|
CHOICE_BUTTON_BG( 7, 1 )
|
||
|
CHOICE_HIGHLIGHT( 7, 1 )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 7, "@CLASS_CLASS2", scriptMenuResponse "specops_mp,0"; ACTION_COMMON( 2 ), execnow "set ui_class_offset 210; set ui_multi_s "HIGH_BOUND"; set ui_multi_dt 0", ;, when( stat( CUSTOM_OPEN ) < 1 || stat(PRESTIGE) < 2 ), FOCUS_CHECK( 2 ) )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 7, dvarString( prestigeclass2 ), scriptMenuResponse "prestige2,0"; ACTION_COMMON( 12 ), setdvar ui_custom_class_highlighted "1010"; exec "set ui_multi_s 0; set ui_multi_dt "HIGH_BOUND;, ;, when( (stat(PRESTIGE) > 1 && ( stat( CUSTOM_OPEN ) >= 1 ) ) ), FOCUS_CHECK( 12 ) )
|
||
|
|
||
|
CHOICE_BUTTON_BG( 8, 1 )
|
||
|
CHOICE_HIGHLIGHT( 8, 1 )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 8, "@CLASS_CLASS3", scriptMenuResponse "heavygunner_mp,0"; ACTION_COMMON( 3 ), execnow "set ui_class_offset 220; set ui_multi_s "HIGH_BOUND"; set ui_multi_dt 0", ;, when( (stat( CUSTOM_OPEN ) < 1 || stat(PRESTIGE) < 4 ) && !dvarbool( collectors ) ), FOCUS_CHECK( 3 ) )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 8, "@CLASS_CLASS3", scriptMenuResponse "heavygunner_mp,2"; ACTION_COMMON( 3 ), execnow "set ui_class_offset 220; set ui_multi_s "HIGH_BOUND"; set ui_multi_dt 0", ;, when( (stat( CUSTOM_OPEN ) < 1 || stat(PRESTIGE) < 4 ) && dvarbool( collectors ) ), FOCUS_CHECK( 3 ) )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 8, dvarString( prestigeclass3 ), scriptMenuResponse "prestige3,0"; ACTION_COMMON( 13 ), setdvar ui_custom_class_highlighted "1020"; exec "set ui_multi_s 0; set ui_multi_dt "HIGH_BOUND;, ;, when( (stat(PRESTIGE) > 3 && ( stat( CUSTOM_OPEN ) >= 1 ) ) ), FOCUS_CHECK( 13 ) )
|
||
|
|
||
|
CHOICE_BUTTON_FOCUS_VIS_EX( 9, "@CLASS_CLASS4", scriptMenuResponse "demolitions_mp,0"; ACTION_COMMON( 4 ), execnow "set ui_class_offset 230; set ui_multi_s "HIGH_BOUND"; set ui_multi_dt 0", ;, when( stat(257) >= 1 && ( stat(PRESTIGE) < 7 || (stat( CUSTOM_OPEN ) < 1 && stat(PRESTIGE) > 6) ) ), FOCUS_CHECK( 4 ) )
|
||
|
CHOICE_DBUTTON_VIS( 9, "@CLASS_CLASS4", when( stat( 257 ) < 1 ) )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 9, dvarString( prestigeclass4 ), scriptMenuResponse "prestige4,0";ACTION_COMMON( 14 ), setdvar ui_custom_class_highlighted "1030"; exec "set ui_multi_s 0; set ui_multi_dt "HIGH_BOUND;, ;, when( stat(CUSTOM_OPEN) >= 1 && stat(PRESTIGE) > 6 ), FOCUS_CHECK( 14 ) )
|
||
|
CHOICE_NEWICON_VIS( 9, "specialty_new", when( stat( 257 ) > 1 ) )
|
||
|
|
||
|
CHOICE_BUTTON_FOCUS_VIS_EX( 10, "@CLASS_CLASS5", scriptMenuResponse "sniper_mp,0"; ACTION_COMMON( 5 ), execnow "set ui_class_offset 240; set ui_multi_s "HIGH_BOUND"; set ui_multi_dt 0";, ;, when( stat(258) >= 1 && ( stat(PRESTIGE) < 10 || (stat( CUSTOM_OPEN ) < 1 && stat(PRESTIGE) > 9) ) ), FOCUS_CHECK( 5 ) )
|
||
|
CHOICE_DBUTTON_VIS( 10, "@CLASS_CLASS5", when( stat( 258 ) < 1 ) )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 10, dvarString( prestigeclass5 ), scriptMenuResponse "prestige5,0"; ACTION_COMMON( 15 ), setdvar ui_custom_class_highlighted "1040"; exec "set ui_multi_s 0; set ui_multi_dt "HIGH_BOUND;, ;, when( stat(CUSTOM_OPEN) >= 1 && stat(PRESTIGE) > 9 ), FOCUS_CHECK( 15 ) )
|
||
|
CHOICE_NEWICON_VIS( 10, "specialty_new", when( stat( 258 ) > 1 ) )
|
||
|
|
||
|
#define DATA_TABLE_PRIMARY_GRENADE int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+0), 5 ))
|
||
|
#define DATA_TABLE_PRIMARY int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+1), 5 + dvarInt("primaryWeaponOffset") ))
|
||
|
#define DATA_TABLE_PRIMARY_ATTACHMENT int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+2), 5 ))
|
||
|
#define DATA_TABLE_SECONDARY int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+3), 5 ))
|
||
|
#define DATA_TABLE_SECONDARY_ATTACHMENT int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+4), 5 ))
|
||
|
#define DATA_TABLE_SPECIALTY_EQUIPMENT int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+5), 5 ))
|
||
|
#define DATA_TABLE_SPECIALTY_WEAPON int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+6), 5 ))
|
||
|
#define DATA_TABLE_SPECIALTY_ABILITY int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+7), 5 ))
|
||
|
#define DATA_TABLE_SPECIAL_GRENADE int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+8), 5 ))
|
||
|
#define DATA_TABLE_CAMO int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+9), 5 ))
|
||
|
#define DATA_TABLE_SPECIALTY_VEHICLE int(tablelookup( "mp/classTable.csv", 1, (dvarInt("ui_class_offset")+105), 5 ))
|
||
|
|
||
|
/* ==================================== custom classes ============================================= */
|
||
|
|
||
|
#define STATS_PRIMARY_GRENADE stat( dvarInt( ui_custom_class_highlighted ) + 200 )
|
||
|
#define STATS_PRIMARY stat( dvarInt( ui_custom_class_highlighted ) + 201 )
|
||
|
#define STATS_RIMARY_ATTACHMENT stat( dvarInt( ui_custom_class_highlighted ) + 202 )
|
||
|
#define STATS_SECONDARY stat( dvarInt( ui_custom_class_highlighted ) + 203 )
|
||
|
#define STATS_SECONDARY_ATTACHMENT stat( dvarInt( ui_custom_class_highlighted ) + 204 )
|
||
|
#define STATS_SPECIALTY_EQUIPMENT stat( dvarInt( ui_custom_class_highlighted ) + 205 )
|
||
|
#define STATS_SPECIALTY_WEAPON stat( dvarInt( ui_custom_class_highlighted ) + 206 )
|
||
|
#define STATS_SPECIALTY_ABILITY stat( dvarInt( ui_custom_class_highlighted ) + 207 )
|
||
|
#define STATS_SPECIAL_GRENADE stat( dvarInt( ui_custom_class_highlighted ) + 208 )
|
||
|
#define STATS_CAMO stat( dvarInt( ui_custom_class_highlighted ) + 209 )
|
||
|
#define STATS_SPECIALTY_VEHICLE stat( dvarInt( ui_custom_class_highlighted ) + 305 )
|
||
|
|
||
|
#include "ui/safearea.menu"
|
||
|
|
||
|
/* ================================================================================= */
|
||
|
/* ================================ LOADOUT DISPLAY ================================ */
|
||
|
/* ================================================================================= */
|
||
|
|
||
|
#define STAT_CAC_PRIMARY_GRENADE int(min( STATS_PRIMARY_GRENADE+dvarInt(ui_multi_s), DATA_TABLE_PRIMARY_GRENADE+dvarInt(ui_multi_dt) ))
|
||
|
#define STAT_CAC_PRIMARY int(min( STATS_PRIMARY+dvarInt(ui_multi_s), DATA_TABLE_PRIMARY+dvarInt(ui_multi_dt) ))
|
||
|
#define STAT_CAC_PRIMARY_ATTACHMENT int(min( STATS_RIMARY_ATTACHMENT+dvarInt(ui_multi_s), DATA_TABLE_PRIMARY_ATTACHMENT+dvarInt(ui_multi_dt) ))
|
||
|
#define STAT_CAC_SECONDARY int(min( STATS_SECONDARY+dvarInt(ui_multi_s), DATA_TABLE_SECONDARY+dvarInt(ui_multi_dt) ))
|
||
|
#define STAT_CAC_SECONDARY_ATTACHMENT int(min( STATS_SECONDARY_ATTACHMENT+dvarInt(ui_multi_s), DATA_TABLE_SECONDARY_ATTACHMENT+dvarInt(ui_multi_dt) ))
|
||
|
#define STAT_CAC_SPECIALTY_EQUIPMENT int(min( STATS_SPECIALTY_EQUIPMENT+dvarInt(ui_multi_s), DATA_TABLE_SPECIALTY_EQUIPMENT+dvarInt(ui_multi_dt) ))
|
||
|
#define STAT_CAC_SPECIALTY_WEAPON int(min( STATS_SPECIALTY_WEAPON+dvarInt(ui_multi_s), DATA_TABLE_SPECIALTY_WEAPON+dvarInt(ui_multi_dt) ))
|
||
|
#define STAT_CAC_SPECIALTY_ABILITY int(min( STATS_SPECIALTY_ABILITY+dvarInt(ui_multi_s), DATA_TABLE_SPECIALTY_ABILITY+dvarInt(ui_multi_dt) ))
|
||
|
#define STAT_CAC_SPECIAL_GRENADE int(min( STATS_SPECIAL_GRENADE+dvarInt(ui_multi_s), DATA_TABLE_SPECIAL_GRENADE+dvarInt(ui_multi_dt) ))
|
||
|
#define STAT_CAC_CAMO int(min( STATS_CAMO+dvarInt(ui_multi_s), DATA_TABLE_CAMO+dvarInt(ui_multi_dt) ))
|
||
|
#define STAT_CAC_SPECIALTY_VEHICLE int(min( STATS_SPECIALTY_VEHICLE+dvarInt(ui_multi_s), DATA_TABLE_SPECIALTY_VEHICLE+dvarInt(ui_multi_dt) ))
|
||
|
|
||
|
// enable positioning tweaks
|
||
|
#define REPOSITIONING 1
|
||
|
|
||
|
#define WEAPON_X 300
|
||
|
#define WEAPON_Y 72
|
||
|
#define WEAPON_SIZEX 311
|
||
|
#define WEAPON_SIZEY 180
|
||
|
#define WEAPON_ORIGIN WEAPON_X WEAPON_Y
|
||
|
|
||
|
#define INV_X 300
|
||
|
#define INV_Y 260
|
||
|
#define INV_SIZEX 311
|
||
|
#define INV_SIZEY 146
|
||
|
#define INV_ORIGIN INV_X INV_Y
|
||
|
|
||
|
#define HIDE_WEAPON_ATTRIBUTE 1
|
||
|
#include "ui_mp/cac_loadout.inc"
|
||
|
CAC_LOADOUT_NORMAL
|
||
|
}
|
||
|
}
|