01-27-2012, 16:02
Basically, I have a shoutcast overlay i want to reduce in size pending on what the DVAR ui_shoutcast_ax20 is set to... so it looks like this..
ITEM DEF
#define Shoutcast_text(dvar, height, dvarint) \
itemDef \
{ \
name "shoutcast_text" \
type ITEM_TYPE_TEXT \
rect SHOUTCAST_X height dvarint 19 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP \
exp text( dvarstring( dvar ) ); \
textfont UI_FONT_DEFAULT \
textscale 0.25 \
textalign ITEM_ALIGN_MIDDLE_LEFT \
textstyle ITEM_TEXTSTYLE_SHADOWED \
style WINDOW_STYLE_FILLED \
visible when( dvarInt( "shoutlol" ) == 1 && dvarString(dvar) != "" ) \
forecolor 1 1 1 1 \
backcolor 0 0.2412 0 0.4975 \
border 1 \
bordersize 1 \
bordercolor CHOICE_BUTTON_BORDER_COLOR_UNSELECTED_RGBA \
}
ACTUAL ITEM
#undef SHOUTCAST_X
#define SHOUTCAST_X 10
Shoutcast_text("ui_shoutcast_ax0", 140, "ui_shoutcast_ax20")
It comes up with the following error though..
Menu load error: ui_mp/hud_spectator.menu, line 218: expected float but found ui_shoutcast_ax20
Menu load error: ui_mp/hud_spectator.menu, line 218: couldn't parse menu item keyword rect
Menu load error: ui_mp/hud_spectator.menu, line 218: couldn't parse menu keyword itemDef
If i change the dvar just to a number, it works, just wondering if there is a way around this at all?
ITEM DEF
#define Shoutcast_text(dvar, height, dvarint) \
itemDef \
{ \
name "shoutcast_text" \
type ITEM_TYPE_TEXT \
rect SHOUTCAST_X height dvarint 19 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP \
exp text( dvarstring( dvar ) ); \
textfont UI_FONT_DEFAULT \
textscale 0.25 \
textalign ITEM_ALIGN_MIDDLE_LEFT \
textstyle ITEM_TEXTSTYLE_SHADOWED \
style WINDOW_STYLE_FILLED \
visible when( dvarInt( "shoutlol" ) == 1 && dvarString(dvar) != "" ) \
forecolor 1 1 1 1 \
backcolor 0 0.2412 0 0.4975 \
border 1 \
bordersize 1 \
bordercolor CHOICE_BUTTON_BORDER_COLOR_UNSELECTED_RGBA \
}
ACTUAL ITEM
#undef SHOUTCAST_X
#define SHOUTCAST_X 10
Shoutcast_text("ui_shoutcast_ax0", 140, "ui_shoutcast_ax20")
It comes up with the following error though..
Menu load error: ui_mp/hud_spectator.menu, line 218: expected float but found ui_shoutcast_ax20
Menu load error: ui_mp/hud_spectator.menu, line 218: couldn't parse menu item keyword rect
Menu load error: ui_mp/hud_spectator.menu, line 218: couldn't parse menu keyword itemDef
If i change the dvar just to a number, it works, just wondering if there is a way around this at all?