hide-and-seek/ui_mp/scriptmenus/hns_models.menu

283 lines
6.1 KiB
Plaintext

/*
maxEntriesPerColumn = 16;
columnWidth = 160;
rowHeight = 18;
columns = int(level.ModelList.size / maxEntriesPerColumn);
startX = -35 - (columns * columnWidth/2);
startY = 86;
for (i = 0; i < level.ModelList.size; i++)
{
column = int(i / maxEntriesPerColumn);
row = i % maxEntriesPerColumn;
x = startX + (column * columnWidth);
y = startY + row * rowHeight;
btn = self createButton();
btn setPoint("TOPCENTER", "TOPCENTER", x, y);
//btn setParent(self.modelMenu);
btn setText(level.ModelList[i].RName);
btns[btns.size] = btn;
}
*/
#define MAX_ENTRIES_PER_ROW 3
#define COLUMN_WIDTH 192
#define BUTTON_WIDTH ( COLUMN_WIDTH - 4 )
#define ROW_HEIGHT 24
#define BUTTON_HEIGHT ( ROW_HEIGHT - 2 )
#define COLUMNS 3
#define START_X ( 0 - ( COLUMNS * COLUMN_WIDTH / 2 ) )
#define START_Y 32
#define ROW(i) ( int( i / COLUMNS ) )
#define COLUMN(i) ( i - ( ROW(i) * COLUMNS ) )
#define BUTTON_X(i) ( START_X + ( COLUMN(i) * COLUMN_WIDTH ))
#define BUTTON_Y(i) ( START_Y + ( ROW(i) * ROW_HEIGHT ))
#define MENU_MODEL_BUTTON(i) \
itemDef \
{ \
name "model" #i \
rect 0 0 BUTTON_WIDTH BUTTON_HEIGHT 2 1 \
exp rect X( BUTTON_X(i) ) \
exp rect Y( BUTTON_Y(i) ) \
foreColor 1 1 1 1 \
backColor 0 0 0 0 \
background "menu_setting_selection_bar" \
style 1 \
origin 0 0 \
group mw2_button \
type 1 \
textAlign 4 \
textAlignX 3 \
textScale 0.375 \
textFont 3 \
exp text( dvarstring( "ui_hns_model_" #i ) ) \
onFocus \
{ \
play mouse_over; \
setItemColor self backcolor 0 0 0 1; \
setLocalVarString "ui_hint_text" ( "Turns you into this model." ); \
setLocalVarBool ui_menuAButton 1; \
} \
leaveFocus \
{ \
setItemColor self backcolor 0 0 0 0; \
setLocalVarString "ui_hint_text" ( "@NULL_EMPTY" ); \
setLocalVarBool ui_menuAButton 0; \
} \
action \
{ \
play mouse_click; \
scriptMenuResponse "chmodel," #i ; \
escape self; \
} \
visible when !(dvarstring( "ui_hns_model_" #i ) == "") \
} \
{
menuDef
{
name "hns_models"
rect 0 0 640 480 0 0
forecolor 1 1 1 1
focuscolor 1 1 1 1
blurWorld 7
onOpen
{
focusfirst;
}
onEsc
{
scriptmenuresponse "back";
}
itemDef
{
rect 0 0 640 480 4 4
decoration
visible 1
style 3
forecolor 0 0 0 0.4
background "white"
textscale 0.55
}
itemDef
{
rect 0 0 640 480 4 4
decoration
visible 1
style 3
forecolor 1 1 1 0
background "mockup_bg_glow"
textscale 0.55
exp forecolor a ( ( ( sin( milliseconds( ) / 1500 ) + 1 ) * 0.25 ) + 0.25 )
}
itemDef
{
rect 0 0 640 480 4 4
decoration
visible 1
style 3
forecolor 1 1 1 0
background "mockup_bg_glow"
textscale 0.55
exp forecolor a ( ( ( sin( milliseconds( ) / 480 ) + 1 ) * 0.25 ) + 0.25 )
}
/*itemDef
{
rect 0 0 320 28 1 1
decoration
visible 1
forecolor 1 1 1 1
textfont 9
textalign 6
textalignx -60
textscale 0.5
text "MODELS"
}*/
MENU_MODEL_BUTTON(0)
MENU_MODEL_BUTTON(1)
MENU_MODEL_BUTTON(2)
MENU_MODEL_BUTTON(3)
MENU_MODEL_BUTTON(4)
MENU_MODEL_BUTTON(5)
MENU_MODEL_BUTTON(6)
MENU_MODEL_BUTTON(7)
MENU_MODEL_BUTTON(8)
MENU_MODEL_BUTTON(9)
MENU_MODEL_BUTTON(10)
MENU_MODEL_BUTTON(11)
MENU_MODEL_BUTTON(12)
MENU_MODEL_BUTTON(13)
MENU_MODEL_BUTTON(14)
MENU_MODEL_BUTTON(15)
MENU_MODEL_BUTTON(16)
MENU_MODEL_BUTTON(17)
MENU_MODEL_BUTTON(18)
MENU_MODEL_BUTTON(19)
MENU_MODEL_BUTTON(20)
MENU_MODEL_BUTTON(21)
MENU_MODEL_BUTTON(22)
MENU_MODEL_BUTTON(23)
MENU_MODEL_BUTTON(24)
MENU_MODEL_BUTTON(25)
MENU_MODEL_BUTTON(26)
MENU_MODEL_BUTTON(27)
MENU_MODEL_BUTTON(28)
MENU_MODEL_BUTTON(29)
MENU_MODEL_BUTTON(30)
MENU_MODEL_BUTTON(31)
MENU_MODEL_BUTTON(32)
MENU_MODEL_BUTTON(33)
MENU_MODEL_BUTTON(34)
MENU_MODEL_BUTTON(35)
MENU_MODEL_BUTTON(36)
MENU_MODEL_BUTTON(37)
MENU_MODEL_BUTTON(38)
MENU_MODEL_BUTTON(39)
MENU_MODEL_BUTTON(40)
MENU_MODEL_BUTTON(41)
MENU_MODEL_BUTTON(42)
MENU_MODEL_BUTTON(43)
MENU_MODEL_BUTTON(44)
MENU_MODEL_BUTTON(45)
MENU_MODEL_BUTTON(46)
MENU_MODEL_BUTTON(47)
MENU_MODEL_BUTTON(48)
MENU_MODEL_BUTTON(49)
MENU_MODEL_BUTTON(50)
MENU_MODEL_BUTTON(51)
MENU_MODEL_BUTTON(52)
MENU_MODEL_BUTTON(53)
MENU_MODEL_BUTTON(54)
MENU_MODEL_BUTTON(55)
MENU_MODEL_BUTTON(56)
MENU_MODEL_BUTTON(57)
MENU_MODEL_BUTTON(58)
MENU_MODEL_BUTTON(59)
MENU_MODEL_BUTTON(60)
MENU_MODEL_BUTTON(61)
MENU_MODEL_BUTTON(62)
MENU_MODEL_BUTTON(63)
itemDef
{
rect -64 -40 336 20 1 3
visible 1
group "mw2_button"
style 1
forecolor 1 1 1 1
disablecolor 0.6 0.55 0.55 1
background "menu_button_selection_bar"
type 1
textfont 3
textalign 6
textalignx -60
textscale 0.375
text "RANDOM"
action
{
play "mouse_click";
scriptMenuResponse "randmodel";
escape self;
}
onFocus
{
play "mouse_over";
if ( dvarstring( "gameMode" ) != "mp" )
{
setItemColor "mw2_button" backcolor 0 0 0 0;
}
setItemColor self backcolor 0 0 0 1;
setLocalVarString "ui_hint_text" ( "Turns you into a randomly chosen model from this list." );
setLocalVarBool "ui_menuAButton" ( 1 );
}
leaveFocus
{
setItemColor self backcolor 0 0 0 "0.0";
setLocalVarString "ui_hint_text" ( "@NULL_EMPTY" );
setLocalVarBool "ui_menuAButton" ( 0 );
}
}
itemDef
{
rect -64 -20 336 20 1 3
visible 1
group "mw2_button"
style 1
forecolor 1 1 1 1
disablecolor 0.6 0.55 0.55 1
background "menu_button_selection_bar"
type 1
textfont 3
textalign 6
textalignx -60
textscale 0.375
text "@PLATFORM_BACK_CAPS"
action
{
play "mouse_click";
play "mouse_click";
"escape" self;
}
onFocus
{
play "mouse_over";
if ( dvarstring( "gameMode" ) != "mp" )
{
setItemColor "mw2_button" backcolor 0 0 0 0;
}
setItemColor self backcolor 0 0 0 1;
setLocalVarBool "ui_menuAButton" ( 1 );
}
leaveFocus
{
setItemColor self backcolor 0 0 0 "0.0";
setLocalVarString "ui_hint_text" ( "@NULL_EMPTY" );
setLocalVarBool "ui_menuAButton" ( 0 );
}
}
}
}