cod4-sdk/raw/ui_mp/xboxlive_lobby.menu
2008-01-19 00:00:00 +00:00

572 lines
17 KiB
Text

#include "ui/menudef.h"
#define CHOICE_SIZE_X 150
#define CHOICE_SIZE_Y 22
#define CHOICE_X_START 0
#define CHOICE_Y_START 34
#define CHOICE_SEP_OFFSET_Y -2
#define CHOICE_GROUP "xboxlive_lobby"
#define CHOICE_SEP_1 3
#include "ui_mp/menustyle.inc"
#include "ui/choices_setup_common.menu"
#include "ui_mp/stats_info.inc"
#define PLAYERLIST_WIDTH 270
#define ORIGIN_PLAYERLIST (- (PLAYERLIST_WIDTH - RIGHTITEM_OFFSET)) 38
#define ORIGIN_STATUS (- (PLAYERLIST_WIDTH - RIGHTITEM_OFFSET)) 0
#define ORIGIN_DESCRIPTION (CHOICE_X_START + 15) 158
#define COLOR_DESC_TEXT 1 1 1 0.7
#define MENU_FONT_SIZE TEXTSIZE_DEFAULT
#define HIGHLIGHT_SIZE 142 22
#define MENU_FONT_COLOR 1 1 1 0.5
#define MENU_FONT_COLOR2 1 1 1 0.5
#define MENU_LOCKED_COLOR 0.25 0.25 0.25 1
//-------------------------------------
#define ORIGIN_BUTTON_BACK 52 438
#define ORIGIN_BUTTON_CONTINUE 490 438
#define ORIGIN_BUTTON_INVITE 390 86
// ------------------ preprocessing function definitions ------------------
#define PAD_LEFT \
execKeyInt DPAD_LEFT { \
focusFirst; \
show selection_left; \
hide selection_right; \
} \
execKeyInt APAD_LEFT { \
focusFirst; \
show selection_left; \
hide selection_right; \
}
#define PAD_RIGHT \
execKeyInt DPAD_RIGHT { \
setFocus lobbyList; \
exec "set ui_hint_text @MPUI_DESC_PLAYER_OPTIONS" \
} \
execKeyInt APAD_RIGHT { \
setFocus lobbyList; \
exec "set ui_hint_text @MPUI_DESC_PLAYER_OPTIONS" \
}
#include "ui_mp/common_macro.inc"
{
menuDef
{
name menu_xboxlive_lobby
fullscreen 1
rect 0 0 640 480
focuscolor COLOR_FOCUSED
style WINDOW_STYLE_FILLED
border 0
soundloop "music_mainmenu_mp"
onOpen
{
// popup for rank promotion
uiScript openMenuOnDvar "ui_lobbypopup" promotion "popup_unlock";
uiScript openMenuOnDvar "ui_lobbypopup" summary "popup_unlock";
execnow "set ui_lobbypopup_text summary";
execnowondvarstringvalue ui_lobbypopup promotion "set ui_lobbypopup_text promotion";
exec "set ui_lobbypopup none";
show dpad_left;
show selection_left;
hide dpad_right;
hide selection_right;
focusFirst;
exec "selectStringTableEntryInDvar mp/didyouknow.csv 0 didyouknow";
}
onClose
{
hide selection_right;
}
onEsc
{
open leavelobbywarning;
}
execkeyint BUTTON_Y
{
open "popup_unlock";
//open "popup_summary";
}
PAD_RIGHT
PAD_LEFT
// ------------------ statics ------------------------
#include "ui/blurredbg.inc"
#include "ui_mp/sidepanels.inc"
//CHOICE_MENU_TITLE( "@MPUI_PUBLIC_MATCH_LOBBY" )
itemDef
{
type ITEM_TYPE_TEXT
origin ORIGIN_TITLE
forecolor COLOR_TITLE
ownerdraw UI_PLAYLISTNAME
textfont UI_FONT_NORMAL
textscale TEXTSIZE_DEFAULT
textstyle CHOICE_TEXTSTYLE
textalign ITEM_ALIGN_TOP_LEFT
textaligny 26
textalignx 0
visible when (!acceptingInvite());
decoration
}
// --------------------- lobby players count -----------------------
itemDef {
type ITEM_TYPE_TEXT
rect 0 0 PLAYERLIST_WIDTH 0 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP
origin ORIGIN_PLAYERLIST
forecolor CHOICE_TEXTCOLOR
dvar "party_lobbyPlayerCount"
textfont UI_FONT_DEFAULT
textscale TEXTSIZE_SMALL
textaligny -6
textalign ITEM_ALIGN_RIGHT
visible when ( InLobby() )
decoration
}
// --------- button ----------
itemDef
{
rect -140 -4 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
origin 0 0
text "@PLATFORM_GAME_SUMMARY"
textfont UI_FONT_NORMAL
textscale TEXTSIZE_SMALL
textalign ITEM_ALIGN_BOTTOM_LEFT
visible 1
decoration
}
#include "ui_mp/navcontrols.inc"
// ----------------------------map images------------------------------------
#include "ui_mp/game_info.inc"
GAME_INFO( "loadscreen_" + dvarString (ui_mapname), dvarString( party_mapname ), gametypename(), InLobby() && ( dvarbool( xblive_rankedmatch ) == 0 || dvarbool( party_timervisible ) ) )
//=========================================================
//===================== MENU SELECTION ====================
//=========================================================
#define SETUP_EXTRA_FIRST \
execKeyInt DPAD_UP { \
setfocus last_in_list1; setFocus last_in_list2; } \
execKeyInt APAD_UP { \
setfocus last_in_list1; setFocus last_in_list2; }
#define SETUP_EXTRA_LAST \
execkeyint DPAD_DOWN{ \
focusFirst; \
} \
execkeyint APAD_DOWN{ \
focusFirst; \
}
#define CLEARUIHINT exec "set ui_hint_text @NULL_EMPTY"
#define SETUP_ACTION_FINDGAME \
exec "xblive_privatematch 0"; \
open "popup_findgame";
#define SETUP_ACTION_PRIVATEMATCH \
exec "exec "XBOXLIVE_MP_CFG; \
exec "xblive_rankedmatch 0"; \
exec "ui_enumeratesaved" \
exec "party_timerVisible 0"; \
exec "xblive_privatematch 1"; \
exec "xstartpartyhost"; \
open menu_xboxlive_privatelobby;
#define SETUP_ACTION_CREATEACLASS \
execnow "set ui_cac_ingame 0"; \
execnow "statset 260 1"; \
open lobby_cac_popup;
#define SETUP_ACTION_BARRACKS \
open menu_xboxlive_barracks;
#ifdef PS3
#define SETUP_ACTION_INVITE \
open menu_ps3_friends;
#else
#define SETUP_ACTION_INVITE \
exec "xshowfriendslist";
#endif
#define SETUP_ACTION_CYCLEMAP \
exec "xplaylistchoosegame; xupdatepartystate";
#define SETUP_ACTION_VETOMAP \
focusFirst; \
open skipmapconfirmation;
CHOICE_BUTTON_FOCUS_VIS_EX_ADV( 1, "@MPUI_CREATE_A_CLASS", SETUP_ACTION_CREATEACLASS, exec "set ui_hint_text @MPUI_DESC_CREATE_A_CLASS", CLEARUIHINT, when( stat( 260 ) >= 1 );, SETUP_EXTRA_FIRST, stat( 260 ) >= 1 )
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 1, "", ;, exec "set ui_hint_text @MPUI_DESC_CREATE_A_CLASS_LOCKED", CLEARUIHINT, when( stat( 260 ) < 1 );, SETUP_EXTRA_FIRST )
CHOICE_DBUTTON_VIS( 1, "@MPUI_CREATE_A_CLASS", when( stat( 260 ) < 1 ); )
CHOICE_NEWICON_VIS( 1, "specialty_new", when( ANY_NEW_CAC ); )
CHOICE_BUTTON_FOCUS_VIS( 2, "@MPUI_BARRACKS", SETUP_ACTION_BARRACKS, exec "set ui_hint_text @MPUI_DESC_BARRACKS", CLEARUIHINT, when(1) )
CHOICE_NEWICON_VIS( 2, "specialty_new", when( ANY_NEW_BARRACKS ); )
CHOICE_BUTTON_FOCUS_VIS_EX_ADV( 3, "@MPUI_INVITE_FRIENDS", SETUP_ACTION_INVITE, exec "set ui_hint_text @MPUI_DESC_INVITE_FRIENDS", CLEARUIHINT, when( !dvarbool( ui_partyFull ) );, ;, !dvarbool( ui_partyFull ) )
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 3, "", ;, exec "set ui_hint_text @MPUI_DESC_INVITE_FRIENDS_FULL", CLEARUIHINT, when( dvarbool( ui_partyFull ) );, ; )
CHOICE_DBUTTON_VIS( 3, "@MPUI_INVITE_FRIENDS", when( dvarbool( ui_partyFull ) ); )
CHOICE_SEPARATOR( CHOICE_SEP_1 )
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 4, "", ;, exec "set ui_hint_text @MPUI_DESC_VOTE_TO_SKIP", CLEARUIHINT, when( dvarbool( party_vetoButtonVisible ) == 0 );, SETUP_EXTRA_LAST name last_in_list1; )
CHOICE_BUTTON_FOCUS_VIS_EX_ADV( 4, "@MPUI_VOTE_TO_SKIP", SETUP_ACTION_VETOMAP, exec "set ui_hint_text @MPUI_DESC_VOTE_TO_SKIP", CLEARUIHINT, when ( dvarbool( party_vetoButtonVisible ) && InLobby() );, SETUP_EXTRA_LAST name last_in_list2;, ( dvarbool( party_vetoButtonVisible ) && InLobby() ) )
CHOICE_DBUTTON_VIS( 4, "@MPUI_VOTE_CAST", when ( !dvarbool( party_vetoButtonVisible ) && InLobby() ); )
CHOICE_DBUTTON_VIS( 4, "@MPUI_VOTE_TO_SKIP", when ( !InLobby() ); )
//PREPROC_SHADER_DRAW( ORIGIN_CHOICE1 40 20, 130 -20, "specialty_new", 1 1 1 1, 1, 2, 0 0 0 0 visible when( stat( 260 ) > 1 ) )
// ---------------------- menu selection description -------------------------
itemDef {
name desc_arrow
style WINDOW_STYLE_SHADER
rect 0 3 10 10 CHOICE_HORIZONTAL_ALIGN VERTICAL_ALIGN_TOP
origin ORIGIN_DESCRIPTION
background "ui_arrow_right"
forecolor 1 1 1 0.25
visible 1
decoration
}
itemDef {
name description_choice
type ITEM_TYPE_TEXT
rect 12 0 210 36 CHOICE_HORIZONTAL_ALIGN VERTICAL_ALIGN_TOP
origin ORIGIN_DESCRIPTION
exp text( dvarString( ui_hint_text ) )
textfont UI_FONT_DEFAULT
textscale TEXTSIZE_SMALL
textaligny 16
forecolor COLOR_DESC_TEXT
visible 1
autowrapped
decoration
}
// ------------------------ lobby status ----------------------------
itemDef
{
type ITEM_TYPE_TEXT
rect 0 0 0 0 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP
origin ORIGIN_STATUS
textaligny 12
textalign ITEM_ALIGN_LEFT
forecolor MENU_FONT_COLOR2
textfont UI_FONT_NORMAL
textscale TEXTSIZE_SMALL
ownerdraw UI_PARTYSTATUS
decoration
visible when ( dvarint( party_timerVisible ) == 0 );
}
itemDef
{
type ITEM_TYPE_TEXT
rect 0 0 0 0 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP
origin ORIGIN_STATUS
textaligny 12
textalign ITEM_ALIGN_LEFT
forecolor MENU_FONT_COLOR2
text "@MENU_MATCH_BEGINNING_IN"
textfont UI_FONT_NORMAL
textscale TEXTSIZE_SMALL
decoration
visible when ( dvarint( party_timerVisible ) == 1 );
}
itemDef
{
type ITEM_TYPE_TEXT
rect 130 0 0 0 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP
origin ORIGIN_STATUS
textaligny 12
textalign ITEM_ALIGN_LEFT
forecolor MENU_FONT_COLOR2
dvar "party_timer"
textfont UI_FONT_NORMAL
textscale TEXTSIZE_SMALL
decoration
visible when ( dvarint( party_timerVisible ) == 1 );
}
// ---------------------- player list -------------------------
#define PLAYERLIST_SCOREVIS 1
#ifdef XENON
#define PLAYERLIST_SELECTED_ACTIONS \
doubleClick { \
open player_popup; \
} \
PAD_LEFT
#else
#define PLAYERLIST_SELECTED_ACTIONS \
PAD_LEFT
#endif // #ifdef XENON
#include "ui_mp/playerlist.inc"
#include "ui/safearea.menu"
#include "ui/popup_background.inc"
}
// =============================================================
// ========================== popups ===========================
// =============================================================
menuDef
{
name popup_ready
visible 0
fullscreen 0
rect 0 0 640 480
focusColor COLOR_FOCUSED
style WINDOW_STYLE_FILLED
border 1
popup
onOpen{ exec "xpartyready 1";}
onESC {
play "mouse_click";
exec "xpartyready 0";
close popup_ready;
}
}
/*
#define ORIGIN_POPUP_BOX 250 180
#define RECT_POPUP_BOX ORIGIN_POPUP_BOX 160 120
#define ORIGIN_YES 20 104
#define ORIGIN_NO 100 104
#define LOCAL_CONFRIM_FORMAT( ptext ) \
name confirm \
style 0 \
textscale TEXTSIZE_DEFAULT \
textstyle ITEM_TEXTSTYLE_SHADOWED \
rect RECT_POPUP_BOX 0 0 \
textaligny 34 \
textalign ITEM_ALIGN_CENTER \
decoration \
text ptext \
forecolor COLOR_TITLE
#define LOCAL_A_B_BUTTONS \
itemDef { \
name yes \
text "@PLATFORM_YES" \
type 1 \
textscale TEXTSIZE_DEFAULT \
style ITEM_TYPE_BUTTON \
textfont UI_FONT_NORMAL \
textstyle ITEM_TEXTSTYLE_NORMAL \
rect ORIGIN_POPUP_BOX 220 15 0 0 \
origin ORIGIN_YES \
visible 1 decoration } \
itemDef { \
name re \
text "@PLATFORM_NO" \
type 1 \
textscale TEXTSIZE_DEFAULT \
style ITEM_TYPE_BUTTON \
textfont UI_FONT_NORMAL \
textstyle ITEM_TEXTSTYLE_NORMAL \
rect ORIGIN_POPUP_BOX 220 15 0 0 \
origin ORIGIN_NO \
visible 1 decoration }
*/
/*
menuDef{
name leavelobbywarning2
visible 0
fullscreen 0
rect -320 -240 640 480 HORIZONTAL_ALIGN_CENTER_SAFEAREA VERTICAL_ALIGN_CENTER_SAFEAREA//0 0 640 480
focusColor COLOR_FOCUSED
style WINDOW_STYLE_FILLED
popup
onESC {
close leavelobbywarning;
}
execKeyInt BUTTON_B {
play "mouse_click";
close leavelobbywarning;
}
itemDef {
style WINDOW_STYLE_FILLED
rect RECT_POPUP_BOX
backcolor 0.1 0.1 0.1 0.9
border 1
bordercolor 1 1 1 0.5
bordersize 1
visible 1 decoration
}
itemDef {
LOCAL_CONFRIM_FORMAT( "@XBOXLIVE_LEAVELOBBY" )
visible when ( !InPrivateParty() || PrivatePartyHost() );
execKeyInt BUTTON_A {
play "mouse_click";
close menu_xboxlive_lobby;
close menu_xboxlive_privatelobby;
exec "xstopparty";
exec "xblive_privatematch 0";
close leavelobbywarning;
}
}
itemDef {
LOCAL_CONFRIM_FORMAT( "@XBOXLIVE_LEAVEPARTYANDLOBBY" )
visible when ( InPrivateParty() && !PrivatePartyHost() && PrivatePartyHostInLobby() );
execKeyInt BUTTON_A {
play "mouse_click";
close menu_xboxlive_lobby;
close menu_xboxlive_privatelobby;
exec "xstopprivateparty";
exec "xstopparty";
exec "xblive_privatematch 0";
exec "xstartprivateparty";
close leavelobbywarning;
}
}
itemDef {
LOCAL_CONFRIM_FORMAT( "@XBOXLIVE_LEAVELOBBY" )
visible when ( InPrivateParty() && !PrivatePartyHost() && !PrivatePartyHostInLobby() );
execKeyInt BUTTON_A {
play "mouse_click";
close menu_xboxlive_lobby;
close menu_xboxlive_privatelobby;
exec "xstopparty";
exec "xblive_privatematch 0";
close leavelobbywarning;
}
}
LOCAL_A_B_BUTTONS
}
*/
// private match - leave lobby warning
#undef CHOICE_SIZE_X
#define CHOICE_SIZE_X 216
#include "ui_mp/popupstyle.inc"
#include "ui/choices_setup_popmenu.menu"
#define CAC_POPUP_X (0)
#define CAC_POPUP_Y (22)
// set new status position ---
#undef NEW_X_OFFSET
#define NEW_X_OFFSET (0-CHOICE_SIZE_X)
#undef NEW_Y_OFFSET
#define NEW_Y_OFFSET (0-2)
#include "ui_mp/cacpopup.inc"
CAC_POPUP( "lobby_cac_popup", CAC_POPUP_X, CAC_POPUP_Y )
// restore new status position ---
#undef NEW_X_OFFSET
#define NEW_X_OFFSET 0
#undef NEW_Y_OFFSET
#define NEW_Y_OFFSET 0
#undef CHOICE_SIZE_X
#define CHOICE_SIZE_X 180
#undef CHOICE_HORIZONTAL_ALIGN
#define CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER
#undef CHOICE_VERTICAL_ALIGN
#define CHOICE_VERTICAL_ALIGN VERTICAL_ALIGN_CENTER
#undef CHOICE_POPUP_TITLE_HEIGHT
#define CHOICE_POPUP_TITLE_HEIGHT 24
menuDef
{
CENTER_POPUP_SETUP_ONOPEN( leavelobbywarning, 2, ;, setfocus cancel_button, 1 )
#define LOCAL_ACCEPT_LEAVELOBBY \
play "mouse_click"; \
close menu_xboxlive_lobby; \
close menu_xboxlive_privatelobby; \
exec "xstopparty"; \
exec "xblive_privatematch 0"; \
close leavelobbywarning;
#define LOCAL_ACCEPT_LEAVELOBBY2 \
play "mouse_click"; \
close menu_xboxlive_lobby; \
close menu_xboxlive_privatelobby; \
exec "xstopprivateparty"; \
exec "xstopparty"; \
exec "xblive_privatematch 0"; \
exec "xstartprivateparty"; \
close leavelobbywarning;
CHOICE_POPMENU_TITLE_VIS( "@XBOXLIVE_LEAVELOBBY", when( !InPrivateParty() || PrivatePartyHost() ) )
CHOICE_POPMENU_TITLE_VIS( "@XBOXLIVE_LEAVEPARTYANDLOBBY", when( InPrivateParty() && !PrivatePartyHost() && PrivatePartyHostInLobby() ) )
CHOICE_POPMENU_TITLE_VIS( "@XBOXLIVE_LEAVELOBBY", when( InPrivateParty() && !PrivatePartyHost() && !PrivatePartyHostInLobby() ) )
CHOICE_BUTTON_BG( 1, 1 )
CHOICE_HIGHLIGHT( 1, 1 )
CHOICE_BUTTON_VIS_NOHI( 1, "@MPUI_YES", LOCAL_ACCEPT_LEAVELOBBY, when( !InPrivateParty() || PrivatePartyHost() ) )
CHOICE_BUTTON_VIS_NOHI( 1, "@MPUI_YES", LOCAL_ACCEPT_LEAVELOBBY2, when( InPrivateParty() && !PrivatePartyHost() && PrivatePartyHostInLobby() ) )
CHOICE_BUTTON_VIS_NOHI( 1, "@MPUI_YES", LOCAL_ACCEPT_LEAVELOBBY, when( InPrivateParty() && !PrivatePartyHost() && !PrivatePartyHostInLobby() ) )
CHOICE_BUTTON_EX( 2, "@MPUI_NO", close self, name cancel_button )
}
// xboxlive menu private party - leave party warning
// #undef CHOICE_POPUP_BORDER_Y
// #define CHOICE_POPUP_BORDER_Y 23
menuDef
{
CENTER_POPUP_SETUP_ONOPEN( skipmapconfirmation, 2, ;, setfocus cancel_button, 1 )
#define LOCAL_ACCEPT_VETO \
play "mouse_click"; \
exec "xpartyveto 1"; \
close skipmapconfirmation;
CHOICE_POPMENU_TITLE( "@MENU_VOTESKIPCONFIRM" )
CHOICE_BUTTON( 1, "Yes", LOCAL_ACCEPT_VETO )
CHOICE_BUTTON( 2, "No", close self )
}
menuDef
{
CENTER_POPUP_SETUP_ONOPEN( leaveprivatepartywarning, 2, ;, setfocus cancel_button, 1 )
#define LOCAL_ACCEPT_LEAVE \
play "mouse_click"; \
exec "onlinegame 0"; \
exec "xstopprivateparty"; \
exec "xstopparty"; \
exec "splitscreencontrols"; \
close leaveprivatepartywarning; \
close popup_gettingdata; \
close menu_xboxlive;
CHOICE_POPMENU_TITLE_VIS( "@XBOXLIVE_DESTROYPARTY", when( InPrivateParty() && PrivatePartyHost() ) )
CHOICE_POPMENU_TITLE_VIS( "@XBOXLIVE_LEAVEPARTY", when( InPrivateParty() && !PrivatePartyHost() ) )
CHOICE_BUTTON( 1, "@MPUI_YES", LOCAL_ACCEPT_LEAVE )
CHOICE_BUTTON_EX( 2, "@MPUI_NO", close self, name cancel_button )
}
}