cod5-sdk/raw/ui/playerprofile.menu
2008-11-20 00:00:00 +00:00

505 lines
13 KiB
Text

#include "ui/menudef.h"
#include "ui_mp/common_macro.inc"
#define CHOICE_X_START -360
#define CHOICE_Y_START 76
#define SIGNED_IN_RECT -350 60 250 15
#define CHOICE_GROUP "profile"
#define STYLE_PC 1
#include "ui_mp/menustyle.inc"
#undef CHOICE_SIZE_X
#define CHOICE_SIZE_X 310
#undef CHOICE_TEXT_OFFSET_X
#define CHOICE_TEXT_OFFSET_X (-(CHOICE_SIZE_X)+100)
#define CHOICE_Y_OFFSET 0
#include "ui/choices_setup_common.menu"
#define TEXT_ON_BG_STYLE 3 //
#undef CHOICE_HORIZONTAL_ALIGN
#define CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_RIGHT
#undef CHOICE_VERTICAL_ALIGN
#define CHOICE_VERTICAL_ALIGN VERTICAL_ALIGN_TOP
{
/////////////////////
//
// player profile menu
//
/////////////////////
menuDef
{
name "player_profile"
visible 1
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN
soundloop "music_mainmenu"
focusColor COLOR_FOCUSED
style 1
border 0
onOpen
{
// IW COD4 version:
////execnow "set ui_close_main 1";
//close main_text;
//setdvar ui_separator_show "1";
//setdvar ui_version_show "0";
//uiScript closeMenuOnDvar ui_playerProfileAlreadyChosen 1 player_profile;
//uiScript addPlayerProfiles;
//uiScript selectActivePlayerProfile;
//uiScript openMenuOnDvar ui_playerProfileCount 0 profile_create_popmenu;
//setfocus profilelist;
// COD5 version
setdvar ui_separator_show "1";
setdvar ui_version_show "0";
setdvar ui_showOnlineOfflineButton "0";
uiScript closeMenuOnDvar ui_playerProfileAlreadyChosen 1 player_profile;
uiScript openPlayerProfileOpenCallback
setfocus profilelist;
setLocalVarBool ui_inOverlay 1;
}
onClose
{
//execnow "set ui_close_main 0";
setdvar ui_separator_show "1";
setdvar ui_version_show "1";
setdvar ui_showOnlineOfflineButton "1";
setLocalVarBool ui_inOverlay 0;
//open main_text;
}
onEsc
{
setdvar ui_playerProfileAlreadyChosen 1;
uiScript closeMenuOnDvarNot com_playerProfile "" player_profile;
}
#include "ui/overlaybg.inc"
BACKGROUND_BLACK_LETTERBOX_BLURWORLD_VIS( 0 , 0 )
OVERLAY_BACKGROUND_VIS( !menuisopen( "menu_xboxlive_barracks" ) )
CHOICE_OVERLAY_TITLE( "@MENU_SELECT_ONLINE_PROFILE" )
#define BACK_ENABLE 0
#include "ui_mp/navcontrols.inc"
// back drop shadow
//PREPROC_SHADER_DRAW( 0 0 640 480, 0 0, "white", 0 0 0 0.75, 0, 1, 0 0 0 0 )
//PREPROC_SHADER_DRAW( ORIGIN_OPTIONS_FRAME 100 480, 0 0, "gradient_fadein", 0 0 0 0.2, 0, 1, 0 0 0 0 )
PREPROC_SHADER_DRAW_ALIGNED( ORIGIN_OPTIONS_FRAME 600 480 CHOICE_HORIZONTAL_ALIGN CHOICE_VERTICAL_ALIGN, 100 0, "gradient_fadein", 0 0 0 0.75, 0, 1, 0 0 0 0 )
itemDef
{
name profilelist
rect -115 144 225 120 HORIZONTAL_ALIGN_CENTER CHOICE_VERTICAL_ALIGN
type ITEM_TYPE_LISTBOX
style WINDOW_STYLE_FILLED
textstyle ITEM_TEXTSTYLE_SHADOWED
elementwidth 120
elementheight 22
textscale CHOICE_TEXTSIZE
elementtype LISTBOX_TEXT
feeder FEEDER_PLAYER_PROFILES
textalignx 6
textaligny 0
forecolor 1 1 1 0.9
focusColor 1 1 1 0.9
disableColor 1 1 1 0.9
backcolor 0 0 0 0
border 1
bordersize 1
bordercolor 1 1 1 0.15
outlinecolor 1 1 1 0.2
visible MENU_TRUE
noscrollbars
mouseEnter { play "mouse_over"; setitemcolor profilelist bordercolor 1 1 1 0.55 }
mouseExit { setitemcolor profilelist bordercolor 1 1 1 0.15 }
doubleclick
{
play "mouse_click";
setdvar ui_playerProfileAlreadyChosen 1;
uiScript loadPlayerProfile;
close player_profile;
}
execkeyint 13
{
play "mouse_click";
setdvar ui_playerProfileAlreadyChosen 1;
uiScript loadPlayerProfile;
close player_profile;
}
}
#undef CHOICE_X_START
#define CHOICE_X_START -300
//CHOICE_SECTION_TITLE( 1, "@MENU_SELECT_PROFILE" )
#undef CHOICE_X_START
#define CHOICE_X_START -90
//CHOICE_BUTTON( 3, "@MENU_NAME", play "mouse_click"; uiScript sortPlayerProfiles 0 )
#undef CHOICE_X_START
#define CHOICE_X_START -360
itemDef
{
name load
text "@MENU_OK"
type 1
textfont UI_FONT_NORMAL
style WINDOW_STYLE_FILLED
textstyle ITEM_TEXTSTYLE_SHADOWED
rect -125 280 60 20 HORIZONTAL_ALIGN_CENTER CHOICE_VERTICAL_ALIGN
textalign ITEM_ALIGN_CENTER
textscale .33
textaligny 15
forecolor CHOICE_TEXTCOLOR
visible MENU_TRUE
dvarTest "ui_playerProfileSelected"
hideDvar { "" }
mouseEnter { play "mouse_over"; }
action
{
play "mouse_click";
setdvar ui_playerProfileAlreadyChosen 1;
uiScript loadPlayerProfile;
close player_profile;
}
leavefocus{ setLocalVarInt ui_highlight 0; setLocalVarString ui_choicegroup "" }
}
itemDef
{
name load
text "@MENU_CANCEL"
type 1
textfont UI_FONT_NORMAL
style WINDOW_STYLE_FILLED
textstyle ITEM_TEXTSTYLE_SHADOWED
rect -65 280 60 20 HORIZONTAL_ALIGN_CENTER CHOICE_VERTICAL_ALIGN
textalign ITEM_ALIGN_CENTER
textscale .33
textaligny 15
forecolor CHOICE_TEXTCOLOR
visible MENU_TRUE
dvarTest "com_playerProfile"
hideDvar { "" }
mouseEnter { play "mouse_over"; }
action
{
play "mouse_click";
setdvar ui_playerProfileAlreadyChosen 1;
close player_profile;
}
leavefocus{ setLocalVarInt ui_highlight 0; setLocalVarString ui_choicegroup "" }
}
itemDef
{
name create
text "@MENU_NEW"
type 1
textfont UI_FONT_NORMAL
style WINDOW_STYLE_FILLED
textstyle ITEM_TEXTSTYLE_SHADOWED
rect -5 280 60 20 HORIZONTAL_ALIGN_CENTER CHOICE_VERTICAL_ALIGN
textalign ITEM_ALIGN_CENTER
textscale .33
textaligny 15
forecolor CHOICE_TEXTCOLOR
visible MENU_TRUE
//action { play "mouse_click"; open profile_create_popmenu; }
action
{
play "mouse_click";
uiScript openMenuOnDvar ui_playerProfileCount 5 profile_create_too_many_popmenu;
uiScript openMenuOnDvarNot ui_playerProfileCount 5 profile_create_popmenu;
}
mouseEnter { play "mouse_over"; }
leavefocus{ setLocalVarInt ui_highlight 0; setLocalVarString ui_choicegroup "" }
}
itemDef
{
name delMP
text "@MENU_DELETE"
type 1
textfont UI_FONT_NORMAL
style WINDOW_STYLE_FILLED
textstyle ITEM_TEXTSTYLE_SHADOWED
rect 55 280 60 20 HORIZONTAL_ALIGN_CENTER CHOICE_VERTICAL_ALIGN
textalign ITEM_ALIGN_CENTER
textscale .33
textaligny 15
forecolor CHOICE_TEXTCOLOR
visible when( dvarBool( ui_multiplayer ) )
mouseEnter { play "mouse_over"; }
action { play "mouse_click"; uiScript deleteChoice }
leavefocus{ setLocalVarInt ui_highlight 0; setLocalVarString ui_choicegroup "" }
}
itemDef
{
name delSP
text "@MENU_DELETE"
type 1
textfont UI_FONT_NORMAL
style WINDOW_STYLE_FILLED
textstyle ITEM_TEXTSTYLE_SHADOWED
rect 55 280 60 20 HORIZONTAL_ALIGN_CENTER CHOICE_VERTICAL_ALIGN
textalign ITEM_ALIGN_CENTER
textscale .33
textaligny 15
forecolor CHOICE_TEXTCOLOR
visible when( dvarString( com_playerProfile ) == dvarString( ui_playerProfileSelected ) && !dvarBool( ui_multiplayer ) )
mouseEnter { play "mouse_over"; }
action { play "mouse_click"; uiScript deleteChoice }
leavefocus{ setLocalVarInt ui_highlight 0; setLocalVarString ui_choicegroup "" }
}
itemDef
{
name delSPD
text "@MENU_DELETE"
type ITEM_TYPE_TEXT
textfont UI_FONT_NORMAL
style WINDOW_STYLE_FILLED
textstyle ITEM_TEXTSTYLE_SHADOWED
rect 55 280 60 20 HORIZONTAL_ALIGN_CENTER CHOICE_VERTICAL_ALIGN
textalign ITEM_ALIGN_CENTER
textscale .33
textaligny 15
forecolor COLOR_DISABLED
visible when( dvarString( com_playerProfile ) != dvarString( ui_playerProfileSelected ) && !dvarBool( ui_multiplayer ) )
decoration
}
} // end player_profile menudef
#undef CHOICE_HORIZONTAL_ALIGN
#define CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_LEFT
#undef CHOICE_VERTICAL_ALIGN
#define CHOICE_VERTICAL_ALIGN VERTICAL_ALIGN_TOP
#undef CHOICE_X_START
#undef CHOICE_Y_START
#define CHOICE_X_START 78
#define CHOICE_Y_START 230
#undef CHOICE_GROUP
#define CHOICE_GROUP "profile_popup"
#undef CHOICE_SEP_OFFSET_Y
#define CHOICE_SEP_OFFSET_Y -2
#undef CHOICE_TEXT_OFFSET_X
#define CHOICE_TEXT_OFFSET_X CHOICE_SIZE_Y
#define SIDE_MARGIN 40
#undef CHOICE_SIZE_X
#define CHOICE_SIZE_X 180
#undef CHOICE_Y_START
#define CHOICE_Y_START 230
#include "ui_mp/popupstyle.inc"
#include "ui/choices_setup_popmenu.menu"
/////////////////////
//
// Create profile popup
//
/////////////////////
menuDef
{
CENTER_POPUP_SETUP( profile_create_popmenu, 5, ;, 1 )
onOpen { setfocus createprofile; uiScript openPopupmenuProfileCreateCallback; }
onClose { uiScript openMenuOnDvar ui_playerProfileCount 0 profile_must_create_popmenu; }
CHOICE_POPMENU_TITLE( "@MENU_CREATE_ONLINE_PLAYER_PROFILE" )
itemDef {
name createprofile
TYPE ITEM_TYPE_VALIDFILEFIELD
text "@MENU_NAME1"
dvar "ui_playerProfileNameNew"
rect 60 200 250 18 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP
origin SIDE_MARGIN -8
textaligny -2
maxchars 12
maxpaintchars 12
textalign ITEM_ALIGN_MIDDLE_LEFT
textfont UI_FONT_NORMAL
textscale TEXTSIZE_SMALL
forecolor .9 .9 .9 1
style WINDOW_STYLE_FILLED
backcolor 0 0 0 .3
visible 1
accept { uiScript checkProfileNameLen; }
}
// on OK checkProfileNameLen will close this dialog if needed
CHOICE_BUTTON( 2, "@MENU_OK", uiScript checkProfileNameLen ; )
CHOICE_BUTTON( 3, "@MENU_CANCEL", close self; )
}
/////////////////////
//
// Profile name does not fit length requirements
//
/////////////////////
menuDef
{
CENTER_POPUP_SETUP( profile_len_incorrect_popmenu, 3, ;, 1 )
onClose { open profile_create_popmenu; }
CHOICE_POPMENU_TITLE( "@MENU_ERROR" )
CHOICE_POPMENU_SUBTITLE( "@MENU_PROFILE_LEN_INCORRECT" )
CHOICE_BUTTON( 3, "@MENU_OK", close self; )
}
/////////////////////
//
// Must create new profile popup
//
/////////////////////
menuDef
{
CENTER_POPUP_SETUP( profile_must_create_popmenu, 3, ;, 1 )
//onClose { uiScript openMenuOnDvar ui_playerProfileCount 0 profile_must_create_popmenu; }
onClose { uiScript openMenuOnDvar ui_playerProfileCount 0 profile_create_popmenu; }
// CHOICE_POPMENU_TITLE( "@MENU_ERROR" )
// CHOICE_POPMENU_SUBTITLE( "@MENU_NEED_PLAYER_PROFILE" )
// CHOICE_BUTTON( 3, "@MENU_OK", close self; )
CHOICE_POPMENU_TITLE( "@MENU_NOTICE" )
CHOICE_POPMENU_SUBTITLE( "@MENU_NEED_ONLINE_PLAYER_PROFILE" )
CHOICE_BUTTON( 2, "@MENU_YES", open profile_create_popmenu; close self )
CHOICE_BUTTON( 3, "@MENU_NO", uiScript loadDefaultOfflinePlayerProfile; close self )
}
menuDef
{
CENTER_POPUP_SETUP( popup_cannot_connect_to_dw_create_offline_profile, 3, ;, 1 )
onClose { uiScript loadDefaultOfflinePlayerProfile; }
CHOICE_POPMENU_TITLE( "@MENU_DW_ERROR_TITLE" )
CHOICE_POPMENU_SUBTITLE( "@MENU_DW_ERROR_CANNOTCONNECT" )
CHOICE_BUTTON( 3, "@MENU_OK", close self; )
}
/////////////////////
//
// Delete for sure? popup
//
/////////////////////
menuDef
{
CENTER_POPUP_SETUP( profile_del_sure_popmenu, 3, ;, 1 )
CHOICE_POPMENU_TITLE( "@MENU_WARNING_CAP" )
CHOICE_POPMENU_SUBTITLE( "@MENU_DELETE_PROFILE" )
CHOICE_BUTTON( 2, "@MENU_YES", uiScript deletePlayerProfile; close self; )
CHOICE_BUTTON( 3, "@MENU_NO", close self; )
}
/////////////////////
//
// Profile already exist!
//
/////////////////////
menuDef
{
CENTER_POPUP_SETUP( profile_exists_popmenu, 3, ;, 1 )
CHOICE_POPMENU_TITLE( "@MENU_ERROR" )
CHOICE_POPMENU_SUBTITLE( "@MENU_A_PROFILE_WITH_THE_SAME_NAME_ALREADY_EXISTS" )
CHOICE_BUTTON( 3, "@MENU_OK", close self; )
}
/////////////////////
//
// Failed to create profile!
//
/////////////////////
menuDef
{
CENTER_POPUP_SETUP( profile_create_fail_popmenu, 3, ;, 1 )
CHOICE_POPMENU_TITLE( "@MENU_ERROR" )
CHOICE_POPMENU_SUBTITLE( "@MENU_PROFILE_CREATION_FAILED" )
CHOICE_BUTTON( 3, "@MENU_OK", close self; )
}
/////////////////////
//
// Too many profiles!
//
/////////////////////
menuDef
{
CENTER_POPUP_SETUP( profile_create_too_many_popmenu, 3, ;, 1 )
CHOICE_POPMENU_TITLE( "@MENU_ERROR" )
CHOICE_POPMENU_SUBTITLE( "@MENU_PROFILE_CREATE_TOO_MANY" )
CHOICE_BUTTON( 3, "@MENU_OK", close self; )
}
/////////////////////
//
// Delete profile failed
//
/////////////////////
menuDef
{
CENTER_POPUP_SETUP( profile_delete_fail_popmenu, 3, ;, 1 )
CHOICE_POPMENU_TITLE( "@MENU_ERROR" )
CHOICE_POPMENU_SUBTITLE( "@MENU_PROFILE_DELETION_FAILED" )
CHOICE_BUTTON( 3, "@MENU_OK", close self; )
}
/////////////////////
//
// Delete profile failed
//
/////////////////////
menuDef
{
CENTER_POPUP_SETUP( popup_deleting_account_not_logged, 3, ;, 1 )
CHOICE_POPMENU_TITLE( "@PLATFORM_LOGIN_REQUIRED_TITLE" )
CHOICE_POPMENU_SUBTITLE( "@PLATFORM_LOGIN_REQUIRED" )
CHOICE_BUTTON( 3, "@MENU_OK", close self; )
}
}