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

620 lines
18 KiB
Text

#include "ui/menudef.h"
#include "ui_mp/menustyle.inc"
#include "ui/choices_setup_common.menu"
#define PAUSESCREEN_MAP_RECT -150 230 130 120 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP //415 280 130 120 0 0
#define PLATFORM_OFFSET (-20)
#define PAUSESCREEN_OPTION_SIZE 100 16
#define LOCAL_VIS_OBJECTIVE_DISPLAY dvarstring( mapname ) != "coup" && \
dvarstring( mapname ) != "aftermath"
#define LCOAL_VIS_MAP_DISPLAY !dvarBool( ui_hidemap ) && \
dvarstring( mapname ) != "coup" && \
dvarstring( mapname ) != "aftermath" && \
dvarstring( mapname ) != "airplane" && \
dvarstring( mapname ) != "ac130" && \
dvarstring( mapname ) != "jeepride" && \
dvarstring( mapname ) != "simplecredits"
#undef CHOICE_ROW
#define CHOICE_ROW( itemIndex ) ((itemIndex - 1) % 20)
#undef CHOICE_Y
#ifdef PC
#define CHOICE_Y( itemIndex ) (35 + 44 + 20 * CHOICE_ROW( itemIndex ))
#else
#define CHOICE_Y( itemIndex ) (44 + 20 * CHOICE_ROW( itemIndex ))
#endif
#undef CHOICE_ORIGIN
#define CHOICE_ORIGIN( itemIndex ) -267 CHOICE_Y( itemIndex ) //CHOICE_X( itemIndex ) CHOICE_Y( itemIndex )
#define CHOICE_BUTTON_P( itemIndex, textArg, nameArg, actionArg, visArg ) \
CHOICE_BUTTON_BG_P( itemIndex, when( visArg ); ) \
CHOICE_HIGHLIGHT_P( itemIndex, visArg ) \
CHOICE_BUTTON_P_INTERN( itemIndex, textArg, nameArg, actionArg, when( visArg ); )
#undef CHOICE_HORIZONTAL_ALIGN
#define CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_RIGHT
#undef CHOICE_TEXTSTYLE
#define CHOICE_TEXTSTYLE ITEM_TEXTSTYLE_SHADOWED
#undef CHOICE_TEXTALIGN
#define CHOICE_TEXTALIGN ITEM_ALIGN_MIDDLE_RIGHT
#undef CHOICE_TEXT_OFFSET_X
#define CHOICE_TEXT_OFFSET_X -25
#define CHOICE_BUTTON_BG_P( itemIndex, visArg ) \
itemDef \
{ \
style WINDOW_STYLE_SHADER \
rect CHOICE_ORIGIN( itemIndex ) (CHOICE_SIZE_X-(CHOICE_SIZE_Y/4)) CHOICE_SIZE_Y CHOICE_HORIZONTAL_ALIGN CHOICE_VERTICAL_ALIGN \
background "menu_button_backing_right" \
forecolor BUTTON_BG_COLOR \
visible visArg; \
decoration \
}
#define CHOICE_HIGHLIGHT_P( itemIndex, vis ) \
itemDef \
{ \
style WINDOW_STYLE_SHADER \
rect CHOICE_ORIGIN( itemIndex ) (CHOICE_SIZE_X-(CHOICE_SIZE_Y/4)) CHOICE_SIZE_Y CHOICE_HORIZONTAL_ALIGN CHOICE_VERTICAL_ALIGN \
background "menu_button_backing_highlight_right" \
forecolor HIGHLIGHT_COLOR \
border HIGHLIGHT_BORDER \
bordersize 2 \
bordercolor HIGHLIGHT_BORDER_COLOR \
visible when( localVarInt( ui_highlight ) == itemIndex && localVarString( ui_choicegroup ) == CHOICE_GROUP && vis ); \
decoration \
} \
CHOICE_ACCEPT_HINT( itemIndex, vis )
#define CHOICE_BUTTON_P_INTERN( itemIndex, textArg, nameArg, actionArg, visArg ) \
itemDef \
{ \
name nameArg \
type ITEM_TYPE_BUTTON \
rect CHOICE_RECT( itemIndex ) \
exp text( textArg ); \
textfont CHOICE_TEXTFONT \
textscale CHOICE_TEXTSIZE \
textstyle CHOICE_TEXTSTYLE \
textAlign CHOICE_TEXTALIGN \
textAlignX CHOICE_TEXT_OFFSET_X \
forecolor CHOICE_TEXTCOLOR \
visible visArg \
onFocus \
{ \
play "mouse_over"; \
setLocalVarInt ui_highlight itemIndex; \
setLocalVarString ui_choicegroup CHOICE_GROUP; \
} \
leaveFocus \
{ \
setLocalVarInt ui_highlight 0; \
} \
action \
{ \
play "mouse_click"; \
close pausedmenu; \
actionArg; \
} \
} \
#define CHOICE_BUTTON_LOCKED( itemIndex, textArg, nameArg, visArg ) \
CHOICE_BUTTON_BG( itemIndex, when( visArg ); ) \
itemDef { \
name nameArg \
type ITEM_TYPE_BUTTON \
style WINDOW_STYLE_EMPTY \
rect CHOICE_RECT( itemIndex ) \
exp text( textArg ); \
textfont CHOICE_TEXTFONT \
textscale CHOICE_TEXTSIZE \
textstyle CHOICE_TEXTSTYLE \
textAlign CHOICE_TEXTALIGN \
textAlignX CHOICE_TEXT_OFFSET_X \
forecolor 0.3 0.3 0.3 1 \
visible when( visArg ); \
decoration \
}
{
// Pause menu
menuDef
{
name "pausedmenu"
fullScreen 0
#ifdef CONSOLE
rect 0 0 640 480
#else
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN
#endif
focusColor COLOR_FOCUSED
allowedBinding "pause"
onOpen
{
showMenu "pausedbkgnd"
showMenu "objectiveinfo"
showMenu "overheadmap"
focusfirst
nosavehide "saveandquit"
saveAvailableHide "quit";
// profilehide "quitnoprofile"
#ifdef PC
// nosavehide "quitnosave"
exec "update_sv_savegameavailable"
#endif
#ifndef PC
exec "fullscreenview"
#endif
}
onClose
{
hideMenu "pausedbkgnd"
hideMenu "objectiveinfo"
hideMenu "overheadmap"
#ifndef PC
exec "splitscreenview"
#endif
}
onEsc
{
close pausedmenu;
}
#ifdef PC
#define PC_INGAME
#include "ui_mp/overlaybg.inc"
BACKGROUND_BLACK_LETTERBOX_BLURWORLD( 1.0 )
OVERLAY_BACKGROUND
#endif
// "Paused" text
itemDef
{
name "pausedMsg"
text "@MENU_PAUSED_CAP"
rect -150 40 PAUSESCREEN_OPTION_SIZE HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_DEFAULT
forecolor COLOR_TITLE
textscale TEXTSIZE_TITLE
textfont UI_FONT_DEFAULT
textalign ITEM_ALIGN_TOP_LEFT
visible when( !dvarbool( systemlink ) && !dvarbool( onlinegame ) )
decoration
}
//"credits_quit"
#define SETUP_ACTION_CREDITS_QUIT \
setdvar credits_active 0; \
setdvar ui_skipMainLockout 1; \
setdvar credits_frommenu 0; \
exec "disconnect";
#define SETUP_ACTION_ZOMBIEMODE_QUIT \
setdvar zombiemode 0; \
exec "disconnect";
#ifdef PC
#define SETUP_ACTION_MENU_CONTROLS \
close self; \
open "options_controls_new_pc";
#define SETUP_ACTION_MENU_OPTIONS \
execnow "set ui_allow_graphic_change 0"; \
close self; \
open "options_new_pc";
#else
#define SETUP_ACTION_MENU_CONTROLS \
open "ingame_controls";
#define SETUP_ACTION_MENU_OPTIONS \
open "ingameoptions";
#endif //#ifdef PC
#define SOLO \
( !dvarBool( splitscreen ) && !dvarBool( onlinegame ) && !dvarBool( systemlinkparty ) )
#define NOT_SOLO \
( dvarBool(splitscreen) || dvarBool( onlinegame ) || dvarBool( systemlinkparty ) )
#define CUSTOM_MATCH \
( dvarbool( systemlink ) || dvarbool( xblive_privatematch ) )
#define NOT_CUSTOM_MATCH \
( !dvarbool( systemlink ) && !dvarbool( xblive_privatematch ) )
#define XBOX_LIVE_PUBLIC \
( dvarbool( onlinegame ) && !dvarbool( xblive_privatematch ) )
#define SPLITSCREEN_HOST \
( dvarbool( splitscreen ) && issplitscreenhost() == 1 )
#define NOT_SPLITSCREEN_HOST \
( dvarbool( splitscreen ) && issplitscreenhost() != 1 )
#ifdef PC
#define XBOX_LIVE_PRIVATE \
( dvarbool( onlinegame ) )
#else
#define XBOX_LIVE_PRIVATE \
( dvarbool( onlinegame ) && dvarbool( xblive_privatematch ) )
#endif
#define MOVIE_MAPS \
( dvarString( mapname ) == "intro_pac" || dvarString( mapname ) == "outro" )
#define NOT_MOVIE_MAPS \
( dvarString( mapname ) != "intro_pac" && dvarString( mapname ) != "outro" )
// Credits Only
CHOICE_BUTTON_P( 1, "@MENU_RESUME_CREDITS_CAP", "resumegame", ;, dvarstring( "credits_active" ) == "1" )
CHOICE_BUTTON_P( 2, "@PLATFORM_QUIT_CAP", "credits_quit", SETUP_ACTION_CREDITS_QUIT, dvarstring( "credits_active" ) == "1" )
// Resume for Zombie Game
CHOICE_BUTTON_P( 1, "@MENU_ZOMBIE_RESUMEGAME", "resumegame", ;, dvarbool( zombiemode ) )
// Resume Regular
CHOICE_BUTTON_P( 1, "@MENU_RESUMEGAME_CAP", "resumegame", ;, dvarstring( "credits_active" ) != "1" && !dvarbool( zombiemode ) )
CHOICE_BUTTON_P( 2, "@MENU_OPTIONS_UPPER_CASE", ;, SETUP_ACTION_MENU_OPTIONS, dvarstring( "credits_active" ) != "1" )
// Restart Level for SP
CHOICE_BUTTON_P( 3, "@MENU_RESTART_LEVEL_CAP", "restartlevel", open "popup_restart_warning";, dvarstring( "credits_active" ) != "1" && dvarBool( sv_running ) && !dvarbool( arcademode ) && !dvarbool( splitscreen ) && NOT_CUSTOM_MATCH && !dvarbool( onlinegame ) )
// Restart Level for Splitscreen Host alone
CHOICE_BUTTON_P( 3, "@MENU_RESTART_LEVEL_CAP", "restartlevel", open "popup_restart_warning";, dvarstring( "credits_active" ) != "1" && SPLITSCREEN_HOST && NOT_CUSTOM_MATCH )
// Restart Level for any COOP game
CHOICE_BUTTON_P( 3, "@MENU_RESTART_LEVEL_CAP", "restartlevel", open "popup_restart_warning";, dvarstring( "credits_active" ) != "1" && dvarBool( sv_running ) && CUSTOM_MATCH && !dvarbool( splitscreen ) )
#ifdef CONSOLE
// Locked Button for Restart Level
CHOICE_BUTTON_LOCKED( 3, "@MENU_RESTART_LEVEL_CAP", "restartlevel_locked", dvarString( "credits_active" ) != "1" && ( !dvarBool( sv_running ) && CUSTOM_MATCH ) || XBOX_LIVE_PUBLIC || NOT_SPLITSCREEN_HOST )
#else
CHOICE_BUTTON_LOCKED( 3, "@MENU_RESTART_LEVEL_CAP", "restartlevel_locked", dvarString( "credits_active" ) != "1" && !dvarBool( sv_running ) )
CHOICE_BUTTON_P( 3, "@MENU_RESTART_LEVEL_CAP", "restartlevel", open "popup_restart_warning";, dvarstring( "credits_active" ) != "1" && dvarBool( sv_running ) && dvarbool( onlinegame ) )
#endif
// Client Quitting Option : COOP
//"online_leave_quit"
CHOICE_BUTTON_P( 4, "@PLATFORM_QUIT_CAP", "online_leave_quit", open "popup_leavegame_coop";, dvarbool( onlinegame ) && !dvarbool( systemlinkparty ) && !dvarbool( sv_running ) && (!InPrivateParty() || PrivatePartyHost() || !PrivatePartyHostInLobby()) )
CHOICE_BUTTON_P( 4, "@PLATFORM_QUIT_CAP", "online_leave_quit", open "popup_leavegameandparty_coop";, dvarbool( onlinegame ) && !dvarbool( systemlinkparty ) && !dvarbool( sv_running ) && (InPrivateParty() && !PrivatePartyHost() && PrivatePartyHostInLobby()) )
#ifdef CONSOLE
//"systemlinkparty_leave_quit"
CHOICE_BUTTON_P( 4, "@PLATFORM_QUIT_CAP", "systemlinkparty_leave_quit", open "popup_coop_client_quit";, !dvarBool( onlinegame ) && dvarbool( systemlinkparty ) && !dvarbool( sv_running ) && !dvarbool( zombiemode ) )
#else
//"systemlinkparty_leave_quit"
CHOICE_BUTTON_P( 4, "@PLATFORM_QUIT_CAP", "systemlinkparty_leave_quit", open "popup_coop_client_quit";, dvarBool( onlinegame ) && dvarbool( systemlinkparty ) && !dvarbool( sv_running ) )
#endif
// Host Quitting Option : COOP
// "quit_coop"
CHOICE_BUTTON_P( 4, "@PLATFORM_QUIT_CAP", "quit_coop", open "popup_coop_host_quit";, dvarstring( "credits_active" ) != "1" && dvarbool( sv_running ) && ( dvarBool( splitscreen ) || dvarBool( systemlinkparty ) || XBOX_LIVE_PRIVATE ) )
CHOICE_BUTTON_P( 4, "@PLATFORM_QUIT_CAP", "quit_coop", open "popup_coop_host_quit_clone";, dvarstring( "credits_active" ) != "1" && dvarbool( sv_running ) && XBOX_LIVE_PUBLIC && !dvarbool( splitscreen ) && !dvarbool( systemlinkparty ) )
// SOLO Quitting Options
// "quit"
// quit for movie maps
CHOICE_BUTTON_P( 4, "@PLATFORM_QUIT_CAP", "quit", open "popup_general_quit";, dvarstring( "credits_active" ) != "1" && !dvarBool( arcademode ) && dvarbool( sv_running ) && SOLO && MOVIE_MAPS )
// quit for no profile signed in
CHOICE_BUTTON_P( 4, "@PLATFORM_QUIT_CAP", "quit", open "popup_noprofile_quit";, dvarstring( "credits_active" ) != "1" && !dvarBool( arcademode ) && dvarbool( sv_running ) && SOLO && NOT_MOVIE_MAPS )
// "saveandquit" ( displayed when we dont have an available save device )
CHOICE_BUTTON_P( 4, "@PLATFORM_SAVE_AND_QUIT_CAP", "saveandquit", open "popup_savegame_warning";, dvarstring( "credits_active" ) != "1" && !dvarBool( arcademode ) && !dvarBool( zombiemode ) && dvarbool( sv_running ) && SOLO )
// "Quit for Zombie mode"
CHOICE_BUTTON_P( 4, "@PLATFORM_QUIT_CAP", "zombie_quit", open "popup_nosave_quit";, dvarstring( "credits_active" ) != "1" && dvarBool( zombiemode ) && dvarbool( sv_running ) && SOLO )
// "restartCheckpoint"
CHOICE_BUTTON_P( 5, "@MENU_RESTART_CHECKPOINT", "restartCheckpoint", open "popup_checkpoint_restart_warning";, dvarBool( ui_shipping_cheats ) && dvarbool( sv_running ) )
/*
// "difficulty"
#define SETUP_ACTION_RESTART_CHECKPOINT \
play "mouse_click"; \
open "ingame_difficulty"; \
CHOICE_BUTTON_P( 5, "@MENU_LOWER_DIFFICULTY", "difficulty", SETUP_ACTION_QUIT, dvarInt( g_gameskill ) > 0 && dvarString( "credits_active" ) != "1" )
itemDef
{
name "difficulty"
text "@MENU_LOWER_DIFFICULTY"
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
rect -150 164 PAUSESCREEN_OPTION_SIZE HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_DEFAULT
exp rect Y( PLATFORM_OFFSET+164+int(min(dvarInt(g_gameskill),1)*20)-20 );
forecolor COLOR_UNFOCUSED
textscale TEXTSIZE_DEFAULT
textfont UI_FONT_DEFAULT
textstyle ITEM_TEXTSTYLE_SHADOWED
textalign ITEM_ALIGN_TOP_LEFT
visible when( dvarInt( g_gameskill ) > 0 && dvarstring( "credits_active" ) != "1" );
onFocus
{
play "mouse_over";
}
action
{
play "mouse_click";
//close pausedmenu;
open "ingame_difficulty";
}
}
*/
}
#ifdef CONSOLE
// Pause menu background... separate menu so that it can draw behind the objective menu
menuDef
{
name "pausedbkgnd"
fullScreen 0
rect 0 0 640 480
focusColor COLOR_FOCUSED
blurWorld 4.8
// background overlay
itemDef
{
style WINDOW_STYLE_FILLED
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
backcolor 0 0 0 0.50
visible 1
decoration
}
// gradient_top
itemDef
{
style WINDOW_STYLE_SHADER
rect 0 0 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0
background "gradient_top"
visible 1
decoration
}
// gradient_bottom
itemDef
{
style WINDOW_STYLE_SHADER
rect 0 480 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0
background "gradient_bottom"
visible 1
decoration
}
#ifndef PC
#include "ui/navcontrols.menu"
#endif
}
#else
// looke for overlaybg.inc
#endif
// objective info... shown when paused, or on PC when "TAB" is held
menuDef
{
name "objectiveinfo"
fullScreen 0
rect 0 0 640 480
focusColor COLOR_FOCUSED
// top black border
itemDef
{
style WINDOW_STYLE_SHADER
rect -107 0 854 66
forecolor 1 1 1 1
background "menu_black_line"
visible 1
decoration
}
// bottom black border
itemDef
{
style WINDOW_STYLE_SHADER
rect -107 420 854 70 //-50 0 50 480 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_BOTTOM
forecolor 1 1 1 1
background "menu_black_line"
visible 1
decoration
}
// objective header
/*
itemDef
{
type ITEM_TYPE_TEXT
origin 48 68
forecolor COLOR_TITLE
textfont UI_FONT_NORMAL
textscale TEXTSIZE_TITLE
textalign ITEM_ALIGN_TOP_LEFT
visible when ( dvarstring( "credits_active" ) != "1" && LOCAL_VIS_OBJECTIVE_DISPLAY );
ownerdraw CG_MISSION_OBJECTIVE_HEADER
decoration
}
*/
CHOICE_MENU_TITLE( "@MENU_MISSIONOBJECTIVES_CAP" )
// objective check box stub
itemDef
{
name "objectivecheckbox"
//rect 15 75 16 16
rect 37 99 16 16
forecolor 1.0 1.0 1.0 1.0
textscale 0.38
textfont UI_FONT_DEFAULT
textstyle ITEM_TEXTSTYLE_SHADOWED
visible when ( LOCAL_VIS_OBJECTIVE_DISPLAY );
ownerdraw CG_MISSION_OBJECTIVE_LIST
decoration
}
// map --------------------
/*
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "compass_map_default"
ownerdraw CG_PLAYER_COMPASS_MAP
visible when ( LCOAL_VIS_MAP_DISPLAY );
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "hud_objective_tank"
ownerdraw CG_PLAYER_COMPASS_TANKS
visible when ( LCOAL_VIS_MAP_DISPLAY );
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "white"
ownerdraw CG_PLAYER_COMPASS_AUTOMOBILES
visible when ( LCOAL_VIS_MAP_DISPLAY );
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "compass_objpoint_airstrike"
ownerdraw CG_PLAYER_COMPASS_PLANES
visible when ( LCOAL_VIS_MAP_DISPLAY );
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "compass_objpoint_helicopter"
ownerdraw CG_PLAYER_COMPASS_HELICOPTERS
visible when ( LCOAL_VIS_MAP_DISPLAY );
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "compassping_friendly"
ownerdraw CG_PLAYER_COMPASS_ACTORS
visible when ( LCOAL_VIS_MAP_DISPLAY );
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "compassping_player"
ownerdraw CG_PLAYER_COMPASS_PLAYER
visible when ( LCOAL_VIS_MAP_DISPLAY );
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "objective_line"
ownerdraw CG_PLAYER_COMPASS_POINTERS
visible when ( LCOAL_VIS_MAP_DISPLAY );
decoration
}
*/
}
// overhead map - old map code opens
menuDef
{
name "overheadmap"
fullScreen 0
rect 0 0 640 480
focusColor COLOR_FOCUSED
visible when ( issplitscreen() != 1 );
/*
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "compass_map_default"
ownerdraw CG_PLAYER_COMPASS_MAP
visible 1
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "hud_objective_tank"
ownerdraw CG_PLAYER_COMPASS_TANKS
visible 1
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "white"
ownerdraw CG_PLAYER_COMPASS_AUTOMOBILES
visible 1
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "compass_objpoint_airstrike"
ownerdraw CG_PLAYER_COMPASS_PLANES
visible 1
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "compass_objpoint_helicopter"
ownerdraw CG_PLAYER_COMPASS_HELICOPTERS
visible 1
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "compassping_friendly"
ownerdraw CG_PLAYER_COMPASS_ACTORS
visible 1
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "compassping_player"
ownerdraw CG_PLAYER_COMPASS_PLAYER
visible 1
decoration
}
itemDef
{
rect PAUSESCREEN_MAP_RECT
forecolor 1 1 1 1
background "objective_line"
ownerdraw CG_PLAYER_COMPASS_POINTERS
visible 1
decoration
}*/
}
}