cod5-sdk/raw/ui_mp/xboxlive_privatelobby.menu
2008-11-20 00:00:00 +00:00

331 lines
12 KiB
Text

#include "ui/menudef.h"
#define CHOICE_X_START 0
#define CHOICE_Y_START 45//34
#define CHOICE_SEP_OFFSET_Y -2
#define CHOICE_GROUP "xboxlive_privatematch"
#define CHOICE_SEP_1 2
#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)) 36
#define ORIGIN_STATUS (- (PLAYERLIST_WIDTH - RIGHTITEM_OFFSET)) 0
#define ORIGIN_RECOMMENDEDPLAYERS ORIGIN_PLAYERLIST//(- (PLAYERLIST_WIDTH - RIGHTITEM_OFFSET)) 38
#define ORIGIN_DESCRIPTION (CHOICE_X_START + 12) 200 //180
#define STATUS_X (CHOICE_X_START + 12)
#define STATUS_Y 190//220
#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 { \
setdvar ui_selectlobby "0" \
focusFirst; \
show selection_left; \
hide selection_right; \
} \
execKeyInt APAD_LEFT { \
setdvar ui_selectlobby "0" \
focusFirst; \
show selection_left; \
hide selection_right; \
}
#define PAD_RIGHT \
execKeyInt DPAD_RIGHT { \
setdvar ui_selectlobby "1" \
setFocus lobbyList; \
} \
execKeyInt APAD_RIGHT { \
setdvar ui_selectlobby "1" \
setFocus lobbyList; \
}
#include "ui_mp/common_macro.inc"
{
menuDef
{
name menu_xboxlive_privatelobby
fullscreen 1
rect 0 0 640 480
focuscolor COLOR_FOCUSED
style WINDOW_STYLE_FILLED
border 0
soundloop "music_mainmenu"
onOpen
{
execnow "xblive_rankedmatch 0";
execnow "party_timerVisible 0";
execnow "xblive_privatematch 1";
exec "exec dvar_defaults.cfg";
exec "set ui_inviteonly 0";
setdvar invite_visible "1";
show dpad_left;
show selection_left;
hide dpad_right;
hide selection_right;
focusFirst;
setdvar ui_selectlobby "0";
setdvar popup_open "0";
CLEARUIHINT
}
onClose { hide selection_right; }
onEsc
{
setdvar popup_open "1";
setfocus popup_hide;
open leavelobbywarning;
}
PAD_RIGHT
// ------------------ statics ------------------------
#define BACKGROUND_MOVESCALE 0.15
#define BACKGROUND_MOVERATE_X 5000
#define BACKGROUND_MOVERATE_Y 4000
#define BACKGROUND_WIDTH (854 * (1+BACKGROUND_MOVESCALE) )
#define BACKGROUND_HEIGHT (480 * (1+BACKGROUND_MOVESCALE) )
#define FLASH_OFS ((sin(milliseconds()/90))*2)
#include "ui_mp/blurredbg.inc"
//#include "ui_mp/sidepanels.inc"
CHOICE_MENU_TITLE( "@MPUI_CUSTOM_MATCH_LOBBY" )
// --------------------- lobby players count -----------------------
itemDef {
type ITEM_TYPE_TEXT
rect 0 -4 PLAYERLIST_WIDTH 0 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP
origin ORIGIN_PLAYERLIST
forecolor CHOICE_TEXTCOLOR
dvar "party_lobbyPlayerCount"
textfont CHOICE_TEXTFONT
textscale TEXTSIZE_SMALL
textaligny -6
textalign ITEM_ALIGN_RIGHT
visible when ( InLobby() )
decoration
}
itemDef
{
type ITEM_TYPE_TEXT
rect 0 -4 PLAYERLIST_WIDTH 0 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP
origin ORIGIN_PLAYERLIST
textaligny -6
forecolor CHOICE_TEXTCOLOR
textfont CHOICE_TEXTFONT
textscale TEXTSIZE_SMALL
exp text ( locstring( "@MPUI_RECOMMENDEDPLAYERS", int( min( dvarint( party_maxplayers ), maxrecommendedplayers() ) ) ) );
visible when ( privatepartyhost() )
decoration
}
// ----------------------------map images------------------------------------
#include "ui_mp/game_info.inc"
#define MAPIMAGE tableLookup( "mp/mapsTable.csv", 0, dvarString( ui_mapname ), 4 )
#define MAPNAME tableLookup( "mp/mapstable.csv", 0, dvarString( ui_mapname ), 3 )
#define GAMETYPENAME tableLookup( "mp/gametypesTable.csv", 0, dvarString( ui_gametype ), 1 )
GAME_INFO( MAPIMAGE, "@" + MAPNAME, "@" + GAMETYPENAME, 1 )
//=========================================================
//===================== MENU SELECTION ====================
//=========================================================
#undef NEW_X_OFFSET
#define NEW_X_OFFSET (-CHOICE_SIZE_Y)
#define CLEARUIHINT exec "set ui_hint_text @NULL_EMPTY; set ui_show_arrow 0"
#define SETUP_ACTION_STARTMATCH \
exec "selectStringTableEntryInDvar mp/didyouknow.csv 0 didyouknow"; \
exec "xpartygo";
#define SETUP_ACTION_FINDGAME \
exec "xblive_privatematch 0" \
close self; \
open menu_xboxlive;
//exec "openmenu popup_findgame";
//partyUpdateMissingMapPackDvar; \
//exec "openmenu popup_findgame";
//execOnDvarIntValue party_membersMissingMapPack 1 "set ui_mappacks_findgamewhendone 1"; \
//execOnDvarIntValue party_membersMissingMapPack 1 "openmenu popup_mappacks";
#define SETUP_ACTION_GAMESETUP \
open settings;
#define SETUP_ACTION_CREATEACLASS \
execnow "set ui_cac_ingame 0"; \
execnow "statset 260 1"; \
setdvar invite_visible "0"; \
/*exec "uploadstats";*/ \
open cac_main;
#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 \
execNow "xplaylistchoosegame; xupdatepartystate";
#define IS_LOBBY_HOST ( gameHost() && inLobby() && dvarBool( xblive_privatematch ) )
#define IS_NOT_LOBBY_HOST ( !gameHost() || !inLobby() || !dvarBool( xblive_privatematch ) )
// HOST OPTIONS
CHOICE_BUTTON_FOCUS_VIS( 1, "@MPUI_START_MATCH", SETUP_ACTION_STARTMATCH, ;, CLEARUIHINT, when( IS_LOBBY_HOST ) )
CHOICE_BUTTON_FOCUS_VIS( 2, "@MENU_SETTINGS", SETUP_ACTION_GAMESETUP, ;, CLEARUIHINT, when(IS_LOBBY_HOST) )
CHOICE_BUTTON_FOCUS_VIS( 3, "@MPUI_CREATE_A_CLASS", SETUP_ACTION_CREATEACLASS, ;, CLEARUIHINT, when( stat( 260 ) >= 1 && IS_LOBBY_HOST ) )
CHOICE_BUTTON_FOCUS_VIS_NOHI( 3, "", ;, exec "set ui_hint_text @MPUI_DESC_CREATE_A_CLASS_LOCKED; set ui_show_arrow 1", CLEARUIHINT, when( stat( 260 ) < 1 && IS_LOBBY_HOST ) )
CHOICE_DBUTTON_VIS( 3, "@MPUI_CREATE_A_CLASS", when( stat( 260 ) < 1 && IS_LOBBY_HOST ) )
CHOICE_NEWICON_VIS( 3, "specialty_new", when( ANY_NEW_CAC && IS_LOBBY_HOST) )
CHOICE_LOCKEDICON_VIS( 3, "specialty_locked", when( stat( 260 ) < 1 && IS_LOBBY_HOST ) )
CHOICE_BUTTON_FOCUS_VIS( 4, "@MPUI_BARRACKS", SETUP_ACTION_BARRACKS, ;, ;, when( IS_LOBBY_HOST ) )
CHOICE_NEWICON_VIS( 4, "specialty_new", when( ( stat( 263 ) > 1 || stat( 261 ) > 1 || PRESTIGE_AVAIL ) && stat( 267 )==0 && IS_LOBBY_HOST ); )
CHOICE_BUTTON_FOCUS_VIS_ADV( 5, "@MPUI_LOBBY_PRIVACY", open popup_party_privacy;, ;, CLEARUIHINT, when(IS_LOBBY_HOST), (IS_LOBBY_HOST) )
// CLIENT OPTIONS
CHOICE_BUTTON_BG( 1, when( IS_NOT_PARTY_HOST ) )
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 1, "@MPUI_CREATE_A_CLASS", SETUP_ACTION_CREATEACLASS,;, CLEARUIHINT, when( stat( 260 ) >= 1 && IS_NOT_LOBBY_HOST ), ; )
CHOICE_BUTTON_FOCUS_VIS_NOHI( 1, "", ;, exec "set ui_hint_text @MPUI_DESC_CREATE_A_CLASS_LOCKED; set ui_show_arrow 1", CLEARUIHINT, when( stat( 260 ) < 1 && IS_NOT_LOBBY_HOST ) )
CHOICE_DBUTTON_VIS( 1, "@MPUI_CREATE_A_CLASS", when( stat( 260 ) < 1 && IS_NOT_LOBBY_HOST ) )
CHOICE_NEWICON_VIS( 1, "specialty_new", when( ANY_NEW_CAC && IS_NOT_LOBBY_HOST) )
CHOICE_LOCKEDICON_VIS( 1, "specialty_locked", when( stat( 260 ) < 1 && IS_NOT_LOBBY_HOST ) )
CHOICE_BUTTON_BG( 2, when( IS_NOT_LOBBY_HOST ) )
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 2, "@MPUI_BARRACKS", SETUP_ACTION_BARRACKS, ;, CLEARUIHINT, when( IS_NOT_LOBBY_HOST ), ; )
CHOICE_NEWICON_VIS( 2, "specialty_new", when( ( stat( 263 ) > 1 || stat( 261 ) > 1 || ( PRESTIGE_AVAIL && stat( 267 )==0 ) ) && IS_NOT_LOBBY_HOST ); )
// --------- button ----------
#ifndef PC
itemDef
{
rect -140 -4 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
origin 0 0
text "@PLATFORM_INVITE_FRIENDS"
textfont CHOICE_TEXTFONT
textscale TEXTSIZE_SMALL
textalign ITEM_ALIGN_BOTTOM_LEFT
execkeyint BUTTON_Y {SETUP_ACTION_INVITE;}
visible when( ( !dvarbool( ui_partyFull ) ) && ( dvarint( party_privacyStatus ) != 3 ) && dvarbool ( invite_visible ) )
decoration
}
#endif //#ifndef PC
itemDef
{
rect 44 -4 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
origin 0 0
text "@PLATFORM_GAME_SUMMARY"
textfont CHOICE_TEXTFONT
textscale TEXTSIZE_SMALL
textalign ITEM_ALIGN_BOTTOM_LEFT
execkeyint BUTTON_BACK {open "popup_unlock";}
visible when( dvarbool( invite_visible ) )
decoration
}
#include "ui_mp/navcontrols.inc"
// ---------------------- party status description -------------------------
PREPROC_GRADIENT_TOP_LINE_DRAW_ALIGNED( 0, -10, 210, 20, CHOICE_HORIZONTAL_ALIGN, VERTICAL_ALIGN_TOP, ORIGIN_DESCRIPTION, "menu_white_line_faded", 0 0 0 0.5 )
STATUS_AREA( "@MENU_STATUS_OPEN_DESC", STATUS_X, STATUS_Y, when( dvarint( "party_privacyStatus" ) == 0 ) )
STATUS_AREA( "@MENU_STATUS_OPEN_FRIENDS_DESC", STATUS_X, STATUS_Y, when( dvarint( "party_privacyStatus" ) == 1 ) )
STATUS_AREA( "@MENU_STATUS_INVITE_ONLY_DESC", STATUS_X, STATUS_Y, when( dvarint( "party_privacyStatus" ) == 2 ) )
STATUS_AREA( "@MENU_STATUS_CLOSE_DESC", STATUS_X, STATUS_Y, when( dvarint( "party_privacyStatus" ) == 3 ) )
#define Y_OFFSET 40
PREPROC_SHADER_DRAW_ALIGNED_VIS( (STATUS_X) (STATUS_Y+Y_OFFSET-12) 10 10 CHOICE_HORIZONTAL_ALIGN VERTICAL_ALIGN_TOP, 0 0, "ui_arrow_right", 1 1 1 0.4, 0, 1, 1 1 1 1, when( dvarBool( ui_show_arrow ) ) )
PREPROC_TEXT_DRAW_ALIGNED_EXP( (STATUS_X+13) (STATUS_Y+Y_OFFSET) 210 36 CHOICE_HORIZONTAL_ALIGN VERTICAL_ALIGN_TOP, 0 0, dvarString( ui_hint_text ), TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_LEFT, COLOR_BODY_TEXT )
/*
#define Y_OFFSET 20
STATUS_AREA( "@MPUI_STATUS_ANY_LOCALE", STATUS_X, (STATUS_Y+Y_OFFSET), when( dvarint( "geographicalMatchmaking" ) == 0 ) )
STATUS_AREA( "@MPUI_STATUS_LOCALE_PREFERRED", STATUS_X, (STATUS_Y+Y_OFFSET), when( dvarint( "geographicalMatchmaking" ) == 1 ) )
STATUS_AREA( "@MPUI_STATUS_LOCALE_ONLY", STATUS_X, (STATUS_Y+Y_OFFSET), when( dvarint( "geographicalMatchmaking" ) == 2 ) )
*/
// ---------------------- player list -------------------------
#define PLAYERLIST_SCOREVIS 1
#define PLAYERLIST_SELECTED_ACTIONS \
doubleClick { \
open player_popup; \
} \
PAD_LEFT
#include "ui_mp/playerlist.inc"
#include "ui/safearea.menu"
#include "ui/popup_background.inc"
}
#include "ui_mp/popupstyle.inc"
#include "ui/choices_setup_popmenu.menu"
#undef CHOICE_SIZE_X
#define CHOICE_SIZE_X 216
#define FINDGAME_POPUP_X (0)
#define FINDGAME_POPUP_Y (22)
#define CAC_POPUP_X (0)
#define CAC_POPUP_Y (80)
// 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( "private_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
#include "ui_mp/gamesetup_popup.inc"
//#ifdef PS3
GAMESETUP_POPUP( "popup_gamesetup_private", "", GAMESETUP_CFG )
//#else
// GAMESETUP_POPUP( "popup_gamesetup_private", "", GAMESETUP_CFG )
//#endif
// =========================== popups required by code ==========================
}