cg_draw2d 0 in options.menu?


(trAnc3) #1

HI!:slight_smile:
Is it posible to turn off all hud while i am in options?

tried to put cvar cg_draw2d 0 in options.menu ,

// Options Menu //
	
menuDef {
	name		"options"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	style		WINDOW_STYLE_FILLED
	
        fadeClamp	   0.5
	fadeAmount  0.075

        onOpen {
		     setitemcolor background backcolor 0 0 0 0 ;
		     fadein background;
           	    [B] cg_draw2d 0[/B] ;    // NOT WORKING :( , some ideas?
                    }      

	onESC {
		    close options ; open main;
	}


But this not worked!I know there most be some code that will use cvar!Mby someone can help me?
p.s
sry for bad english :confused:


(Cambodunum) #2

uhm … what the heck are you tryin’?

deleting options for everyone? (there is a better way)
whats the point?

sorry for asking … im a lil bit confused … i dont see any reason

greetz Cambo(y)

(maybe i dont understand your request … use cg_drawhud instead of cg_draw2d)


(fumanchu) #3

try this :

setcvar cg_draw2d 0 ;

notice if u put this only in OnOpen when u close the
options menu cg_draw2d will be 0.

IF u want to restore the value to 1 when close the menu
u have to add

setcvar cg_draw2d 1 ;

in OnEsc and Back button.

Like:

#include "ui/menudef.h"

// Defines //

#define WINDOW_X		16
#define WINDOW_Y		16
#define WINDOW_WIDTH	128
#define WINDOW_HEIGHT	152
#define GROUP_NAME		"grpOptions"

// Macros //

#include "ui/menumacros.h"
		
// Options Menu //
	
menuDef {
	name		"options"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	style		WINDOW_STYLE_FILLED

        onOpen {
		setitemcolor background backcolor 0 0 0 0 ;
		fadein background;
           	setcvar cg_draw2d 0
        }    
	
	onESC {
		close options ;
                setcvar cg_draw2d 1 ;
#ifdef FUI
		open main
#else
		open ingame_main
#endif // FUI
	}

// Window //

	WINDOW( "OPTIONS", 94 )
	
// Buttons //

	BUTTON ( 6, 32, WINDOW_WIDTH-12, 18, "GAME", .3, 14, close options ; open options_customise_game )
	BUTTON ( 6, 56, WINDOW_WIDTH-12, 18, "VIEW", .3, 14, close options ; open options_customise_hud )
	BUTTON ( 6, 80, WINDOW_WIDTH-12, 18, "CONTROLS", .3, 14, close options ; open options_controls )
	BUTTON ( 6, 104, WINDOW_WIDTH-12, 18, "SYSTEM", .3, 14, close options ; open options_system )
#ifdef FUI
	BUTTON ( 6, 128, WINDOW_WIDTH-12, 18, "BACK", .3, 14, close options ; setcvar cg_draw2d 1 ; open main )
#else
	BUTTON ( 6, 128, WINDOW_WIDTH-12, 18, "BACK", .3, 14, close options ; setcvar cg_draw2d 1 ;open ingame_main )
#endif // FUI
}


(trAnc3) #4

fumanchu, big thnx man!!! setcvar is that what i needed!
M|A|D [Cambo] , LOL xD , i am just wanted that all hud which on a background (head, weapon etc) was turned off while i am in options - game - view - controls and system!thnx to fumanchu problem is solved!