Tutorial *81*
You know how you can change the transparency of water with the cvar r_wateralpha? You also know how if you pull down the console, it is somewhat transparent so you can still see the level? In this tutorial I'll show you how to make a new cvar "con_alpha" that you can use to change the transparency of the console.

Open gl_draw.c

Find the Draw_Init function. In the space above this function, add this line:

cvar_t con_alpha = {"con_alpha", "0.6"};

Inside this function, after the line Cvar_RegisterVariable (&gl_picmip);, add:

Cvar_RegisterVariable (&con_alpha);

This actually adds the cvar to quake's list, using the values we specified in the first line.

Find the Draw_ConsoleBackground function. In this function, change this line:

Draw_AlphaPic (0, lines - vid.height, conback, (float)(1.2 * lines)/y);


Draw_AlphaPic (0, lines - vid.height, conback, (float)(2 * con_alpha.value * lines)/y);

That's all there is to it. The new cvar con_alpha works just like r_waterwarp.
A value of 1 is no transparency and 0 makes the console background invisible.
0.6 is the default.

Sign up
[Remember Me]