464 lines
22 KiB
Text
464 lines
22 KiB
Text
|
#include "ui/menudef.h"
|
||
|
#include "ui_mp/common_macro.inc"
|
||
|
|
||
|
#define CHOICE_SEP_1 5
|
||
|
#define CHOICE_GROUP "challenges"
|
||
|
|
||
|
#include "ui_mp/menustyle.inc"
|
||
|
#include "ui/choices_setup_common.menu"
|
||
|
|
||
|
// menu specifice re-positioning
|
||
|
#ifdef CONSOLE
|
||
|
#undef CHOICE_X_START
|
||
|
#define CHOICE_X_START 0
|
||
|
|
||
|
#undef CHOICE_Y_START
|
||
|
#define CHOICE_Y_START 65//34
|
||
|
#else
|
||
|
#undef CHOICE_X_START
|
||
|
#define CHOICE_X_START 30
|
||
|
|
||
|
#undef CHOICE_Y_START
|
||
|
#define CHOICE_Y_START 65
|
||
|
#endif
|
||
|
|
||
|
#undef CHOICE_POPUP_BACKCOLOR
|
||
|
#define CHOICE_POPUP_BACKCOLOR 0.2 0.2 0.22 1 //0.15 0.15 0.155 1//0.125 0.125 0.1275 1
|
||
|
|
||
|
#undef HIGHLIGHT_COLOR
|
||
|
#define HIGHLIGHT_COLOR 0.9 0.95 1 0.25
|
||
|
|
||
|
#define LABEL_TEXT_COLOR 0.7 0.75 0.75 1
|
||
|
|
||
|
#define TIER_BUTTON( pnum, pnum_s, pstat, porigin ) \
|
||
|
PREPROC_SHADER_DRAW( porigin 36 18, 46 -18, "specialty_new", 1 1 1 1, 1, 1, 0 0 0 0 visible when( stat( int( pstat ) ) > 1 ) ) \
|
||
|
SINGULAR_BUTTON_FULL( pnum, porigin, 112 20, \
|
||
|
"Tier "pnum_s, play "mouse_click" \
|
||
|
execnow "set ui_tier_num "pnum_s \
|
||
|
execnow "set ui_table_name mp/challengeTable_tier"pnum_s".csv" \
|
||
|
statSetUsingTable( pstat, 1 ); \
|
||
|
/*exec "uploadstats";*/ \
|
||
|
open "popup_tier", stat( int( pstat ) ) > 0 )
|
||
|
|
||
|
#define SHOW_DESC( pnum ) \
|
||
|
show "desc_tier"#pnum;
|
||
|
|
||
|
#define HIDE_DESC( pnum ) \
|
||
|
hide "desc_tier"#pnum; \
|
||
|
hide "desc2_tier"#pnum;
|
||
|
|
||
|
#define SHOW_DESC2( pnum ) \
|
||
|
show "desc2_tier"#pnum;
|
||
|
|
||
|
#define HIDE_DESC2( pnum ) \
|
||
|
hide "desc2_tier"#pnum; \
|
||
|
hide "desc_tier"#pnum;
|
||
|
|
||
|
#define HIDEALL_DESC \
|
||
|
HIDE_DESC( 1 ) HIDE_DESC( 6 ) HIDE_DESC( 11 ) HIDE_DESC( 16 ) \
|
||
|
HIDE_DESC( 2 ) HIDE_DESC( 7 ) HIDE_DESC( 12 ) HIDE_DESC( 17 ) \
|
||
|
HIDE_DESC( 3 ) HIDE_DESC( 8 ) HIDE_DESC( 13 ) \
|
||
|
HIDE_DESC( 4 ) HIDE_DESC( 9 ) HIDE_DESC( 14 ) \
|
||
|
HIDE_DESC( 5 ) HIDE_DESC( 10 ) HIDE_DESC( 15 )
|
||
|
|
||
|
#define ORIGIN_DESCRIPTION (CHOICE_X_START + 15) 320
|
||
|
|
||
|
#define LOCAL_TIER_ACTION( pnum_s, pstat ) \
|
||
|
play "mouse_click"; \
|
||
|
execnow "set ui_tier_num "pnum_s; \
|
||
|
execnow "set ui_table_name mp/challengeTable_coop"pnum_s".csv"; \
|
||
|
statSetUsingTable( pstat, 1 ); \
|
||
|
/*exec "uploadstats";*/ \
|
||
|
open "popup_tier"
|
||
|
|
||
|
#define LOCAL_NAME( pnum ) "@"+tablelookup("mp/challengetable_coop.csv",0,pnum,1)
|
||
|
|
||
|
#define LOCAL_DESC( pnum ) \
|
||
|
PREPROC_TEXT_DRAW_ALIGNED_EXP( ORIGIN_DESCRIPTION 220 22 CHOICE_HORIZONTAL_ALIGN VERTICAL_ALIGN_TOP, 0 0, "@"+tablelookup("mp/challengetable_coop.csv",0,pnum,2), CHOICE_TEXTSIZE, 0, 0, ITEM_ALIGN_MIDDLE_LEFT, CHOICE_TEXTCOLOR name "desc_tier"#pnum )
|
||
|
|
||
|
#define LOCAL_DESC2( pnum ) \
|
||
|
PREPROC_TEXT_DRAW_ALIGNED_EXP( ORIGIN_DESCRIPTION 220 22 CHOICE_HORIZONTAL_ALIGN VERTICAL_ALIGN_TOP, 0 0, "@"+tablelookup("mp/challengetable_coop.csv",0,pnum,3), CHOICE_TEXTSIZE, 0, 0, ITEM_ALIGN_MIDDLE_LEFT, CHOICE_TEXTCOLOR name "desc2_tier"#pnum )
|
||
|
|
||
|
#define LOCAL_UNLOCK_COLOR 0.31 0.31 0.33 0.55 //0.21 0.21 0.23 0.65
|
||
|
|
||
|
// ============= init dvars ==============
|
||
|
|
||
|
/*#define INDEX_TIME_PLAYED_OTHER 2313
|
||
|
#define STATTODVAR_TIME_PLAYED_OTHER statGetInDvarUsingTable( 2313, ui_stat_time_played_other );
|
||
|
#define INDEX_TIME_PLAYED_OPFOR 2312
|
||
|
#define STATTODVAR_TIME_PLAYED_OPFOR statGetInDvarUsingTable( 2312, ui_stat_time_played_opfor );
|
||
|
#define INDEX_TIME_PLAYED_ALLIES 2311
|
||
|
#define STATTODVAR_TIME_PLAYED_ALLIES statGetInDvarUsingTable( 2311, ui_stat_time_played_allies );
|
||
|
#define INDEX_SUICIDES 2310
|
||
|
#define STATTODVAR_SUICIDES statGetInDvarUsingTable( 2310, ui_stat_suicides );
|
||
|
#define INDEX_TEAMKILLS 2309
|
||
|
#define STATTODVAR_TEAMKILLS statGetInDvarUsingTable( 2309, ui_stat_teamkills );
|
||
|
#define INDEX_HEADSHOTS 2308
|
||
|
#define STATTODVAR_HEADSHOTS statGetInDvarUsingTable( 2308, ui_stat_headshots );
|
||
|
#define INDEX_ASSISTS 2307
|
||
|
#define STATTODVAR_ASSISTS statGetInDvarUsingTable( 2307, ui_stat_assists );
|
||
|
#define INDEX_DEATH_STREAK 2306
|
||
|
#define STATTODVAR_DEATH_STREAK statGetInDvarUsingTable( 2306, ui_stat_death_streak );
|
||
|
#define INDEX_DEATHS 2305
|
||
|
#define STATTODVAR_DEATHS statGetInDvarUsingTable( 2305, ui_stat_deaths );
|
||
|
#define INDEX_KILL_STREAK 2304
|
||
|
#define STATTODVAR_KILL_STREAK statGetInDvarUsingTable( 2304, ui_stat_kill_streak );
|
||
|
#define INDEX_KILLS 2303
|
||
|
#define STATTODVAR_KILLS statGetInDvarUsingTable( 2303, ui_stat_kills );
|
||
|
#define INDEX_SCORE 2302
|
||
|
#define STATTODVAR_SCORE statGetInDvarUsingTable( 2302, ui_stat_score );
|
||
|
#define INDEX_RANKXP 2301
|
||
|
#define STATTODVAR_RANKXP statGetInDvarUsingTable( 2301, ui_stat_rankxp );
|
||
|
|
||
|
#define STAT_UPDATE \
|
||
|
STATTODVAR_TIME_PLAYED_OTHER; \
|
||
|
STATTODVAR_TIME_PLAYED_OPFOR; \
|
||
|
STATTODVAR_TIME_PLAYED_ALLIES; \
|
||
|
STATTODVAR_TEAMKILLS; \
|
||
|
STATTODVAR_HEADSHOTS; \
|
||
|
STATTODVAR_ASSISTS; \
|
||
|
STATTODVAR_DEATH_STREAK; \
|
||
|
STATTODVAR_DEATHS; \
|
||
|
STATTODVAR_KILL_STREAK; \
|
||
|
STATTODVAR_KILLS; \
|
||
|
STATTODVAR_SCORE; \
|
||
|
STATTODVAR_RANKXP;
|
||
|
*/
|
||
|
// ============== end init =============
|
||
|
|
||
|
{
|
||
|
menuDef
|
||
|
{
|
||
|
name menu_challenges
|
||
|
rect 0 0 640 470 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
|
||
|
focuscolor COLOR_FOCUSED
|
||
|
style WINDOW_STYLE_FILLED
|
||
|
soundloop "music_mainmenu"
|
||
|
border 0
|
||
|
onOpen
|
||
|
{
|
||
|
//#ifdef PC
|
||
|
// STAT_UPDATE
|
||
|
//#endif
|
||
|
|
||
|
HIDEALL_DESC
|
||
|
focusFirst;
|
||
|
setdvar invite_visible "0";
|
||
|
}
|
||
|
onEsc
|
||
|
{
|
||
|
//execnow "uploadstats";
|
||
|
setLocalVarBool ui_inOverlay 1;
|
||
|
close self;
|
||
|
}
|
||
|
onClose
|
||
|
{
|
||
|
setdvar invite_visible "1";
|
||
|
setLocalVarBool ui_inOverlay 0;
|
||
|
}
|
||
|
|
||
|
// ------------------ statics ------------------------
|
||
|
//#include "ui/blurredbg.inc"
|
||
|
#include "ui/overlaybg.inc"
|
||
|
|
||
|
#ifdef PC
|
||
|
BACKGROUND_BLACK_LETTERBOX_BLURWORLD_VIS( 0 , 0 )
|
||
|
OVERLAY_BACKGROUND_VIS( !menuisopen( "menu_xboxlive_barracks" ) )
|
||
|
CHOICE_OVERLAY_TITLE( "@MENU_RANK_AND_CHALLENGES_CAP" )
|
||
|
#else
|
||
|
OVERLAY_BACKGROUND_VIS( !menuisopen( "menu_xboxlive_barracks" ) )
|
||
|
CHOICE_OVERLAY_TITLE( "@MENU_CHALLENGES_CAP" )
|
||
|
#endif
|
||
|
|
||
|
#undef BACK_OPEN
|
||
|
#define BACK_OPEN close self;
|
||
|
#include "ui/navcontrols.inc"
|
||
|
|
||
|
//=========================================================
|
||
|
//===================== MENU SELECTION ====================
|
||
|
//=========================================================
|
||
|
|
||
|
// description arrow thingy
|
||
|
/*
|
||
|
itemDef {
|
||
|
name desc_arrow
|
||
|
style WINDOW_STYLE_SHADER
|
||
|
rect ORIGIN_DESCRIPTION 10 10 CHOICE_HORIZONTAL_ALIGN VERTICAL_ALIGN_TOP
|
||
|
origin -12 6
|
||
|
background "ui_arrow_right"
|
||
|
forecolor 1 1 1 0.3
|
||
|
visible when( !dvarBool(ui_hide_desc) );
|
||
|
decoration
|
||
|
}
|
||
|
|
||
|
LOCAL_DESC( 1 ) LOCAL_DESC2( 1 )
|
||
|
LOCAL_DESC( 2 ) LOCAL_DESC2( 2 )
|
||
|
LOCAL_DESC( 3 ) LOCAL_DESC2( 3 )
|
||
|
LOCAL_DESC( 4 ) LOCAL_DESC2( 4 )
|
||
|
LOCAL_DESC( 5 ) LOCAL_DESC2( 5 )
|
||
|
LOCAL_DESC( 6 ) LOCAL_DESC2( 6 )
|
||
|
LOCAL_DESC( 7 ) LOCAL_DESC2( 7 )
|
||
|
LOCAL_DESC( 8 ) LOCAL_DESC2( 8 )
|
||
|
LOCAL_DESC( 9 ) LOCAL_DESC2( 9 )
|
||
|
LOCAL_DESC( 10 ) LOCAL_DESC2( 10 )
|
||
|
*/
|
||
|
|
||
|
#define COOP_TIER_ACTION \
|
||
|
play "mouse_click"; \
|
||
|
execnow "set ui_table_name mp/challengeTable_coop.csv"; \
|
||
|
/*statSetUsingTable( pstat, 1 ); */ \
|
||
|
/*exec "uploadstats";*/ \
|
||
|
open "popup_tier"
|
||
|
|
||
|
CHOICE_BUTTON_FOCUS_VIS_ADV( 1, LOCAL_NAME(1), LOCAL_TIER_ACTION( "1", "270" ), SHOW_DESC(1), HIDE_DESC(1), 1, 1 )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_ADV( 2, LOCAL_NAME(2), LOCAL_TIER_ACTION( "2", "271" ), SHOW_DESC(2), HIDE_DESC(2), 1, 1 )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_ADV( 3, LOCAL_NAME(3), LOCAL_TIER_ACTION( "3", "272" ), SHOW_DESC(3), HIDE_DESC(3), 1, 1 )
|
||
|
|
||
|
CHOICE_BUTTON_FOCUS_VIS_ADV( 4, LOCAL_NAME(4), LOCAL_TIER_ACTION( "4", "273" ), SHOW_DESC(4), HIDE_DESC(4), 1, 1 )
|
||
|
/*CHOICE_BUTTON_FOCUS_VIS_ADV( 5, LOCAL_NAME(5), LOCAL_TIER_ACTION( "5", "274" ), SHOW_DESC(5), HIDE_DESC(5), 1, 1 )
|
||
|
|
||
|
CHOICE_SEPARATOR( CHOICE_SEP_1 )
|
||
|
|
||
|
CHOICE_BUTTON_FOCUS_VIS_ADV( 6, LOCAL_NAME(6), LOCAL_TIER_ACTION( "6", "275" ), SHOW_DESC(6), HIDE_DESC(6), 1, 1 )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_ADV( 7, LOCAL_NAME(7), LOCAL_TIER_ACTION( "7", "276" ), SHOW_DESC(7), HIDE_DESC(7), 1, 1 )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_ADV( 8, LOCAL_NAME(8), LOCAL_TIER_ACTION( "8", "277" ), SHOW_DESC(8), HIDE_DESC(8), 1, 1 )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_ADV( 9, LOCAL_NAME(9), LOCAL_TIER_ACTION( "9", "278" ), SHOW_DESC(9), HIDE_DESC(9), 1, 1 )
|
||
|
CHOICE_BUTTON_FOCUS_VIS_ADV( 10, LOCAL_NAME(10), LOCAL_TIER_ACTION( "10", "279" ), SHOW_DESC(10), HIDE_DESC(10), 1, 1 )
|
||
|
*/
|
||
|
|
||
|
#ifdef PC
|
||
|
// player stats
|
||
|
#include "ui/player_info.inc"
|
||
|
#endif
|
||
|
|
||
|
#include "ui/safearea.menu"
|
||
|
}
|
||
|
|
||
|
//=========================================================
|
||
|
//====================== TIER POPUPS ======================
|
||
|
//=========================================================
|
||
|
|
||
|
// main popup frame properties ----------------------------
|
||
|
#define ORIGIN_TIER_FRAME_X 46
|
||
|
#define ORIGIN_TIER_FRAME_Y 70
|
||
|
#define ORIGIN_TIER_FRAME ORIGIN_TIER_FRAME_X ORIGIN_TIER_FRAME_Y
|
||
|
|
||
|
#define WIDTH_TIER_FRAME 540
|
||
|
#define HEIGHT_TIER_FRAME 338
|
||
|
#define SIZE_TIER_FRAME WIDTH_TIER_FRAME HEIGHT_TIER_FRAME
|
||
|
#define RECT_TIER_FRAME ORIGIN_TIER_FRAME SIZE_TIER_FRAME
|
||
|
|
||
|
#define COLOR_TIER_FRAME 0.118 0.122 0.137 1//0.1 0.1 0.12 0.85 //0.05 0.1 0.15 0.85 //0.1 0.15 0.25 0.4
|
||
|
|
||
|
#define BORDER_TIER_FRAME WINDOW_BORDER_RAISED
|
||
|
#define BORDER_SIZE_TIER_FRAME 0
|
||
|
#define BORDER_COLOR_TIER_FRAME 0.35 0.35 0.37 1//0.4 0.4 0.425 1
|
||
|
|
||
|
// list box properties -------------------------------------
|
||
|
#define PADDING 8
|
||
|
#define ORIGIN_LIST_BOX_X (ORIGIN_TIER_FRAME_X+PADDING)
|
||
|
#define ORIGIN_LIST_BOX_Y (ORIGIN_TIER_FRAME_Y+PADDING)
|
||
|
|
||
|
#define WIDTH_LIST_BOX ((((WIDTH_TIER_FRAME+8)-PADDING*3)/2))
|
||
|
#define HEIGHT_LIST_BOX ((HEIGHT_TIER_FRAME+4)-PADDING*2)
|
||
|
|
||
|
// info box properties -------------------------------------
|
||
|
#define ORIGIN_INFO_BOX_X (ORIGIN_TIER_FRAME_X+((WIDTH_TIER_FRAME+4+PADDING)/2))
|
||
|
#define ORIGIN_INFO_BOX_Y (ORIGIN_TIER_FRAME_Y+38)
|
||
|
|
||
|
#define WIDTH_INFO_BOX (((WIDTH_TIER_FRAME+4)-PADDING*3)/2)
|
||
|
#define HEIGHT_INFO_BOX 296
|
||
|
|
||
|
#include "ui_mp/popupstyle.inc"
|
||
|
#include "ui/choices_setup_popmenu.menu"
|
||
|
|
||
|
// to be macro menu
|
||
|
menuDef {
|
||
|
name "popup_tier"
|
||
|
visible 0
|
||
|
fullscreen 0
|
||
|
rect 0 0 640 480 0 0
|
||
|
focusColor COLOR_FOCUSED
|
||
|
style WINDOW_STYLE_FILLED
|
||
|
popup
|
||
|
onESC { play "mouse_click"; close "popup_tier" }
|
||
|
onOpen {
|
||
|
exec "set ui_hide_desc 1";
|
||
|
focusFirst; }
|
||
|
onClose{
|
||
|
exec "set ui_hide_desc 0";
|
||
|
}
|
||
|
//=================== main frame ==================
|
||
|
/*macro ex: PREPROC_SHADER_DRAW_ADV( px, py, pw, ph, porigin, pshader, pcolor, pborder, pbordersize, pbordercolor ) */
|
||
|
/*mainframe PREPROC_SHADER_DRAW( RECT_TIER_FRAME, 2 2, "white", 0.25 0.25 0.27 1, 0, 0, 0 0 0 0 ) */
|
||
|
/*mainframe*/ PREPROC_SHADER_DRAW( RECT_TIER_FRAME, 0 0, "white", COLOR_TIER_FRAME, BORDER_TIER_FRAME, BORDER_SIZE_TIER_FRAME, BORDER_COLOR_TIER_FRAME )
|
||
|
/*mainframe*/ PREPROC_SHADER_DRAW( RECT_TIER_FRAME, 0 0, "line_horizontal", 0.267 0.271 0.278 1, 0, 0, 1 1 1 1 )
|
||
|
/*listbox*/ PREPROC_SHADER_DRAW_ADV( ORIGIN_LIST_BOX_X, ORIGIN_LIST_BOX_Y, WIDTH_LIST_BOX, HEIGHT_LIST_BOX, "gradient_center", 0 0 0 0.88, WINDOW_BORDER_SUNKEN, BORDER_SIZE_TIER_FRAME, BORDER_COLOR_TIER_FRAME )
|
||
|
/*infobox*/ PREPROC_SHADER_DRAW_ADV( ORIGIN_INFO_BOX_X, ORIGIN_INFO_BOX_Y, WIDTH_INFO_BOX, HEIGHT_INFO_BOX, "gradient_center", 0 0 0 0.55, WINDOW_BORDER_SUNKEN, BORDER_SIZE_TIER_FRAME, BORDER_COLOR_TIER_FRAME )
|
||
|
/*title*/ PREPROC_TEXT_DRAW_ADV( ORIGIN_INFO_BOX_X, ORIGIN_INFO_BOX_Y-2, WIDTH_INFO_BOX, 40, exp text( "@"+tablelookup("mp/challengeTable_coop.csv",0,dvarString( ui_tier_num ),2) ), TEXTSIZE_DEFAULT, 0, -6, ITEM_ALIGN_CENTER, LABEL_TEXT_COLOR )
|
||
|
|
||
|
// ------ CHALLENGE ITEM NAME ------
|
||
|
#define PQ_NAME_IDX(pslot_s) \
|
||
|
int( tablelookup( dvarString(ui_table_name), 1, pslot_s, 0 ) )
|
||
|
|
||
|
#define PQ_NAME_STAT_VALUE(pslot_s) \
|
||
|
stat( int( tablelookup( dvarString(ui_table_name), 1, pslot_s, 2 ) ) )
|
||
|
|
||
|
// capped between 1 and 3
|
||
|
#define PQ_NAME_LEVEL(pslot_s) \
|
||
|
int( min( int( tablelookup( dvarString(ui_table_name), 1, pslot_s, 6 ) ), max( 1, PQ_NAME_STAT_VALUE(pslot_s) ) ) )
|
||
|
|
||
|
#define PQ_NAME_STRING(pslot_s) \
|
||
|
string( PQ_NAME_IDX(pslot_s) + PQ_NAME_LEVEL(pslot_s) - 1 )
|
||
|
|
||
|
#define PQ_NAME(pslot_s) \
|
||
|
"@"+tablelookup( dvarString(ui_table_name), 0, PQ_NAME_STRING(pslot_s), 8 )
|
||
|
|
||
|
// ------ PROGRESS BAR WDITH ------
|
||
|
#define PQ_RAW(preturn) \
|
||
|
tablelookup( dvarString(ui_table_name), 0, PQ_NAME_STRING(dvarString(ui_table_slot)), preturn )
|
||
|
|
||
|
#define PQ_RAW2(pslot_s) \
|
||
|
tablelookup( dvarString(ui_table_name), 0, PQ_NAME_STRING(pslot_s), 4 )
|
||
|
|
||
|
#define PQ_RAW_LEVEL_IRRELEVANT(preturn) \
|
||
|
tablelookup( dvarString(ui_table_name), 1, dvarString(ui_table_slot), preturn )
|
||
|
|
||
|
#define PROGRESS_BAR_PROGRESS_STATDATA(pslot_s) \
|
||
|
stat( int( tablelookup( dvarString(ui_table_name), 1, pslot_s, 3 ) ) )
|
||
|
|
||
|
#define PROGRESS_BAR_WIDTH( pslot_s ) \
|
||
|
min( PROGRESS_BAR_PROGRESS_STATDATA(pslot_s) / int( PQ_RAW2(pslot_s) ), 1 )
|
||
|
|
||
|
// ------ VISIBLE WHEN ------
|
||
|
#define CHALLENGE_COMPLETE_RAW( ptablename, ptableslot ) \
|
||
|
visible when( stat( int( tablelookup( ptablename, 1, ptableslot, 2 ) ) ) == 255 )
|
||
|
#define CHALLENGE_COMPLETE CHALLENGE_COMPLETE_RAW( dvarString(ui_table_name), dvarString(ui_table_slot) )
|
||
|
#define CHALLENGE_COMPLETE_S(pslot_s) CHALLENGE_COMPLETE_RAW( dvarString(ui_table_name), pslot_s )
|
||
|
|
||
|
#define CHALLENGE_INCOMPLETE( ptablename, ptableslot ) \
|
||
|
( stat( int( tablelookup( ptablename, 1, ptableslot, 2 ) ) ) != 255 )
|
||
|
|
||
|
#define VIS_WHEN_CHALLENGE_INPROGRESS( ptablename, ptableslot ) \
|
||
|
visible when( ( tablelookup( ptablename, 1, ptableslot, 2 ) != "" ) && ( stat( int( tablelookup( ptablename, 1, ptableslot, 2 ) ) ) > 0 ) && CHALLENGE_INCOMPLETE( ptablename, ptableslot ) )
|
||
|
#define VIS_WHEN_INPROGRESS VIS_WHEN_CHALLENGE_INPROGRESS( dvarString(ui_table_name), dvarString(ui_table_slot) )
|
||
|
#define VIS_WHEN_INPROGRESS_S(pslot_s) VIS_WHEN_CHALLENGE_INPROGRESS( dvarString(ui_table_name), pslot_s )
|
||
|
|
||
|
// ------ CHALLENGE ITEMS ------
|
||
|
#define LIST_ITEM_HEIGHT 14
|
||
|
#define LIST_ITEM_COLOR 0.7 0.75 0.75 0.8
|
||
|
#define LIST_ITEM_COLOR_LOCKED 0.4 0.45 0.45 0.8
|
||
|
|
||
|
#define PREPROC_LIST_ITEM( pslot, pslot_s ) \
|
||
|
itemDef { \
|
||
|
type ITEM_TYPE_BUTTON \
|
||
|
exp rect X( ORIGIN_LIST_BOX_X+10 ) \
|
||
|
exp rect Y( ORIGIN_LIST_BOX_Y+4+(pslot-1)*(LIST_ITEM_HEIGHT+2) ) \
|
||
|
exp rect W( WIDTH_LIST_BOX-58 ) \
|
||
|
exp rect H( LIST_ITEM_HEIGHT ) \
|
||
|
forecolor 1 1 0.5 1 \
|
||
|
visible when( tablelookup(dvarString(ui_table_name),1,pslot_s,2)!="" ) \
|
||
|
onFocus { play "mouse_over"; \
|
||
|
execnow "set ui_table_slot "pslot_s } \
|
||
|
} \
|
||
|
/* item bg box */ PREPROC_SHADER_DRAW_ADV( ORIGIN_LIST_BOX_X+8, ORIGIN_LIST_BOX_Y+4+(pslot-1)*(LIST_ITEM_HEIGHT+2), WIDTH_LIST_BOX-58-(LIST_ITEM_HEIGHT/4), LIST_ITEM_HEIGHT, "menu_white_line", 0.588 0.660 0.672 0.1, 0, 1, 1 1 1 0.25 ) \
|
||
|
/* item bg box edge */ /* PREPROC_SHADER_DRAW_ADV( (ORIGIN_LIST_BOX_X+WIDTH_LIST_BOX-50)-(LIST_ITEM_HEIGHT/4), ORIGIN_LIST_BOX_Y+4+(pslot-1)*(LIST_ITEM_HEIGHT+2), LIST_ITEM_HEIGHT/4, LIST_ITEM_HEIGHT, "button_highlight_end", 0.8 0.85 0.95 0.1, 0, 1, 1 1 1 0.25 ) */ \
|
||
|
/* bar bg box */ PREPROC_SHADER_DRAW_ADV( ORIGIN_LIST_BOX_X+WIDTH_LIST_BOX-46, ORIGIN_LIST_BOX_Y+5+(pslot-1)*(LIST_ITEM_HEIGHT+2), 36, LIST_ITEM_HEIGHT-2, "white", 0.705 0.754 0.805 0.1, 0, 0, 0.8 0.85 0.95 0.25 ) \
|
||
|
/* progress bar */ PREPROC_SHADER_DRAW_ADV( ORIGIN_LIST_BOX_X+WIDTH_LIST_BOX-46, ORIGIN_LIST_BOX_Y+5+(pslot-1)*(LIST_ITEM_HEIGHT+2), 36*(PROGRESS_BAR_WIDTH(pslot_s)), LIST_ITEM_HEIGHT-2, "menu_white_line", 0.667 0.612 0.373 1, 0, 1, 1 0.9 0.5 0.6 ) \
|
||
|
/* complete */ PREPROC_TEXT_DRAW_ADV( ORIGIN_LIST_BOX_X+WIDTH_LIST_BOX-49, ORIGIN_LIST_BOX_Y+3+(pslot)*(LIST_ITEM_HEIGHT+2)-1, 40, LIST_ITEM_HEIGHT, exp text( "@CHALLENGE_DONE" ), TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_CENTER, LIST_ITEM_COLOR_LOCKED CHALLENGE_COMPLETE_S(pslot_s) ) \
|
||
|
/* item name */ PREPROC_TEXT_DRAW_ADV( ORIGIN_LIST_BOX_X+10, ORIGIN_LIST_BOX_Y+2+(pslot)*(LIST_ITEM_HEIGHT+2), WIDTH_LIST_BOX-6, LIST_ITEM_HEIGHT, exp text(PQ_NAME(pslot_s)), TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_LEFT, LIST_ITEM_COLOR ) \
|
||
|
|
||
|
// ------------ info box content display --------------
|
||
|
|
||
|
#define PQ_DESC "@"+PQ_RAW( 9 )
|
||
|
#define PQ_NAME2 "@"+PQ_RAW( 8 )
|
||
|
#define PQ_DESC_UNLOCK PQ_RAW( 10 )
|
||
|
#define PQ_UNLOCKS "@"+PQ_RAW( 11 )
|
||
|
#define PQ_STAT stat( int( PQ_RAW_LEVEL_IRRELEVANT(3) ) )
|
||
|
#define PQ_TARGET PQ_RAW( 4 )
|
||
|
#define PQ_TARGET_SCALE PQ_RAW_LEVEL_IRRELEVANT(15)
|
||
|
|
||
|
// sin cycle for animation of the hightlighting bars
|
||
|
#define F_HEIGHT_OFFSET ((1- ((8+sin(milliseconds()/80))/8) )/2)*LIST_ITEM_HEIGHT
|
||
|
#define F_HEIGHT ((8+sin(milliseconds()/80))/8)*LIST_ITEM_HEIGHT
|
||
|
|
||
|
/* highlight */
|
||
|
//PREPROC_SHADER_DRAW_ADV( ORIGIN_LIST_BOX_X+8, ORIGIN_LIST_BOX_Y+4+(dvarint(ui_table_slot)-1)*(LIST_ITEM_HEIGHT+2), WIDTH_LIST_BOX-58-(LIST_ITEM_HEIGHT/4), LIST_ITEM_HEIGHT,"gradient_fadein", 0.8 0.85 0.95 0.25, 0, 1, 1 1 1 0.65 )
|
||
|
//PREPROC_SHADER_DRAW_ADV( (ORIGIN_LIST_BOX_X+WIDTH_LIST_BOX-50)-(LIST_ITEM_HEIGHT/4), ORIGIN_LIST_BOX_Y+4+(dvarint(ui_table_slot)-1)*(LIST_ITEM_HEIGHT+2), LIST_ITEM_HEIGHT/4, LIST_ITEM_HEIGHT,"button_highlight_end", 0.8 0.85 0.95 0.25, 0, 1, 1 1 1 0.65 )
|
||
|
|
||
|
//PREPROC_SHADER_DRAW_ADV( ORIGIN_LIST_BOX_X+4, ORIGIN_LIST_BOX_Y+4+(dvarint(ui_table_slot)-1)*(LIST_ITEM_HEIGHT+2)+F_HEIGHT_OFFSET, 2, F_HEIGHT,"white", 0.55 1 0.55 0.8, 0, 1, 1 1 1 0.65 )
|
||
|
//PREPROC_SHADER_DRAW_ADV( ORIGIN_LIST_BOX_X+WIDTH_LIST_BOX-6, ORIGIN_LIST_BOX_Y+4+(dvarint(ui_table_slot)-1)*(LIST_ITEM_HEIGHT+2)+F_HEIGHT_OFFSET, 2, F_HEIGHT,"white", 0.55 1 0.55 0.8, 0, 1, 1 1 1 0.65 )
|
||
|
|
||
|
// background bar
|
||
|
//PREPROC_SHADER_DRAW_ADV( ORIGIN_INFO_BOX_X+2, ORIGIN_INFO_BOX_Y+2, WIDTH_INFO_BOX-4, 22,"white", 0.65 0.7 0.8 0.2, 0, 1, 0 0 0 0 )
|
||
|
PREPROC_SHADER_DRAW_ADV( ORIGIN_INFO_BOX_X+2, ORIGIN_INFO_BOX_Y+24, WIDTH_INFO_BOX-4, 2,"white", 0 0 0 0.35, 0, 1, 0 0 0 0 )
|
||
|
PREPROC_GRADIENT_DRAW_ALIGNED( (ORIGIN_INFO_BOX_X+2), (ORIGIN_INFO_BOX_Y+2), (WIDTH_INFO_BOX-4), 22, 0, 0, 0 0, "menu_lobby_title_back", .6 .6 .6 .3 )
|
||
|
// name
|
||
|
PREPROC_TEXT_DRAW_ADV( ORIGIN_INFO_BOX_X+6, ORIGIN_INFO_BOX_Y+20, WIDTH_INFO_BOX-8, 20, exp text( PQ_NAME2 ), TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_LEFT, COLOR_INFO_YELLOW autowrapped )
|
||
|
// desc
|
||
|
PREPROC_TEXT_DRAW_ADV( ORIGIN_INFO_BOX_X+6, ORIGIN_INFO_BOX_Y+44, WIDTH_INFO_BOX-8, 20, exp text( PQ_DESC ), TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_LEFT, LIST_ITEM_COLOR autowrapped )
|
||
|
// desc 2
|
||
|
PREPROC_SHADER_DRAW_ADV( ORIGIN_INFO_BOX_X+2, ORIGIN_INFO_BOX_Y+104, WIDTH_INFO_BOX-4, 2,"white", 0.75 0.8 0.9 0.2, 0, 1, 0 0 0 0 )
|
||
|
PREPROC_SHADER_DRAW_ADV( ORIGIN_INFO_BOX_X+2, ORIGIN_INFO_BOX_Y+102, WIDTH_INFO_BOX-4, 2,"white", 0 0 0 0.35, 0, 1, 0 0 0 0 )
|
||
|
PREPROC_TEXT_DRAW_ADV( ORIGIN_INFO_BOX_X+6, ORIGIN_INFO_BOX_Y+124, WIDTH_INFO_BOX-8, 20, exp text( "@MENU_XP_REWARD" ), TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_LEFT, LIST_ITEM_COLOR autowrapped )
|
||
|
PREPROC_TEXT_DRAW_ADV( ORIGIN_INFO_BOX_X+90, ORIGIN_INFO_BOX_Y+124, WIDTH_INFO_BOX-8, 20, exp text( PQ_DESC_UNLOCK ), TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_LEFT, LIST_ITEM_COLOR autowrapped )
|
||
|
// unlock desc
|
||
|
PREPROC_SHADER_DRAW_ADV( ORIGIN_INFO_BOX_X+2, ORIGIN_INFO_BOX_Y+174, WIDTH_INFO_BOX-4, 2,"white", 0.75 0.8 0.9 0.2, 0, 1, 0 0 0 0 )
|
||
|
PREPROC_SHADER_DRAW_ADV( ORIGIN_INFO_BOX_X+2, ORIGIN_INFO_BOX_Y+172, WIDTH_INFO_BOX-4, 2,"white", 0 0 0 0.35, 0, 1, 0 0 0 0 )
|
||
|
PREPROC_TEXT_DRAW_ADV( ORIGIN_INFO_BOX_X+6, ORIGIN_INFO_BOX_Y+194, WIDTH_INFO_BOX-8, 20, exp text( PQ_UNLOCKS ), TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_LEFT, LIST_ITEM_COLOR autowrapped )
|
||
|
// progress
|
||
|
PREPROC_SHADER_DRAW_ADV( ORIGIN_INFO_BOX_X+2, ORIGIN_INFO_BOX_Y+2, (ORIGIN_INFO_BOX_X-67)*(PROGRESS_BAR_WIDTH(dvarString(ui_table_slot))), 22, "gradient_fadein", 0.8 0.8 0.825 0.175, 0, 1, 0.9 0.95 1 0.25 VIS_WHEN_INPROGRESS )
|
||
|
// progress in text
|
||
|
PREPROC_TEXT_DRAW_ADV( ORIGIN_INFO_BOX_X+43, ORIGIN_INFO_BOX_Y+20, WIDTH_INFO_BOX-52, 20, exp text( int(PQ_STAT / PQ_TARGET_SCALE) + "/" + int(PQ_TARGET / PQ_TARGET_SCALE) ), TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_RIGHT, LIST_ITEM_COLOR autowrapped )
|
||
|
|
||
|
PREPROC_LIST_ITEM( 1, "1" )
|
||
|
PREPROC_LIST_ITEM( 2, "2" )
|
||
|
PREPROC_LIST_ITEM( 3, "3" )
|
||
|
PREPROC_LIST_ITEM( 4, "4" )
|
||
|
PREPROC_LIST_ITEM( 5, "5" )
|
||
|
PREPROC_LIST_ITEM( 6, "6" )
|
||
|
PREPROC_LIST_ITEM( 7, "7" )
|
||
|
PREPROC_LIST_ITEM( 8, "8" )
|
||
|
PREPROC_LIST_ITEM( 9, "9" )
|
||
|
PREPROC_LIST_ITEM( 10, "10" )
|
||
|
PREPROC_LIST_ITEM( 11, "11" )
|
||
|
PREPROC_LIST_ITEM( 12, "12" )
|
||
|
PREPROC_LIST_ITEM( 13, "13" )
|
||
|
PREPROC_LIST_ITEM( 14, "14" )
|
||
|
PREPROC_LIST_ITEM( 15, "15" )
|
||
|
PREPROC_LIST_ITEM( 16, "16" )
|
||
|
PREPROC_LIST_ITEM( 17, "17" )
|
||
|
PREPROC_LIST_ITEM( 18, "18" )
|
||
|
PREPROC_LIST_ITEM( 19, "19" )
|
||
|
PREPROC_LIST_ITEM( 20, "20" )
|
||
|
|
||
|
/* highlight */
|
||
|
PREPROC_SHADER_DRAW_ADV( ORIGIN_LIST_BOX_X+8, ORIGIN_LIST_BOX_Y+4+(dvarint(ui_table_slot)-1)*(LIST_ITEM_HEIGHT+2), WIDTH_LIST_BOX-58-(LIST_ITEM_HEIGHT/4), LIST_ITEM_HEIGHT,"menu_button_backing_highlight", HIGHLIGHT_COLOR, 0, 1, 1 1 1 0.65 )
|
||
|
/* item name focused */
|
||
|
PREPROC_TEXT_DRAW_ADV( ORIGIN_LIST_BOX_X+10, ORIGIN_LIST_BOX_Y+2+(dvarint(ui_table_slot))*(LIST_ITEM_HEIGHT+2), WIDTH_LIST_BOX-6, LIST_ITEM_HEIGHT, exp text(PQ_NAME(dvarString(ui_table_slot))), TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_LEFT, COLOR_FOCUSED )
|
||
|
|
||
|
#ifdef PC
|
||
|
itemDef
|
||
|
{
|
||
|
name back
|
||
|
text "@MENU_BACK"
|
||
|
type 1
|
||
|
style WINDOW_STYLE_FILLED
|
||
|
textstyle ITEM_TEXTSTYLE_SHADOWED
|
||
|
rect -250 -26 40 20 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
|
||
|
textfont UI_FONT_NORMAL
|
||
|
textalign ITEM_ALIGN_LEFT
|
||
|
textscale TEXTSIZE_SMALL
|
||
|
textaligny 18
|
||
|
visible 1
|
||
|
mouseEnter { play "mouse_over"; }
|
||
|
action
|
||
|
{
|
||
|
play "mouse_click";
|
||
|
close self;
|
||
|
}
|
||
|
}
|
||
|
#endif
|
||
|
}
|
||
|
}
|