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

128 lines
3.4 KiB
Text

#include "ui/menudef.h"
#include "ui_mp/common_macro.inc"
#define CHOICE_X_START 0
#define CHOICE_Y_START 270
#define CHOICE_GROUP "cdkey"
#include "ui_mp/menustyle.inc"
#include "ui/choices_setup_common.menu"
#include "ui_mp/popupstyle.inc"
#include "ui/choices_setup_popmenu.menu"
#undef CHOICE_SIZE_X
#define CHOICE_SIZE_X 400
#undef CHOICE_POPUP_TITLE_HEIGHT
#define CHOICE_POPUP_TITLE_HEIGHT 26
#define SIDE_MARGIN 100
{
menuDef
{
CENTER_POPUP_SETUP_ONOPEN( cdkey_menu, 5, ;, setlocalvarint ui_show_cancel 1;, 1 )
onOpen{
setFocus dataField;
setDvar ui_ignoreMousePos "1";
}
onClose{
setDvar ui_ignoreMousePos "0";
setDvar ui_prevTextEntryBox "-1";
}
CHOICE_POPMENU_TITLE( "@MENU_KEY_CODE" )
CHOICE_POPMENU_SUBTITLE_VIS( dvarString(ui_cdkeyvalid), when( localvarint( ui_show_cancel ) == 0 ); )
CHOICE_POPMENU_SUBTITLE_VIS( "@MENU_ENTER_YOUR_KEY_CODE_IN_THE_FIELD_BELOW", when( localvarint( ui_show_cancel ) == 1 ); )
#define LOCAL_KEY_SEG( prect, pdvar, ex ) \
itemDef {\
name datafield \
group grpcdkey \
type ITEM_TYPE_UPREDITFIELD \
style 1 \
text "" \
dvar pdvar \
maxchars 4 \
maxCharsGotoNext \
rect prect 0 0 \
textalign ITEM_ALIGN_CENTER \
textalignx -28 \
textaligny 14 \
textfont UI_FONT_NORMAL \
textscale .3 \
border 1 \
bordercolor .5 .5 .5 1 \
backcolor .1 0.1 0.1 .25 \
forecolor 1 1 1 1 \
visible 1 \
ex \
}
#define LOCAL_ACCEPT \
accept\
{\
uiScript verifyCDKey; setlocalvarint ui_show_cancel 0; \
}
//mouseenter { setcolor bordercolor 1 .75 0 1 }
//mouseexit { setcolor bordercolor .5 .5 .5 1 }
#define SEG_WIDTH 60
#define SEG_HEIGHT 20
#define SEG_SIZE SEG_WIDTH SEG_HEIGHT
#define SEG_X_SPACE 4
#define SEG_Y 200
#define SEG1_X SIDE_MARGIN
#define SEG2_X (SEG1_X+SEG_WIDTH+SEG_X_SPACE)
#define SEG3_X (SEG2_X+SEG_WIDTH+SEG_X_SPACE)
#define SEG4_X (SEG3_X+SEG_WIDTH+SEG_X_SPACE)
#define SEG5_X (SEG4_X+SEG_WIDTH+SEG_X_SPACE+12)
LOCAL_KEY_SEG( SEG1_X SEG_Y SEG_SIZE, "cdkey1", ; )
LOCAL_KEY_SEG( SEG2_X SEG_Y SEG_SIZE, "cdkey2", ; )
LOCAL_KEY_SEG( SEG3_X SEG_Y SEG_SIZE, "cdkey3", ; )
LOCAL_KEY_SEG( SEG4_X SEG_Y SEG_SIZE, "cdkey4", ; )
LOCAL_KEY_SEG( SEG5_X SEG_Y SEG_SIZE, "cdkey5", LOCAL_ACCEPT; ; )
itemDef
{
name datafield
group grpcdkey
style 0
text "-"
maxchars 2
rect (SEG5_X-12) SEG_Y SEG_SIZE
textalign ITEM_ALIGN_LEFT
textalignx 3
textaligny 18
textfont UI_FONT_NORMAL
textscale .3
backcolor 0 0 0 0
decoration
forecolor 1 1 1 1
visible 1
}
CHOICE_BUTTON( 3, "@MENU_VERIFY", play "mouse_click"; uiScript verifyCDKey; setlocalvarint ui_show_cancel 0; )
CHOICE_BUTTON_BG( 4, 1 )
CHOICE_HIGHLIGHT( 4, 1 )
CHOICE_BUTTON_VIS_NOHI( 4, "@MENU_CANCEL", close self;, when( localvarint( ui_show_cancel ) ); )
CHOICE_BUTTON_VIS_NOHI( 4, "@MENU_CLOSE1", close self;, when( localvarint( ui_show_cancel ) == 0 ); )
}
}
menuDef
{
CENTER_POPUP_SETUP_ONOPEN( cdkey_warning, 5, ;, setlocalvarint ui_show_cancel 1;, 1 )
CHOICE_POPMENU_TITLE( "@MENU_WARNING" )
CHOICE_POPMENU_SUBTITLE_VIS( "@MENU_KEY_CODE_WARNING", when( localvarint( ui_show_cancel ) == 1 ); )
CHOICE_BUTTON( 3, "@MENU_YES", play "mouse_click"; open cdkey_menu; close self; )
CHOICE_BUTTON( 4, "@MENU_NO", close self; )
}