Author Topic: Ui ownerdraw questions  (Read 4999 times)

Vector_Matt

  • Posts: 732
  • Turrets: +2/-1
Ui ownerdraw questions
« on: August 10, 2007, 04:12:22 pm »
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
Code: [Select]
//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

  • Posts: 2737
  • Turrets: +291/-295
Ui ownerdraw questions
« Reply #1 on: August 10, 2007, 04:24:26 pm »
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#msg169333
Ok 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

  • Posts: 732
  • Turrets: +2/-1
Ui ownerdraw questions
« Reply #2 on: August 10, 2007, 05:52:55 pm »
Thanks for the information. This is now a feature request then.

Paradox

  • Posts: 2612
  • Turrets: +253/-250
    • Paradox Designs
Ui ownerdraw questions
« Reply #3 on: August 10, 2007, 09:11:50 pm »
I asked for it a long time ago... good luck

∧OMG ENTROPY∧

/dev/humancontroller

  • Posts: 1033
  • Turrets: +1002/-383
Ui ownerdraw questions
« Reply #4 on: August 10, 2007, 09:18:51 pm »
Use a pure server hack.

Vector_Matt

  • Posts: 732
  • Turrets: +2/-1
Ui ownerdraw questions
« Reply #5 on: August 11, 2007, 12:26:58 am »
Quote from: "/dev/humancontroller"
Use 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: "Paradox"
I asked for it a long time ago... good luck
Mabey I'll submit a patch...eventually...mabey...

Paradox

  • Posts: 2612
  • Turrets: +253/-250
    • Paradox Designs
Ui ownerdraw questions
« Reply #6 on: August 11, 2007, 12:38:04 am »

∧OMG ENTROPY∧

Vector_Matt

  • Posts: 732
  • Turrets: +2/-1
Ui ownerdraw questions
« Reply #7 on: August 11, 2007, 12:55:59 am »
Quote from: "Paradox"
http://svn.icculus.org/tremulous/trunk/src/cgame/cg_draw.c

Theres a list of all ownerdraws.
Thanks.

tehOen

  • Guest
Ui ownerdraw questions
« Reply #8 on: August 11, 2007, 01:37:50 am »
Quote from: "Paradox"
http://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

  • Posts: 915
  • Turrets: +99/-76
    • ben's machinery
Ui ownerdraw questions
« Reply #9 on: August 11, 2007, 02:38:15 am »
Quote from: "tehOen"
imho 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

  • Posts: 2612
  • Turrets: +253/-250
    • Paradox Designs
Ui ownerdraw questions
« Reply #10 on: August 11, 2007, 04:50:04 pm »
I gave him the main view so he could select the revision he was using (likely 755)

∧OMG ENTROPY∧