jacHUD - Just Another Custom HUD ;)
===================================
by lava | 2006-02-01


Info & Features
---------------

* Based on Essobie's sobpak13 HUD (thanks!)
* CPMA/OSP style layout
* "No Ammo" icon over weapons with zero ammo (will be hidden if you pickup ammo
  for that weapon or the weapon itself)
* Crisp weapon icons even at low image_downsizeLimit values
* One- and two rows health & armorbar layouts available
* Color of health and armor indicates railsafe level:
  GREEN = you'll survive 3 rails
  WHITE = you'll survive 2 rails
  ORANGE = you'll survive 1 rail
  RED = 1 rail and you'll drop dead ;)
* Thin ammo bar above health / armor bars
* Ammo counter for current weapon below crosshair
* Ammo indicators will turn red when you're low on ammo
* Team-colored teamoverlay
* Organized .gui files for better customizability, many options can be changed
  in hud_jachud_vars.gui file (see "Advanced Customization" further down)


Installation & Usage
--------------------

Put hud_jachud.pk4 and hud_jachud_xhairs.pk4 into your q4base directory (this is necessary for ALL mods not just q4max).

To use the HUD in Q4Max, put one of the following lines in your .cfg or type it 
into the console:

set hud_style hud_jachud
(One row health & armorbar layout)

set hud_style hud_jachud_xhair
(Same as above, but with custom crosshair)

set hud_style hud_jachud_xhair1a
(Same as above, but with alternate custom crosshair)

set hud_style hud_jachud2
(Two rows health & armorbar layout)

set hud_style hud_jachud2_xhair
(Same as above, but with custom crosshair)

set hud_style hud_jachud2_xhair1a
(Same as above, but with alternate custom crosshair)

To use the HUD in X-Battle 0.22, put one of the following lines in your .cfg or type it 
into the console:

set cl_hud jachud_xbm
(One row health & armorbar layout)

set cl_hud jachud_xhair_xbm
(Same as above, but with custom crosshair)

set cl_hud jachud_xhair1a_xbm
(Same as above, but with alternate custom crosshair)

set cl_hud jachud2_xbm
(Two rows health & armorbar layout)

set cl_hud jachud2_xhair_xbm
(Same as above, but with custom crosshair)

set cl_hud jachud2_xhair1a_xbm
(Same as above, but with alternate custom crosshair)

To use the hud in another mod (sucessfully tried in X-Battle 0.12 and 
Quake4World Beta 3.0a), put one of the following files inside 
the mod directory (for Quake4World, you must additionally set g_hud "hud"):

zzz_hud_jachud.pk4
(One row health & armorbar layout)

zzz_hud_jachud_xhair.pk4
(Same as above, but with custom crosshair)

zzz_hud_jachud_xhair1a.pk4
(Same as above, but with alternate custom crosshair)

zzz_hud_jachud2.pk4
(Two rows health & armorbar layout)

zzz_hud_jachud2_xhair.pk4
(Same as above, but with custom crosshair)

zzz_hud_jachud2_xhair1a.pk4
(Same as above, but with alternate custom crosshair)

If you are using one of the custom crosshairs, enter the following in the 
console or your .cfg to disable Q4's default crosshair:
set g_crosshairColor "0 0 0 0"
(if this is done in the console while playing, you need to switch weapons to 
activate)


Advanced Customization
----------------------

By extracting hud_jachud.pk4 using a program like winrar, you can customize the 
look of the HUD or create your own. An example of things that can be changed by 
editing hud_jachud_vars.gui:

  * Weaponlist position
  * Unselected and selected weapon color / backgroundcolor / size
  * Current (crosshair) ammo on/off, color, vertical position
  * Weaponlist ammo color
  * Poweruplist position
  * Ammobar on/off, color
  * Railsafe colors
  * Teamoverlay position (only for Q4Max)
  * Teamoverlay color

Quake 4 GUI Editor documentation: http://www.iddevnet.com/quake4/GUIEditor


Creating Your Own Custom Crosshair
----------------------------------

Based on an idea by Essobie, "custom crosshair graphics via lots of tiny 
windowDefs in a .gui file", I have come up with the following way to make this 
task easier :)

Here's the steps necessary to create a custom crosshair:

  * Create the crosshair graphic in the picture editor of your choice (it needs
    to support the .png image file format and alpha transparency) or open and
    convert an existing .tga graphic
  * Save the crosshair as .png file with transparency
  * Go to http://www.cbw-clan.de/png2gui.php, choose the .png file, enter your 
    ingame resolution in the "desktop size" fields, check "center image on 
    desktop" (on by default), then click submit.
  * Copy the generated text into your existing .gui file, or put it into a .gui 
    file of its own and #include it somewhere in your HUD .gui file
  * Enter the following in the console or your .cfg to disable Q4's default 
    crosshair:
    set g_crosshairColor "0 0 0 0"
		(if this is done in the console while playing, you need to switch weapons 
		to activate)
  * Done! :)

Some notes on resolution:
In Quake 4, the HUD resolution is locked at 640x480, so at other in-game 
resolutions a windowDef will be scaled accordingly. This results in more or 
less visible "jaggies" for these "windowDef-images" when the in-game res is not 
640x480. To avoid this, you can enter the in-game resolution on the png2gui 
page and have the resulting windowDefs scaled accordingly.

Some notes on performance:
A 16x16 .png with 68 opaque or half-transparent pixels will result in 68 
windowDefs accordingly. I didn't notice a performance decrease in this case. On 
the other hand, a 64x64 .png image with no transparency will result in 4096 
windowDefs - the performance hit in that case was considerable. So basically, 
keep the image as small as possible and use only as many pixels as necessary. 
Anything typically crosshair-like should be fine, because most pixels in the 
image will be fully transparent and thus keep the number of windowDefs down.

Some more notes on performance:
I have included a very simple type of run-length encoding into the .png image 
parser to further reduce the amount of windowDefs needed. It works by combining 
adjacent pixels of the same color. This can halve the amount of windowDefs for 
a simple crosshair in some cases.


Known Issues
------------

None


Revision History
----------------

2006-08-27  v1.26b   - Fix: Napalm gun under-crosshair ammo value color did not reflect low ammo state correctly

2006-08-12  v1.26    - Fix: The highlighted state of the selected weapon was not shown if it had no ammo

2006-08-12  v1.25    - Fix: Q4Max 0.76 napalm gun icon 

2006-06-20  v1.23    - Fix: Q4Max 0.75 compatibility (timer not showing)

2006-04-08  v1.22    - Add: Q4Max 0.73 & X-Battle 0.22 support
                     - Fix: Infinity symbol for weapons with unlimited ammo (e.g. instagib mode)
                     - Fix: hud_showJumps / hud_showSpeed work in X-Battle

2006-02-04  v1.21    - Reduced the default spacing between weapons in the weaponlist to fix
                       overlapping chat
                     - Slightly reduced font size in the weaponlist

2006-02-02  v1.2     - Cleaned up the code, removed some obsolete parts and 
                       rewrote some others
                     - Fixed a small visual bug with the normal health value 
                       overlaying the pulsing health value
                     - Hide weapon list, ammo indicators and custom crosshair 
                       when dead
                     - Fixed flag icon colors for CTF, moved flag icon to center
                     - Moved poweruplist and made its position customizable via
                       variables
                     - Moved teamoverlay and made it team-colored

2006-02-01  v1.1     - Added some custom crosshairs and support for other mods 
                       than Q4Max

2006-01-29  v1.0
