cod5-sdk/raw/ui_mp/main.menu

214 lines
8.1 KiB
Text
Raw Normal View History

2008-11-20 00:00:00 +00:00
// MP MAIN MENU
#include "ui/menudef.h"
#include "ui_mp/common_macro.inc"
#define LOGO_START_X -300
#define LOGO_START_Y -160
#define CHOICE_Y_START 50
#define CHOICE_X_START 30
#define SIGNED_IN_RECT -350 60 250 15
#define CHOICE_GROUP "main"
#define CHOICE_SEP_1 4
#define CHOICE_SEP_2 7
#define CHOICE_SEP_3 10
#define STYLE_PC 1
#include "ui_mp/menustyle.inc"
#include "ui/choices_setup_common.menu"
#include "ui_mp/stats_info.inc"
#include "ui/online_status.inc"
{
assetGlobalDef
{
fadeClamp 1.0 // sets the fadeup alpha
fadeCycle 1 // how often fade happens in milliseconds
fadeAmount 0.1 // amount to adjust alpha per cycle
}
menuDef
{
name "main"
fullScreen 1
rect 0 0 640 480
focusColor COLOR_FOCUSED
soundloop "music_mainmenu"
onOpen
{
// IW COD4 version:
//open main_text;
//uiScript addPlayerProfiles;
//uiScript openMenuOnDvar com_playerProfile "" player_profile;
//uiScript openMenuOnDvarNot ui_playerProfileCount 1 player_profile;
//uiScript stopRefresh;
open main_text;
uiScript openMainMenuPlayerProfileScriptCallback;
uiScript stopRefresh;
}
}
menuDef
{
name "main_text"
fullScreen 1
rect 0 0 640 480
focusColor COLOR_FOCUSED
soundloop "music_mainmenu"
onOpen
{
//exec "selectStringTableEntryInDvar mp/didyouknow.csv 0 didyouknow";
setdvar ui_mulitplayer_menu "1";
//exec "ui_cinematic front_end_mp 3";
//execondvarintvalue ui_close_main 1 "closemenu main_text";
// temp CAC (for dev only)
//exec "set customclass1 @CLASS_CLASS1";
//exec "set customclass2 @CLASS_CLASS2";
//exec "set customclass3 @CLASS_CLASS3";
//exec "set customclass4 @CLASS_CLASS4";
//exec "set customclass5 @CLASS_CLASS5";
}
// Menu items -------------------------------------------
#include "ui_mp/blurredbg.inc"
CHOICE_MENU_TITLE( "@MENU_MULTIPLAYER" )
// cod:mw logo
itemDef
{
visible 1
rect LOGO_START_X LOGO_START_Y 256 64 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_BOTTOM
forecolor 1 1 1 1
style WINDOW_STYLE_SHADER
background "logo_cod2"
visible when( !localvarBool( ui_hideBack ) );
decoration
}
// draws signin status
SIGNIN_STATUS
#define SETUP_ACTION_CREATEACLASS \
statSetUsingTable( 260, 1 ); \
play "mouse_click"; \
open cac_main;
#define SETUP_ACTION_PRESTIGEMODE \
open prestige_reset1
#define CLEARUIHINT exec "set ui_hint_text @MP_NULL"
CHOICE_BUTTON_VIS( 1, "@MENU_AUTO_UPDATE", open auconfirm;, when( dvarbool( cl_updateAvailable ) && !localvarBool( ui_hideBack ) ) )
CHOICE_BUTTON_VIS( 2, "@MENU_FIND_GAME", close self; open pc_join_unranked;, when( !localvarBool( ui_hideBack ) ) )
CHOICE_BUTTON_VIS( 3, "@MENU_START_NEW_SERVER", close self; open createserver;, when( !localvarBool( ui_hideBack ) ) )
#ifdef PC
CHOICE_BUTTON_VIS( 4, "@MENU_SOLO_COOP_MENU", open single_popmenu;, when( !localvarBool( ui_hideBack ) ) )
#else // #ifdef PC
CHOICE_BUTTON_VIS( 4, "@MENU_SINGLE_PLAYER", open single_popmenu;, when( !localvarBool( ui_hideBack ) ) )
#endif // #ifdef PC
CHOICE_SEPARATOR_VIS( CHOICE_SEP_1, when( !localvarBool( ui_hideBack ) ) )
CHOICE_BUTTON_FOCUS_VIS_ADV( 5, "@MPUI_CREATE_A_CLASS", SETUP_ACTION_CREATEACLASS, exec "set ui_hint_text @MPUI_DESC_CREATE_A_CLASS", CLEARUIHINT, when( !localvarBool( ui_hideBack ) && stat( 260 ) >= 1 ), !localvarBool( ui_hideBack ) && stat( 260 ) >= 1 )
CHOICE_BUTTON_FOCUS_VIS_NOHI( 5, "", ;, exec "set ui_hint_text @MPUI_DESC_CREATE_A_CLASS_LOCKED", CLEARUIHINT, when(!localvarBool( ui_hideBack ) && stat( 260 ) < 1 ) )
CHOICE_DBUTTON_VIS( 5, "@MPUI_CREATE_A_CLASS", when( !localvarBool( ui_hideBack ) && stat( 260 ) < 1 ) )
CHOICE_NEWICON_VIS( 5, "specialty_new", when( !localvarBool( ui_hideBack ) && ANY_NEW_CAC ) )
CHOICE_LOCKEDICON_VIS( 5, "specialty_locked", when( !localvarBool( ui_hideBack ) && stat( 260 ) < 1 ) )
CHOICE_BUTTON_FOCUS_VIS_ADV( 6, "@MPUI_PRESTIGE_MODE", SETUP_ACTION_PRESTIGEMODE, statSetUsingTable( 267, 1 );, CLEARUIHINT, when( !localvarBool( ui_hideBack ) && PRESTIGE_AVAIL ), !localvarBool( ui_hideBack ) && PRESTIGE_AVAIL )
CHOICE_BUTTON_FOCUS_VIS_NOHI( 6, "", ;, exec "set ui_hint_text @MPUI_DESC_PRESTIGE2; set ui_show_arrow 1", CLEARUIHINT, when( !localvarBool( ui_hideBack ) && PRESTIGE_AVAIL==0 && PRESTIGE_FINISH==0 ) )
CHOICE_DBUTTON_VIS( 6, "@MPUI_PRESTIGE_MODE", when( !localvarBool( ui_hideBack ) && PRESTIGE_AVAIL == 0 && PRESTIGE_FINISH == 0 ) )
CHOICE_NEWICON_VIS( 6, "specialty_new", when( !localvarBool( ui_hideBack ) && PRESTIGE_AVAIL && stat( 267 )==0 ) )
CHOICE_LOCKEDICON_VIS( 6, "specialty_locked", when( !localvarBool( ui_hideBack ) && PRESTIGE_AVAIL == 0 && PRESTIGE_FINISH == 0 ) )
CHOICE_BUTTON_VIS( 7, "@MENU_RANK_AND_CHALLENGES_CAP", open menu_challenges;, when( !localvarBool( ui_hideBack ) ) )
CHOICE_SEPARATOR_VIS( CHOICE_SEP_2, when( !localvarBool( ui_hideBack ) ) )
CHOICE_BUTTON_VIS( 8, "@MENU_SELECT_ONLINE_PROFILE", execOnDvarIntValue dw_loggedin 0 "dwconnect"; setdvar ui_playerProfileAlreadyChosen 0; open player_profile, when( !localvarBool( ui_hideBack ) ); )
CHOICE_BUTTON_VIS( 9, "@MENU_FRIENDS_CAP", open menu_pc_friends;, when( !localvarBool( ui_hideBack ) ); )
CHOICE_NEWICON_VIS( 9, "specialty_new", when( hasinvites() || haspendingfriends() ); )
CHOICE_BUTTON_VIS( 10, "@MENU_OPTIONS_CONTROLS_CAP", open options_new_pc;, when( !localvarBool( ui_hideBack ) ); )
CHOICE_SEPARATOR_VIS( CHOICE_SEP_3, when( !localvarBool( ui_hideBack ) ) )
CHOICE_BUTTON_VIS( 11, "@MENU_MODS", open mods_menu;, when( !localvarBool( ui_hideBack ) ) )
CHOICE_BUTTON_VIS( 12, "@MENU_QUIT", open quit_popmenu;, when( !localvarBool( ui_hideBack ) ) )
CHOICE_FOOTNOTE_VIS( "@MENU_GAME_EXPERIENCE_MAY_CHANGE", 40, 430, when( !localvarBool( ui_hideBack ) && !localvarBool( ui_inOverlay ) ) )
}
#include "ui_mp/popupstyle.inc"
#include "ui/choices_setup_popmenu.menu"
// ====================== single player confirmation =========================
#undef CHOICE_SIZE_X
#define CHOICE_SIZE_X 180
#undef CHOICE_Y_START
#define CHOICE_Y_START 230
#undef CHOICE_X_START
#define CHOICE_X_START 78
menuDef
{
CENTER_POPUP_SETUP( single_popmenu, 3, ;, 1 )
#ifndef PC
CHOICE_POPMENU_TITLE( "@MENU_SWITCH_TO_SINGLE_PLAYER" )
#else // #ifndef PC
CHOICE_POPMENU_TITLE( "@MENU_SWITCH_TO_SOLO_COOP_MENU" )
#endif // #ifndef PC
CHOICE_BUTTON( 2, "@MENU_YES", uiScript startsingleplayer )
CHOICE_BUTTON( 3, "@MENU_NO", close self )
}
menuDef
{
CENTER_POPUP_SETUP_ONOPEN( prestige_reset1, 3, ;, setfocus cancel_button, 1 )
CHOICE_POPMENU_TITLE( "@MENU_PRESTIGE_RESET_TITLE1" )
CHOICE_POPMENU_SUBTITLE( "@MENU_PRESTIGE_RESET_WARNING1" )
CHOICE_BUTTON( 3, "@MENU_PRESTIGE_RESET_TITLE2", close prestige_reset1; open prestige_reset2 )
CHOICE_BUTTON_EX( 4, "@MENU_CANCEL", close prestige_reset1, name cancel_button )
}
menuDef
{
CENTER_POPUP_SETUP_ONOPEN( prestige_reset2, 3, ;, setfocus cancel_button, 1 )
CHOICE_POPMENU_TITLE( "@MENU_PRESTIGE_RESET_TITLE2" )
CHOICE_POPMENU_SUBTITLE( "@MENU_PRESTIGE_RESET_WARNING2" )
CHOICE_BUTTON( 3, "@MENU_CONTINUE", close prestige_reset2; open prestige_reset3 )
CHOICE_BUTTON_EX( 4, "@MENU_CANCEL", close prestige_reset2, name cancel_button )
}
// -------------------- third prestige warning --------------------
#define STATTODVAR_RANKXP statGetInDvarUsingTable( 2301, ui_stat_rankxp );
#define PRESTIGE_RESET \
statGetInDvarUsingTable( 2326, prestige_level );/*current prestige level*/ \
exec "prestigeReset"; \
play "enter_prestige"; \
execNow "updategamerprofile"; \
STATTODVAR_RANKXP
menuDef
{
CENTER_POPUP_SETUP_ONOPEN( prestige_reset3, 3, ;, setfocus cancel_button, 1 )
CHOICE_POPMENU_TITLE( "@MENU_PRESTIGE_RESET_TITLE3" )
CHOICE_POPMENU_SUBTITLE( "@MENU_PRESTIGE_RESET_WARNING3" )
CHOICE_BUTTON( 3, "@MENU_PRESTIGE_ENTER", PRESTIGE_RESET; close prestige_reset3; )
CHOICE_BUTTON_EX( 4, "@MENU_CANCEL", close prestige_reset3;, name cancel_button )
}
}