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

398 lines
15 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"
#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_RECOMMENDEDPLAYERS (- (PLAYERLIST_WIDTH - RIGHTITEM_OFFSET)) 38
#define ORIGIN_DESCRIPTION (CHOICE_X_START + 12) 160
#define STATUS_X (CHOICE_X_START + 12)
#define STATUS_Y 180//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
{
exec "restoreactiveclients"
#ifdef PC
uiScript acceptServerSettings;
#endif
execnow "xblive_rankedmatch 0";
execnow "party_timerVisible 0";
execnow "xblive_privatematch 1";
exec "exec dvar_defaults.cfg";
exec "set ui_inviteonly 0";
// popup for rank promotion
uiScript openMenuOnDvar "ui_lobbypopup" summary "popup_unlock";
execnow "set ui_lobbypopup_text summary";
exec "set ui_lobbypopup none";
show dpad_left;
show selection_left;
hide dpad_right;
hide selection_right;
exec "selectStringTableEntryInDvar maps/didyouknow_coop.csv 0 didyouknow";
execOnDvarStringValue "ui_gametype" zom "set arcademode 0";
focusFirst;
}
onClose
{
hide selection_right;
}
onEsc
{
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/blurredbg.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 UI_FONT_NORMAL
textscale TEXTSIZE_SMALL
textaligny -6
textalign ITEM_ALIGN_RIGHT
visible when ( InLobby() )
decoration
}
/*
itemDef
{
type ITEM_TYPE_TEXT
rect 0 0 256 15 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP
origin ORIGIN_RECOMMENDEDPLAYERS
forecolor CHOICE_TEXTCOLOR
textfont UI_FONT_DEFAULT
textscale TEXTSIZE_SMALL
textaligny -6
exp text ( locstring( "@MPUI_RECOMMENDEDPLAYERS", int( min( dvarint( party_maxplayers ), maxrecommendedplayers() ) ) ) );
visible when ( privatepartyhost() )
decoration
}
*/
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( dvarString( psn ) != "" && dvarbool( invite_visible ) );
decoration
}
// ----------------------------map images------------------------------------
#include "ui_mp/game_info.inc"
#define MAPIMAGE tableLookup( "maps/mapsTable.csv", 0, dvarString( ui_mapname ), 4 )
#define MAPNAME tableLookup( "maps/mapstable.csv", 0, dvarString( ui_mapname ), 3 )
#define GAMETYPENAME_WITH_SCORING tableLookup( "maps/gametypesTable.csv", 0, dvarString( ui_gametype ), 1 )
#define GAMETYPENAME_WITHOUT_SCORING tableLookup( "maps/gametypesTable.csv", 0, dvarString( ui_gametype ), 3 )
GAME_INFO( MAPIMAGE, "@" + MAPNAME, "@" + GAMETYPENAME_WITH_SCORING, dvarbool( arcademode ) || dvarbool( zombiemode ) )
GAME_INFO( MAPIMAGE, "@" + MAPNAME, "@" + GAMETYPENAME_WITHOUT_SCORING, !dvarbool( arcademode ) && !dvarbool( zombiemode ) )
//=========================================================
//===================== MENU SELECTION ====================
//=========================================================
#define SETUP_EXTRA_FIRST \
execKeyInt DPAD_UP { \
setfocus last_in_list; } \
execKeyInt APAD_UP { \
setfocus last_in_list; }
#define SETUP_EXTRA_LAST \
name last_in_list \
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_STARTMATCH \
execOnDvarIntValue party_playerCount 1 "openmenu startmatch_popup"; \
execOnDvarIntValue party_playerCount 2 "xpartygo"; \
execOnDvarIntValue party_playerCount 3 "xpartygo"; \
execOnDvarIntValue party_playerCount 4 "xpartygo";
#define SETUP_ACTION_STARTMATCH_CHEATS \
exec "xpartygo";
#ifdef CONSOLE
#define SETUP_ACTION_GAMESETUP \
open "settings";
#else
#define SETUP_ACTION_GAMESETUP \
open "pc_gamesetup_coop";
#endif
#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";
#ifdef XENON
#define FIND_MATCH_TEXT "@MPUI_FIND_MATCH"
#else
#define FIND_MATCH_TEXT "@MPUI_FIND_GAME"
#endif
#define IS_PARTY_HOST ( privatepartyhost() || dvarbool( onlinegameandhost ) )
#define IS_NOT_PARTY_HOST ( !privatepartyhost() && dvarbool( onlinegameandhost ) == 0 )
CHOICE_BUTTON_BG( 1, when( IS_PARTY_HOST ) )
CHOICE_HIGHLIGHT( 1, 1 )
CHOICE_BUTTON_VIS_NOHI( 1, "@MPUI_START_MATCH", SETUP_ACTION_STARTMATCH, when( IS_PARTY_HOST && !dvarbool( ui_shipping_cheats ) && !dvarbool( cg_development ) ) )
CHOICE_BUTTON_VIS_NOHI( 1, "@MPUI_START_MATCH", SETUP_ACTION_STARTMATCH_CHEATS, when( IS_PARTY_HOST && (dvarbool( ui_shipping_cheats ) || dvarbool( cg_development ) ) ) )
CHOICE_BUTTON_VIS_NOHI( 1, "", ;, when( IS_NOT_PARTY_HOST ) )
CHOICE_DBUTTON_VIS( 1, "@MPUI_START_MATCH", when( IS_NOT_PARTY_HOST ) )
CHOICE_BUTTON_VIS( 2, "@MENU_SETTINGS", SETUP_ACTION_GAMESETUP, when( IS_PARTY_HOST ) )
CHOICE_BUTTON_VIS_NOHI( 2, "", ;, when( IS_NOT_PARTY_HOST ) )
CHOICE_DBUTTON_VIS( 2, "@MENU_SETTINGS", when( IS_NOT_PARTY_HOST ) )
CHOICE_BUTTON( 3, "@MPUI_BARRACKS", SETUP_ACTION_BARRACKS )
CHOICE_BUTTON_VIS( 4, "@MPUI_LOBBY_PRIVACY", open popup_party_privacy;, when( IS_PARTY_HOST ) )
CHOICE_BUTTON_VIS_NOHI( 4, "", ;, when( IS_NOT_PARTY_HOST ) )
CHOICE_DBUTTON_VIS( 4, "@MPUI_LOBBY_PRIVACY", when( IS_NOT_PARTY_HOST ) )
/*
CHOICE_BUTTON_FOCUS_VIS_EX( 1, "@MPUI_START_MATCH", SETUP_ACTION_STARTMATCH, exec "set ui_hint_text @MPUI_DESC_START_MATCH", CLEARUIHINT, when( IS_PARTY_HOST && !dvarbool( ui_shipping_cheats ) && !dvarbool( cg_development ) ), SETUP_EXTRA_FIRST )
CHOICE_BUTTON_FOCUS_VIS_EX( 1, "@MPUI_START_MATCH", SETUP_ACTION_STARTMATCH_CHEATS, exec "set ui_hint_text @MPUI_DESC_START_MATCH", CLEARUIHINT, when( IS_PARTY_HOST && (dvarbool( ui_shipping_cheats ) || dvarbool( cg_development ) ) ), SETUP_EXTRA_FIRST )
CHOICE_BUTTON_FOCUS_VIS_NOHI_EX( 1, "", ;, exec "set ui_hint_text @MPUI_DESC_START_MATCH_LOCKED", CLEARUIHINT, when( IS_NOT_PARTY_HOST ), SETUP_EXTRA_FIRST )
CHOICE_DBUTTON_VIS( 1, "@MPUI_START_MATCH", when( IS_NOT_PARTY_HOST ) )
CHOICE_BUTTON_FOCUS_VIS( 2, "@MENU_SETTINGS", SETUP_ACTION_GAMESETUP, exec "set ui_hint_text @MPUI_DESC_GAME_SETUP", CLEARUIHINT, when( IS_PARTY_HOST ) )
CHOICE_BUTTON_FOCUS_VIS_NOHI( 2, "", ;, exec "set ui_hint_text @MPUI_DESC_GAME_SETUP_LOCKED", CLEARUIHINT, when( IS_NOT_PARTY_HOST ) )
CHOICE_DBUTTON_VIS( 2, "@MENU_SETTINGS", when( IS_NOT_PARTY_HOST ) )
CHOICE_BUTTON_FOCUS_VIS( 3, "@MPUI_LOBBY_PRIVACY", open popup_party_privacy;, exec "set ui_hint_text @MPUI_DESC_PARTY_PRIVACY", CLEARUIHINT, when( IS_PARTY_HOST ) )
CHOICE_BUTTON_FOCUS_VIS_NOHI( 3, "", ;, exec "set ui_hint_text @MPUI_DESC_PARTY_PRIVACY_LOCKED", CLEARUIHINT, when( IS_NOT_PARTY_HOST ) )
CHOICE_DBUTTON_VIS( 3, "@MPUI_LOBBY_PRIVACY", when( IS_NOT_PARTY_HOST ) )
CHOICE_BUTTON_FOCUS_VIS_EX( 4, "@MPUI_BARRACKS", SETUP_ACTION_BARRACKS, exec "set ui_hint_text @MPUI_DESC_CHALLENGES", CLEARUIHINT, 1, SETUP_EXTRA_LAST name last_in_list )
*/
#ifndef PC
// --------- button ----------
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
#ifdef PC
// --------- overrided back button from navcontrols ----------
itemDef {
name back
text "@PLATFORM_BACK"
type 1
style WINDOW_STYLE_FILLED
forecolor TEXTBUTTON_COLOR
textstyle ITEM_TEXTSTYLE_SHADOWED
rect -250 -26 40 20 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
textfont CHOICE_TEXTFONT
textalign ITEM_ALIGN_LEFT
textscale TEXTSIZE_SMALL
textaligny 18
visible 1
mouseEnter { play "mouse_over"; }
action
{
play "mouse_click";
open leavelobbywarning;
}
}
#undef BACK_ENABLE
#define BACK_ENABLE 0
#endif
#include "ui/navcontrols.inc"
// ---------------------- menu selection description -------------------------
//PREPROC_GRADIENT_DRAW_ALIGNED( 0, 0, 220, 20, CHOICE_HORIZONTAL_ALIGN, VERTICAL_ALIGN_TOP, ORIGIN_DESCRIPTION, "menu_white_line_faded", 0 0 0 0.5 )
PREPROC_GRADIENT_TOP_LINE_DRAW_ALIGNED_VIS( 0, 0, 220, 60, CHOICE_HORIZONTAL_ALIGN, VERTICAL_ALIGN_TOP, ORIGIN_DESCRIPTION, "menu_white_line_faded", 0 0 0 0.5, when( dvarString( "ui_gametype" ) != "zom" ) )
PREPROC_GRADIENT_TOP_LINE_DRAW_ALIGNED_VIS( 0, 0, 220, 20, CHOICE_HORIZONTAL_ALIGN, VERTICAL_ALIGN_TOP, ORIGIN_DESCRIPTION, "menu_white_line_faded", 0 0 0 0.5, when( dvarString( "ui_gametype" ) == "zom" ) )
#define Y_OFFSET 20
/*
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 ) )
*/
STATUS_AREA( "@MENU_STATUS_OPEN_DESC", STATUS_X, ( STATUS_Y - 20 ), when( dvarint( "party_privacyStatus" ) == 0 ) )
STATUS_AREA( "@MENU_STATUS_OPEN_FRIENDS_DESC", STATUS_X, ( STATUS_Y - 20 ), when( dvarint( "party_privacyStatus" ) == 1 ) )
STATUS_AREA( "@MENU_STATUS_INVITE_ONLY_DESC", STATUS_X, ( STATUS_Y - 20 ), when( dvarint( "party_privacyStatus" ) == 2 ) )
STATUS_AREA( "@MENU_STATUS_CLOSE_DESC", STATUS_X, ( STATUS_Y - 20 ), when( dvarint( "party_privacyStatus" ) == 3 ) )
STATUS_AREA( "@MENU_RULES_DEATHCARDS_ENABLED", STATUS_X, STATUS_Y, when( dvarbool( "ui_hostOptionsEnabled" ) && dvarstring( "ui_gametype" ) != "zom" ) )
STATUS_AREA( "@MENU_RULES_DEATHCARDS_DISABLED", STATUS_X, STATUS_Y, when( !dvarbool( "ui_hostOptionsEnabled" ) && dvarstring( "ui_gametype" ) != "zom" ) )
STATUS_AREA( "@MENU_STATUS_DIFFICULTY_RECRUIT", STATUS_X, ( STATUS_Y + 20 ), when( dvarint( "g_gameskill" ) == 0 && dvarstring( "ui_gametype" ) != "zom" ) )
STATUS_AREA( "@MENU_STATUS_DIFFICULTY_REGULAR", STATUS_X, ( STATUS_Y + 20 ), when( dvarint( "g_gameskill" ) == 1 && dvarstring( "ui_gametype" ) != "zom" ) )
STATUS_AREA( "@MENU_STATUS_DIFFICULTY_HARDENED", STATUS_X, ( STATUS_Y + 20 ), when( dvarint( "g_gameskill" ) == 2 && dvarstring( "ui_gametype" ) != "zom" ) )
STATUS_AREA( "@MENU_STATUS_DIFFICULTY_VETERAN", STATUS_X, ( STATUS_Y + 20 ), when( dvarint( "g_gameskill" ) == 3 && dvarstring( "ui_gametype" ) != "zom" ) )
// ---------------------- player list -------------------------
#define PLAYERLIST_SCOREVIS dvarbool( arcademode )
#define PLAYERLIST_SELECTED_ACTIONS \
doubleClick { \
open player_popup; \
} \
PAD_LEFT
#include "ui/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/gamesetup_popup.inc"
GAMESETUP_POPUP_PRIVATE( "popup_gamesetup_private", "", GAMESETUP_CFG )
// #ifdef PS3
// GAMESETUP_POPUP( "popup_gamesetup_private", "", GAMESETUP_CFG )
// #else
// GAMESETUP_POPUP_PRIVATE( "popup_gamesetup_private", "_milestone", GAMESETUP_CFG )
// #endif
}