News:

Come Chat with us live! Learn how HERE!

Main Menu

Ui ownerdraw questions

Started by Vector_Matt, August 10, 2007, 04:12:22 PM

Vector_Matt

I am trying to make my hud display an ammo bar similar to the CG_PLAYER_HEALTH_BAR thing.
The code for the health bar I have is
//HEALTH BAR LEFT
   itemDef
   {
     name "healthbarleft"
     rect 290 275 30 5
     visible 1
     decoration
     forecolor 0.0 0.8 1.0 .3
     align ITEM_ALIGN_RIGHT
     textscale 0
     ownerdraw CG_PLAYER_HEALTH_BAR
   }
   //HEALTH BAR RIGHT
   itemDef
   {
     name "healthbarright"
     rect 320 275 30 5
     visible 1
     decoration
     forecolor 0.0 0.8 1.0 .3
     align ITEM_ALIGN_LEFT
     textscale 0
     ownerdraw CG_PLAYER_HEALTH_BAR
   }
I want to make it display a bar like that for ammo, but CG_PLAYER_AMMO_BAR is not defined, and when I use CG_PLAYER_AMMO_VALUE it just displays a number there, instead of a bar.

Does anyone know what I should put in ownerdraw to make this work?

kevlarman

ownerdraw items on the hud are rendered by the cgame, you will need to add an additional function (and the associated entry in an enum and that 5 page long switch) to have an ammo bar. since you can't modify the cgame unless you play on unpure servers (or servers with a mod to make you download that cgame), you're pretty much out of luck. (i would have moved this to technical questions, but if this is going to become a feature request i'll move it to feedback instead)
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Vector_Matt

Thanks for the information. This is now a feature request then.

Paradox

I asked for it a long time ago... good luck

∧OMG ENTROPY∧

/dev/humancontroller


Vector_Matt

Quote from: /dev/humancontrollerUse a pure server hack.
:eek: Cheating is wrong.


That, and I'm too lazy to do a pure server hack just to have a nicer ui.

Quote from: ParadoxI asked for it a long time ago... good luck
Mabey I'll submit a patch...eventually...mabey...

Paradox


∧OMG ENTROPY∧

Vector_Matt


tehOen

Quote from: Paradoxhttp://svn.icculus.org/tremulous/trunk/src/cgame/cg_draw.c

Theres a list of all ownerdraws.
imho trying a header file is better to find #define; you have to read less code

benmachine

Quote from: tehOenimho trying a header file is better to find #define; you have to read less code
e.g. http://svn.icculus.org/tremulous/trunk/ui/menudef.h?rev=925&view=auto
look down a bit
benmachine

Paradox

I gave him the main view so he could select the revision he was using (likely 755)

∧OMG ENTROPY∧