Author Topic: how can I create cvars for huds?  (Read 3961 times)

Shifty

  • Posts: 75
  • Turrets: +0/-0
how can I create cvars for huds?
« on: November 17, 2010, 04:11:52 am »
I was looking through some hud files recently and I found that in some huds have this kinda thing:

cvartest cg_whatever
showcvar { 1 }

commented out. Is this used to create cvars such as whether or not to make the radar fullscreen, eg /cg_fullscreenscanner 1 or:


cvartest cg_fullscreenscanner
showcvar { 1 }

?

because I have tried that but it never seems to work for me. Is there something I am doing wrong?


Thanks

Meisseli

  • Spam Killer
  • *
  • Posts: 765
  • Turrets: +83/-25
Re: how can I create cvars for huds?
« Reply #1 on: November 17, 2010, 11:02:19 am »
Create a new cvar
Code: [Select]
seta cg_cHairColor "1" for example.

Quote
    itemDef
    {
      name "chompers"
      rect 312 232 16 16
      visible 1
        cvartest cg_cHairColor
        showCvar { 1 }

      decoration
      forecolor 1.0 0.0 0.0 0.6
      style WINDOW_STYLE_SHADER
      background "gfx/2d/crosshair-alien.tga"
    }
In this example the item will be shown only if cg_cHairColor equals to 1. There's also hideCvar that does the opposite.

Shifty

  • Posts: 75
  • Turrets: +0/-0
Re: how can I create cvars for huds?
« Reply #2 on: November 18, 2010, 09:56:07 am »
Thanks, Ill try that.