853 lines
25 KiB
Text
853 lines
25 KiB
Text
// Assumes that "choices_setup_common" has already been included
|
|
|
|
#ifdef PC
|
|
#undef CHOICE_Y_OFFSET
|
|
#define CHOICE_Y_OFFSET 0
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_BORDER_X
|
|
#define CHOICE_POPUP_BORDER_X 19
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_BORDER_Y
|
|
#define CHOICE_POPUP_BORDER_Y 20
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_TITLE_WIDTH
|
|
#define CHOICE_POPUP_TITLE_WIDTH 0
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_TITLE_HEIGHT
|
|
#define CHOICE_POPUP_TITLE_HEIGHT 0
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_TITLE_TEXTSIZE
|
|
#define CHOICE_POPUP_TITLE_TEXTSIZE TEXTSIZE_TITLE
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_SUBTITLE_WIDTH
|
|
#define CHOICE_POPUP_SUBTITLE_WIDTH 0
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_SUBTITLE_HEIGHT
|
|
#define CHOICE_POPUP_SUBTITLE_HEIGHT 0
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_SUBTITLE_TEXTSIZE
|
|
#define CHOICE_POPUP_SUBTITLE_TEXTSIZE TEXTSIZE_DEFAULT
|
|
#endif
|
|
|
|
#ifndef CENTER_POPUP_ON_CLOSE
|
|
#define CENTER_POPUP_ON_CLOSE
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_BORDER_WIDTH
|
|
#define CHOICE_POPUP_BORDER_WIDTH 2
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_BORDER_COLOR
|
|
#define CHOICE_POPUP_BORDER_COLOR 1 1 1 0.5
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_BACKCOLOR
|
|
#define CHOICE_POPUP_BACKCOLOR 0.2 0.2 0.22 1 //0.85 //0.1412 0.1412 0.1812 0.75
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_BACKCOLOR_NOALPHA
|
|
#define CHOICE_POPUP_BACKCOLOR_NOALPHA 0.1412 0.1412 0.1812
|
|
#endif
|
|
|
|
#undef CHOICE_FOCUS_SOUND
|
|
#define CHOICE_FOCUS_SOUND "mouse_submenu_over"
|
|
|
|
#ifndef CHOICE_POPUP_OFFSET_X
|
|
#define CHOICE_POPUP_OFFSET_X 0
|
|
#endif
|
|
|
|
#ifndef CHOICE_POPUP_OFFSET_Y
|
|
#define CHOICE_POPUP_OFFSET_Y 0
|
|
#endif
|
|
|
|
#define CHOICE_POPUP_WIDTH ((CHOICE_POPUP_BORDER_X * 2) + ((CHOICE_POPUP_TITLE_WIDTH > CHOICE_SIZE_X) ? CHOICE_POPUP_TITLE_WIDTH : CHOICE_SIZE_X))
|
|
#define CHOICE_POPUP_HEIGHT( itemCount ) (CHOICE_POPUP_TITLE_HEIGHT + CHOICE_POPUP_SUBTITLE_HEIGHT + (CHOICE_Y_SPACING * (itemCount) + CHOICE_POPUP_BORDER_Y * 2))
|
|
|
|
#define CHOICE_SIDEIMAGE_X 0
|
|
#define CHOICE_SIDEIMAGE_Y 0
|
|
|
|
#define CHOICE_SIDETITLE_X 0
|
|
#define CHOICE_SIDETITLE_Y 0
|
|
|
|
#define CHOICE_SIDETEXT_X 0
|
|
#define CHOICE_SIDETEXT_Y 0
|
|
|
|
|
|
#define CHOICE_POPMENU_SETUP( nameArg, itemCount, xArg, yArg, onEscArg ) \
|
|
CHOICE_POPMENU_SETUP_ONOPEN( nameArg, itemCount, xArg, yArg, onEscArg, focusfirst )
|
|
|
|
#define CHOICE_POPMENU_SETUP_ONOPEN( nameArg, itemCount, xArg, yArg, onEscArg, onOpenArg ) \
|
|
CHOICE_POPMENU_SETUP_ONOPEN_EX( nameArg, itemCount, xArg, yArg, onEscArg, onOpenArg, ; )
|
|
|
|
|
|
#define CHOICE_POPMENU_SETUP_ONOPEN_EX( nameArg, itemCount, xArg, yArg, onEscArg, onOpenArg, extraArgs ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
fullscreen 0 \
|
|
rect (xArg + 1) (yArg + 1) CHOICE_POPUP_WIDTH CHOICE_POPUP_HEIGHT( itemCount ) CHOICE_HORIZONTAL_ALIGN CHOICE_VERTICAL_ALIGN \
|
|
backcolor CHOICE_POPUP_BACKCOLOR \
|
|
border 1 \
|
|
bordersize CHOICE_POPUP_BORDER_WIDTH \
|
|
bordercolor CHOICE_POPUP_BORDER_COLOR \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
onOpenArg; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
play "mouse_click"; \
|
|
close self; \
|
|
onEscArg; \
|
|
}
|
|
|
|
#define CHOICE_POPMENU_TITLE( textArg ) \
|
|
CHOICE_POPMENU_TITLE_VIS( textArg, 1 )
|
|
|
|
#ifdef PC
|
|
#define CHOICE_POPMENU_TITLE_VIS( textArg, visArg ) \
|
|
itemDef \
|
|
{ \
|
|
type ITEM_TYPE_BUTTON \
|
|
rect 100 135 200 CHOICE_POPUP_TITLE_HEIGHT HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP \
|
|
exp text(textArg); \
|
|
textfont CHOICE_TEXTFONT \
|
|
textscale CHOICE_POPUP_TITLE_TEXTSIZE \
|
|
textAlign ITEM_ALIGN_MIDDLE_LEFT \
|
|
textstyle CHOICE_TEXTSTYLE \
|
|
forecolor CHOICE_TEXTCOLOR \
|
|
visible visArg \
|
|
decoration \
|
|
}
|
|
#else
|
|
#define CHOICE_POPMENU_TITLE_VIS( textArg, visArg ) \
|
|
itemDef \
|
|
{ \
|
|
type ITEM_TYPE_BUTTON \
|
|
rect 57 96 200 CHOICE_POPUP_TITLE_HEIGHT HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP \
|
|
exp text(textArg); \
|
|
textfont CHOICE_TEXTFONT \
|
|
textscale CHOICE_POPUP_TITLE_TEXTSIZE \
|
|
textAlign ITEM_ALIGN_MIDDLE_LEFT \
|
|
textstyle CHOICE_TEXTSTYLE \
|
|
forecolor CHOICE_TEXTCOLOR \
|
|
visible visArg \
|
|
decoration \
|
|
}
|
|
#endif // #ifdef PC
|
|
|
|
#define CHOICE_POPMENU_SUBTITLE( textArg ) \
|
|
CHOICE_POPMENU_SUBTITLE_VIS( textArg, 1 )
|
|
#define CHOICE_POPMENU_SUBTITLE_SS( textArg ) \
|
|
CHOICE_POPMENU_SUBTITLE_VIS_SS( textArg, 1 )
|
|
|
|
#define CHOICE_POPMENU_SUBTITLE_VIS( textArg, visArg ) \
|
|
CHOICE_POPMENU_SUBTITLE_ALIGN_VIS( textArg, ITEM_ALIGN_TOP_LEFT, visArg )
|
|
|
|
#ifdef PC
|
|
#define CHOICE_POPMENU_SUBTITLE_ALIGN_VIS( textArg, alignArg, visArg ) \
|
|
itemDef \
|
|
{ \
|
|
type ITEM_TYPE_BUTTON \
|
|
rect 100 169 400 CHOICE_POPUP_SUBTITLE_HEIGHT HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP \
|
|
exp text(textArg); \
|
|
textfont CHOICE_TEXTFONT \
|
|
textscale CHOICE_POPUP_SUBTITLE_TEXTSIZE \
|
|
textAlign alignArg \
|
|
textstyle CHOICE_TEXTSTYLE \
|
|
forecolor CHOICE_TEXTCOLOR \
|
|
visible visArg \
|
|
decoration \
|
|
autowrapped \
|
|
}
|
|
#else
|
|
#define CHOICE_POPMENU_SUBTITLE_ALIGN_VIS( textArg, alignArg, visArg ) \
|
|
itemDef \
|
|
{ \
|
|
type ITEM_TYPE_BUTTON \
|
|
rect 57 130 400 CHOICE_POPUP_SUBTITLE_HEIGHT HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP \
|
|
exp text(textArg); \
|
|
textfont CHOICE_TEXTFONT \
|
|
textscale CHOICE_POPUP_SUBTITLE_TEXTSIZE \
|
|
textAlign alignArg \
|
|
textstyle CHOICE_TEXTSTYLE \
|
|
forecolor CHOICE_TEXTCOLOR \
|
|
visible visArg \
|
|
decoration \
|
|
autowrapped \
|
|
}
|
|
#define CHOICE_POPMENU_SUBTITLE_VIS_SS( textArg, visArg ) \
|
|
itemDef \
|
|
{ \
|
|
type ITEM_TYPE_BUTTON \
|
|
rect -105 -72 400 CHOICE_POPUP_SUBTITLE_HEIGHT CHOICE_HORIZONTAL_ALIGN CHOICE_VERTICAL_ALIGN \
|
|
exp text(textArg); \
|
|
textfont CHOICE_TEXTFONT \
|
|
textscale TEXTSIZE_SMALL \
|
|
textAlign ITEM_ALIGN_TOP_LEFT \
|
|
textstyle CHOICE_TEXTSTYLE \
|
|
forecolor CHOICE_TEXTCOLOR \
|
|
visible visArg \
|
|
decoration \
|
|
autowrapped \
|
|
}
|
|
#endif // #ifdef PC
|
|
|
|
#ifdef PC
|
|
#define PREPROC_CANCEL_OVERLAY(shadow_visArg,itemCount) \
|
|
itemDef { \
|
|
type ITEM_TYPE_BUTTON \
|
|
rect -600 -800 2000 2000 0 0 \
|
|
text "" \
|
|
textfont UI_FONT_NORMAL \
|
|
visible 1 \
|
|
onfocus{ setdvar ui_popup_close_icon "1" } \
|
|
leavefocus{ setdvar ui_popup_close_icon "0" } \
|
|
action{ close self; } \
|
|
}\
|
|
itemDef { \
|
|
type ITEM_TYPE_BUTTON \
|
|
rect 0 130 640 200 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
text "" \
|
|
textfont UI_FONT_NORMAL \
|
|
visible 1 \
|
|
action{ ; } \
|
|
}\
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect -4 -8 648 488 0 0 \
|
|
forecolor 0 0 0 1 \
|
|
background "menu_popup_back" \
|
|
visible when( shadow_visArg ); \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect -4 -4 648 488 0 0 \
|
|
background "menu_white_line" \
|
|
forecolor 0 0 0 0.3 \
|
|
visible when( shadow_visArg ); \
|
|
decoration \
|
|
}
|
|
|
|
#else
|
|
#define PREPROC_CANCEL_OVERLAY(shadow_visArg,itemCount) \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
forecolor 0 0 0 1 \
|
|
background "menu_popup_back" \
|
|
visible when( shadow_visArg ); \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line" \
|
|
forecolor 0 0 0 0.3 \
|
|
visible when( shadow_visArg ); \
|
|
decoration \
|
|
}
|
|
#endif
|
|
|
|
#define IMPROVED_POPUP_SETUP( nameArg, itemCount, xArg, yArg, onEscArg, shadow_visArg ) \
|
|
IMPROVED_POPUP_SETUP_ONOPEN( nameArg, itemCount, xArg, yArg, onEscArg, focusfirst, shadow_visArg )
|
|
|
|
#define IMPROVED_POPUP_SETUP_ONOPEN( nameArg, itemCount, xArg, yArg, onEscArg, onOpenArg, shadow_visArg ) \
|
|
IMPROVED_POPUP_SETUP_RAW( nameArg, itemCount, xArg, yArg, onEscArg, onOpenArg, ;, shadow_visArg )
|
|
|
|
#define IMPROVED_POPUP_SETUP_RAW( nameArg, itemCount, xArg, yArg, onEscArg, onOpenArg, extraArgs, shadow_visArg ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
fullscreen 0 \
|
|
rect (xArg+0) (yArg+56) CHOICE_POPUP_WIDTH CHOICE_POPUP_HEIGHT( itemCount ) CHOICE_HORIZONTAL_ALIGN CHOICE_VERTICAL_ALIGN \
|
|
/*rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN*/ \
|
|
border 1 \
|
|
bordersize CHOICE_POPUP_BORDER_WIDTH \
|
|
bordercolor 0 0 0 0 \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
onOpenArg; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
play "mouse_click"; \
|
|
close self; \
|
|
onEscArg; \
|
|
}\
|
|
PREPROC_CANCEL_OVERLAY( shadow_visArg, itemCount ) \
|
|
PREPROC_SHADER_DRAW( -4 -4 CHOICE_POPUP_WIDTH CHOICE_POPUP_HEIGHT( itemCount ), 0 0, "white", CHOICE_POPUP_BACKCOLOR, 1, CHOICE_POPUP_BORDER_WIDTH, CHOICE_POPUP_BORDER_COLOR )
|
|
|
|
//PREPROC_TEXT_DRAW( 0 0 10 10, 0 0, text "x", TEXTSIZE_SMALL, 0, 0, ITEM_ALIGN_MIDDLE_LEFT, CHOICE_POPUP_BORDER_COLOR visible when( dvarInt(ui_popup_close_icon) ); )
|
|
|
|
//PREPROC_SHADER_DRAW( -4 -4 CHOICE_POPUP_WIDTH CHOICE_POPUP_HEIGHT( itemCount ), 0 0, "white", 0 0 0 0, 1, CHOICE_POPUP_BORDER_WIDTH, 0 0 0 0.8 visible when( dvarInt(ui_popup_close_icon) ); )
|
|
|
|
#define MINI_FLYOUT_POPUP( nameArg, itemCount, xArg, yArg, onEscArg, onOpenArg, shadow_visArg, extraArgs ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
fullscreen 0 \
|
|
rect (xArg+0) (yArg+56) CHOICE_POPUP_WIDTH CHOICE_POPUP_HEIGHT( itemCount ) CHOICE_HORIZONTAL_ALIGN CHOICE_VERTICAL_ALIGN \
|
|
border 1 \
|
|
bordersize CHOICE_POPUP_BORDER_WIDTH \
|
|
bordercolor 0 0 0 0 \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
onOpenArg; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
play "mouse_click"; \
|
|
close self; \
|
|
onEscArg; \
|
|
}
|
|
|
|
#define CENTER_POPUP_SETUP( nameArg, itemCount, onEscArg, shadow_visArg ) \
|
|
CENTER_POPUP_SETUP_ONOPEN( nameArg, itemCount, onEscArg, focusfirst, shadow_visArg )
|
|
|
|
#define CENTER_POPUP_SETUP_ONOPEN( nameArg, itemCount, onEscArg, onOpenArg, shadow_visArg ) \
|
|
CENTER_POPUP_SETUP_RAW( nameArg, itemCount, onEscArg, onOpenArg, ;, shadow_visArg )
|
|
|
|
#define CENTER_POPUP_SETUP_ONOPEN_SS( nameArg, itemCount, onEscArg, onOpenArg, shadow_visArg ) \
|
|
CENTER_POPUP_SETUP_RAW_SS( nameArg, itemCount, onEscArg, onOpenArg, ;, shadow_visArg )
|
|
|
|
#define POPUP_TEXTURE_BACKGROUND \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect -107 130 854 200 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line" \
|
|
forecolor 0 0 0 1 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 130 640 200 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_button_backing" \
|
|
forecolor 0.074 0.082 0.086 1 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect -4 330 644 20 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "gradient_top" \
|
|
forecolor 0 0 0 .8 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect -4 110 644 20 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "gradient_bottom" \
|
|
forecolor 0 0 0 .8 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
/* title bar */ \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 130 640 1 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line_faded" \
|
|
forecolor 1 1 1 0.05 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 131 640 30 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "white_line_faded_center" \
|
|
forecolor 0.094 0.110 0.114 1 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 160 640 1 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line_faded" \
|
|
forecolor 1 1 1 0.15 \
|
|
visible 1 \
|
|
decoration \
|
|
}
|
|
|
|
#ifndef NO_BG_CLOSE
|
|
#define CENTER_POPUP_SETUP_RAW( nameArg, itemCount, onEscArg, onOpenArg, extraArgs, shadow_visArg ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
fullscreen 0 \
|
|
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
backcolor 0 0 0 0 \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 1; \
|
|
onOpenArg; \
|
|
} \
|
|
onClose \
|
|
{ \
|
|
CENTER_POPUP_ON_CLOSE \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
close self; \
|
|
onEscArg; \
|
|
} \
|
|
PREPROC_CANCEL_OVERLAY( shadow_visArg, itemCount ) \
|
|
POPUP_TEXTURE_BACKGROUND
|
|
|
|
#define CENTER_POPUP_SETUP_RAW_SS( nameArg, itemCount, onEscArg, onOpenArg, extraArgs, shadow_visArg ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
fullscreen 0 \
|
|
rect 0 0 320 240 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
backcolor 0 0 0 0 \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 1; \
|
|
onOpenArg; \
|
|
} \
|
|
onClose \
|
|
{ \
|
|
CENTER_POPUP_ON_CLOSE \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
close self; \
|
|
onEscArg; \
|
|
} \
|
|
PREPROC_CANCEL_OVERLAY( shadow_visArg, itemCount ) \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect -107 30 427 125 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line" \
|
|
forecolor 0 0 0 1 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 30 640 125 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line_faded" \
|
|
forecolor 0.075 0.082 0.086 1 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
/* title bar */ \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 15 40 322 1 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_button_backing" \
|
|
forecolor 1 1 1 0.3 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 41 322 30 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line_faded" \
|
|
forecolor 0.082 0.109 0.114 1 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 15 70 322 1 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_button_backing" \
|
|
forecolor 1 1 1 0.3 \
|
|
visible 1 \
|
|
decoration \
|
|
}
|
|
#else
|
|
#define CENTER_POPUP_SETUP_RAW( nameArg, itemCount, onEscArg, onOpenArg, extraArgs, shadow_visArg ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
fullscreen 0 \
|
|
rect (0-(CHOICE_POPUP_WIDTH/2)) (0-(CHOICE_POPUP_HEIGHT( itemCount )/2)) CHOICE_POPUP_WIDTH CHOICE_POPUP_HEIGHT( itemCount ) HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
border 1 \
|
|
backcolor 0 0 0 0 \
|
|
bordersize CHOICE_POPUP_BORDER_WIDTH \
|
|
bordercolor CHOICE_POPUP_BORDER_COLOR \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 1; \
|
|
onOpenArg; \
|
|
} \
|
|
onClose \
|
|
{ \
|
|
CENTER_POPUP_ON_CLOSE \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
close self; \
|
|
onEscArg; \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 0 (CHOICE_POPUP_WIDTH-(CHOICE_POPUP_BORDER_WIDTH*2)) (CHOICE_POPUP_HEIGHT( itemCount )-(CHOICE_POPUP_BORDER_WIDTH*2)) HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
background "white" \
|
|
forecolor CHOICE_POPUP_BACKCOLOR \
|
|
visible 1 \
|
|
decoration \
|
|
}
|
|
#define CENTER_POPUP_SETUP_RAW_SS( nameArg, itemCount, onEscArg, onOpenArg, extraArgs, shadow_visArg ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
fullscreen 0 \
|
|
rect (0-(CHOICE_POPUP_WIDTH/2)) (0-(CHOICE_POPUP_HEIGHT( itemCount )/2)) CHOICE_POPUP_WIDTH CHOICE_POPUP_HEIGHT( itemCount ) HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
border 1 \
|
|
backcolor 0 0 0 0 \
|
|
bordersize CHOICE_POPUP_BORDER_WIDTH \
|
|
bordercolor CHOICE_POPUP_BORDER_COLOR \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 1; \
|
|
onOpenArg; \
|
|
} \
|
|
onClose \
|
|
{ \
|
|
CENTER_POPUP_ON_CLOSE \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
close self; \
|
|
onEscArg; \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 0 (CHOICE_POPUP_WIDTH-(CHOICE_POPUP_BORDER_WIDTH*2)) (CHOICE_POPUP_HEIGHT( itemCount )-(CHOICE_POPUP_BORDER_WIDTH*2)) HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
background "white" \
|
|
forecolor CHOICE_POPUP_BACKCOLOR \
|
|
visible 1 \
|
|
decoration \
|
|
}
|
|
#endif
|
|
|
|
#define CENTER_POPUP_SETUP_OVERLAY_NOBG( nameArg, itemCount, onEscArg, onOpenArg, extraArgs, shadow_visArg ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
fullscreen 0 \
|
|
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
backcolor 0 0 0 0 \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 1; \
|
|
onOpenArg; \
|
|
} \
|
|
onClose \
|
|
{ \
|
|
CENTER_POPUP_ON_CLOSE \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
close self; \
|
|
onEscArg; \
|
|
} \
|
|
PREPROC_CANCEL_OVERLAY( shadow_visArg, itemCount )
|
|
|
|
#define CENTER_POPUP_SETUP_HEIGHT( nameArg, itemCount, onEscArg, shadow_visArg, heightArg ) \
|
|
CENTER_POPUP_SETUP_HEIGHT_RAW( nameArg, itemCount, onEscArg, focusfirst, ;, shadow_visArg, heightArg )
|
|
|
|
#define CENTER_POPUP_SETUP_HEIGHT_RAW( nameArg, itemCount, onEscArg, onOpenArg, extraArgs, shadow_visArg, heightArg ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
fullscreen 0 \
|
|
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
backcolor 0 0 0 0 \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 1; \
|
|
onOpenArg; \
|
|
} \
|
|
onClose \
|
|
{ \
|
|
CENTER_POPUP_ON_CLOSE \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
close self; \
|
|
onEscArg; \
|
|
} \
|
|
PREPROC_CANCEL_OVERLAY( shadow_visArg, itemCount ) \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect -107 130 854 (200+heightArg) HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line" \
|
|
forecolor 0 0 0 1 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 130 640 (200+heightArg) HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line_faded" \
|
|
forecolor 0.075 0.082 0.086 1 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect -4 (330+heightArg) 644 20 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "gradient_top" \
|
|
forecolor 0 0 0 .8 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect -4 110 644 20 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "gradient_bottom" \
|
|
forecolor 0 0 0 .8 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
/* title bar */ \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 130 640 1 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_button_backing" \
|
|
forecolor 1 1 1 0.05 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 131 640 30 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line_faded" \
|
|
forecolor 0.094 0.110 0.114 1 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 160 640 1 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_button_backing" \
|
|
forecolor 1 1 1 0.15 \
|
|
visible 1 \
|
|
decoration \
|
|
}
|
|
|
|
#ifdef PUBLIC_BETA
|
|
#define CENTER_POPUP_SETUP_BETA( nameArg, itemCount, onEscArg, onOpenArg, extraArgs, shadow_visArg ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
fullscreen 0 \
|
|
rect (0-(CHOICE_POPUP_WIDTH/2)) (0-(CHOICE_POPUP_HEIGHT( itemCount )/2)) CHOICE_POPUP_WIDTH CHOICE_POPUP_HEIGHT( itemCount ) HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
border 0 \
|
|
backcolor 0 0 0 0 \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 1; \
|
|
onOpenArg; \
|
|
} \
|
|
onClose \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
play "mouse_click"; \
|
|
close self; \
|
|
onEscArg; \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 0 (CHOICE_POPUP_WIDTH-(CHOICE_POPUP_BORDER_WIDTH*2)) (CHOICE_POPUP_HEIGHT( itemCount )-(CHOICE_POPUP_BORDER_WIDTH*2)) HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
background "white" \
|
|
forecolor CHOICE_POPUP_BACKCOLOR \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 (CHOICE_POPUP_TITLE_HEIGHT/4) CHOICE_POPUP_WIDTH (CHOICE_POPUP_HEIGHT( itemCount )-(CHOICE_POPUP_TITLE_HEIGHT/4)) HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
background "white" \
|
|
forecolor CHOICE_POPUP_BACKCOLOR \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 0 (CHOICE_POPUP_WIDTH-(CHOICE_POPUP_TITLE_HEIGHT/4)) CHOICE_POPUP_TITLE_HEIGHT HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
forecolor 0.1 0.1 0.1 1 \
|
|
exp material( "white" ); \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 0 0 (CHOICE_POPUP_WIDTH-(CHOICE_POPUP_TITLE_HEIGHT/4)) CHOICE_POPUP_TITLE_HEIGHT HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
forecolor 0.9 0.95 1 0.4 \
|
|
exp material( "gradient_fadein" ); \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect ((CHOICE_POPUP_WIDTH-0)-(CHOICE_POPUP_TITLE_HEIGHT/4)) 0 (CHOICE_POPUP_TITLE_HEIGHT/4) (CHOICE_POPUP_TITLE_HEIGHT) HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
forecolor 0.1 0.1 0.1 1 \
|
|
exp material( "button_highlight_end" ); \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect ((CHOICE_POPUP_WIDTH-0)-(CHOICE_POPUP_TITLE_HEIGHT/4)) 0 (CHOICE_POPUP_TITLE_HEIGHT/4) (CHOICE_POPUP_TITLE_HEIGHT) HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \
|
|
forecolor 0.9 0.95 1 0.4 \
|
|
exp material( "button_highlight_end" ); \
|
|
visible 1 \
|
|
decoration \
|
|
}
|
|
#endif
|
|
|
|
|
|
#define READDEVICE_CHOICE_POPUP_WIDTH 320
|
|
#define READDEVICE_POPUP( nameArg, itemCount, onEscArg, onOpenArg, extraArgs, shadow_visArg ) \
|
|
name nameArg \
|
|
visible 1 \
|
|
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
backcolor 0 0 0 0 \
|
|
focusColor COLOR_FOCUSED \
|
|
style WINDOW_STYLE_FILLED \
|
|
popup \
|
|
extraArgs \
|
|
onOpen \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 1; \
|
|
onOpenArg; \
|
|
} \
|
|
onClose \
|
|
{ \
|
|
CENTER_POPUP_ON_CLOSE \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
} \
|
|
onESC \
|
|
{ \
|
|
setLocalVarBool ui_centerPopup 0; \
|
|
close self; \
|
|
onEscArg; \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect -107 387 854 25 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_white_line" \
|
|
forecolor 0 0 0 1 \
|
|
visible 1 \
|
|
decoration \
|
|
} \
|
|
itemDef \
|
|
{ \
|
|
name popmenu_bar_color \
|
|
style WINDOW_STYLE_SHADER \
|
|
rect 60 387 640 25 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
|
|
background "menu_button_backing" \
|
|
forecolor 0.075 0.082 0.086 1 \
|
|
visible 1 \
|
|
decoration \
|
|
}
|
|
}
|
|
|
|
#define READDEVICE_CHOICE_POPMENU_SUBTITLE_VIS( textArg, visArg ) \
|
|
itemDef \
|
|
{ \
|
|
type ITEM_TYPE_BUTTON \
|
|
rect -256 -45 0 0 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_BOTTOM \
|
|
exp text(textArg); \
|
|
textfont CHOICE_TEXTFONT \
|
|
textscale CHOICE_TEXTSIZE \
|
|
textAlign ITEM_ALIGN_MIDDLE_LEFT \
|
|
textstyle CHOICE_TEXTSTYLE \
|
|
forecolor CHOICE_TEXTCOLOR \
|
|
visible visArg \
|
|
decoration \
|
|
}
|
|
|