diff --git a/Source/Menu/MenuConfiguration.c b/Source/Menu/MenuConfiguration.c index 9f0a8e18..f4f67d55 100755 --- a/Source/Menu/MenuConfiguration.c +++ b/Source/Menu/MenuConfiguration.c @@ -166,6 +166,10 @@ void Menu_Configuration_Video( void ) { Menu_ResetClipArea(); + Object_CvarToggle( '400 165', "Fullscreen", "vid_fullscreen_standalone" ); + Object_CvarToggle( '400 185', "Triple Buffering", "vid_triplebuffer" ); + Object_CvarToggle( '400 205', "Virtual Synchronisation", "vid_vsync" ); + Object_Button( '32 148', BTN_OK, Video_Apply, fButtonAlpha[0] ); Object_Button( '32 180', BTN_CANCEL, Menu_Configuration_ButtonCancel, fButtonAlpha[1] ); } diff --git a/Source/Menu/Objects.c b/Source/Menu/Objects.c index 3c0c96c7..ca62f693 100644 --- a/Source/Menu/Objects.c +++ b/Source/Menu/Objects.c @@ -213,6 +213,15 @@ void Object_Scrollbar( vector vPosition, int iHeight, __inout int iProgress ) { drawfill( [vPosition_x, vPosition_y + iProgress], [ 16, 16 ], autocvar_menu_fgcolor, 1.0f ); } +/* +================= +Object_ScrollbarH + +A scrollbar, for different types of purposes. +This is the horizontal version. +Note: Only have one at a time. +================= +*/ void Object_ScrollbarH( vector vPosition, int iWidth, __inout int iProgress ) { Object_Frame( vPosition, [ iWidth + 16, 16 ] ); @@ -239,5 +248,40 @@ void Object_ScrollbarH( vector vPosition, int iWidth, __inout int iProgress ) { iProgress = iWidth; } - drawfill( [vPosition_x + iProgress, vPosition_y ], [ 16, 16 ], autocvar_menu_fgcolor, 1.0f ); + drawfill( [ vPosition_x + iProgress, vPosition_y ], [ 16, 16 ], autocvar_menu_fgcolor, 1.0f ); +} + +/* +================= +Object_CvarToggle + +A nice way of toggling cvars. +================= +*/ +void Object_CvarToggle( vector vPosition, string sLabel, string sCvar ) { + float fAlpha = 0.8f; + int iWidth = stringwidth( sLabel, FALSE ); + vPosition += vMenuOffset; + + if ( Menu_InputCheckMouse( vPosition, [ iWidth, 8 ] ) == TRUE ) { + fAlpha = 1.0f; + if ( fMouseClick == TRUE ) { + if ( cvar( sCvar ) == 0 ) { + cvar_set( sCvar, "1" ); + } else { + cvar_set( sCvar, "0" ); + } + fMouseClick = FALSE; + } + } + + drawfill( vPosition + '-2 -2', [ iWidth + 36, 12 ], '0 0 0', 0.8f ); + + if ( cvar( sCvar ) == 0 ) { + drawstring( vPosition, sprintf( "[ ] %s", sLabel ), '8 8', autocvar_menu_fgcolor, fAlpha, 0 ); + } else { + drawstring( vPosition, sprintf( "[X] %s", sLabel ), '8 8', autocvar_menu_fgcolor, fAlpha, 0 ); + } + + } \ No newline at end of file diff --git a/freecs/menu.dat b/freecs/menu.dat index 62f8ee10..f37ce47a 100755 Binary files a/freecs/menu.dat and b/freecs/menu.dat differ