SuperHud
From Q4MAX
Starting from version 0.80, Q4Max uses a custom hud system based on CPMA's implementation - we call it SuperHud.
advantages over using .guis
- performance
- simpler syntax
- no packaging
The syntax, elements and properties are largely similar, so you will find most of this documentation paraphrases CPMA's.
Note : For the time being, you can still revert to .gui based huds by changing hud_useSuperhud to 0 - but support for them is on hold. This will likely change in future releases.
Contents |
Syntax
The syntax in CPMA's SuperHud should be pretty straightforward to comprehend. Supports both multi-line and single-line arguments.
ELEMENT { PROPERTY VALUE PROPERTY VALUE } # This is a comment ! // This is also a comment /* as is this */ # You can also represent elements like this: ELEMENT { PROPERTY VALUE PROPERTY VALUE }
All keywords - both element names, and property names, are case insensitive.
Note that unlike CPMA, all properties have a value. Additionally, the value must be quoted if it contains spaces or punctuation of any kind - so "1.3" or "10 10" must be quoted, unlike in CPMA.
Elements
- !Default
- Special type of element which sets default properties which are applied to all elements that follow this element. May occur multiple times.
- Awards
- Shows the award icons.
- Properties
- Base properties using position+dimensions
- Text properties
- Chat1 to Chat5
- Text elements showing the ingame chat.
- Properties
- Text properties
- Ctf_Holder_Own
- The name of the person currently carrying your teams flag.
- Properties
- Text properties
- Ctf_Holder_Nmy
- The name of the person currently carrying the enemy flag.
- Properties
- Text properties
- Ctf_Status_Own
- Image showing the CTF flag state for your own team.
- Properties
- Text properties
- Ctf_Status_Nmy
- Image showing the CTF flag state for the enemy team.
- Properties
- Text properties
- Death_Message_1 to Death_Message_3
- Text showing the death messages.
- Properties
- Text properties
- Fps
- Text containing the current framerate. You can hide/show it by toggling hud_fps.
- Properties
- Text properties
- Frag_Notice
- Text used to indicate who you just fragged / who fragged you.
- Properties
- Text properties
- Gametime
- A text element showing the amount of time played/remaining.
- Properties
- Text properties
- Gametime_Inf
- The infinity sign displayed when there is no timelimit
- Properties
- Image properties
- Input
- Game controller style images showing the movement keys. You can hide/show it by toggling hud_showInput.
- Properties
- Base properties, using position+dimensions
- Text properties
- color
- colorHighlight
- Lagometer
- The lagometer. You can hide/show it by toggling net_clientLagometer.
- Properties
- Base properties, using position+dimensions
- Main_Notice
- Text used for notices such as "you have the flag".
- Properties
- Text properties
- Motd
- Text field used for the Message Of The Day, and any broadcast messages from the server.
- Properties
- Text properties
- Name_Nmy
- The enemy's name - shows the team name in team games.
- Properties
- Text properties
- Name_Own
- Your name - shows the team name in team games.
- Properties
- Text properties
- Pickup_Text
- Text containing the long name of the last item picked up.
- Properties
- Text properties
- Pickup_Icon
- Pickup icon corresponding to the last item picked up.
- Properties
- Image properties
- Powerups
- Dynamic list of powerups that the player currently has. Shows both the powerup icon and remaining time.
- Properties
- Base properties, using position+dimensions
- iconDimensions
- colorBG
- iconOffset
- textOffset
- itemSpacer
- PostDecorate_Text
- Text decorator available for general use - applied after the rest of the hud.
- Properties
- Text properties
- visibleforfreefloats
- PostDecorate_Image
- Image decorator available for general use - applied after the rest of the hud.
- Properties
- Image properties
- visibleforfreefloats
- PreDecorate_Text
- Text decorator available for general use - applied before the rest of the hud.
- Properties
- Text properties
- visibleforfreefloats
- PreDecorate_Image
- Image decorator available for general use - applied before the rest of the hud.
- Properties
- Image properties
- visibleforfreefloats
- Score_Own
- Text showing your own score in non-team games.
- Properties
- Text properties
- Score_Nmy
- Text showing the enemy's score in non-team games.
- Properties
- Text properties
- Spectimers
- The display of the item timers available when spectating.
- Spec_Text_0
- Line 1 of the spectator text.
- Properties
- Text properties
- Spec_Text_1
- Line 2 of the spectator text.
- Properties
- Text properties
- Spec_Text_2
- Line 3 of the spectator text.
- Properties
- Text properties
- Speed
- Text displaying you speed in UPS. You can hide/show it by toggling hud_showSpeed.
- Properties
- Text properties
- Spread
- Text containing the spread in TDM - the difference between the two teams.
- Properties
- Text properties
- Statusbar_Ammobar
- Percentage bar showing the current amount of ammo.
- Properties
- Percentage bar properties
- Statusbar_Ammocount
- Text element showing the amount of ammo the player has.
- Properties
- Number properties
- Statusbar_Ammoicon
- Image showing the icon for the current weapon.
- Properties
- Image properties
- Statusbar_Armorbar
- Percentage bar which shows the amount of armor the player has, relative to a maximum of 100.
- Properties
- Percentage bar properties
- Statusbar_Armorcount
- Text showing the current amount of armor.
- Properties
- Number properties
- Statusbar_Armoricon
- Image, showing the armor icon.
- Properties
- Image properties
- Statusbar_Healthbar
- Percentage bar which shows the amount of health the player has, relative to a maximum of 100.
- Properties
- Percentage bar properties
- Statusbar_Healthcount
- Text showing the players health.
- Properties
- Number properties
- Statusbar_Healthicon
- Image, showing the health icon
- Properties
- Image properties
- Team_Overlay_1 to Team_Overlay_8
- Rows of the team overlay.
- Properties
- Text properties
- Team_Score_Own
- Text showing your own score in team games.
- Properties
- Text properties
- Team_Score_Nmy
- Text showing the enemy's score in team games.
- Properties
- Text properties
- Thawbar
- Percentage bar used in Freezetag to show your current thawing state.
- Properties
- Percentage bar properties
- Voicechat_Transmit
- Icon displayed when transmitting voicechat.
- Properties
- Image properties
- Vote_Notice
- Text field which is set when a vote is called.
- Properties
- Text properties
- Weaponlist
- The weapon/ammo bar - a set of images and text showing the current weapons and ammo quantities.
- Properties
- Base properties, using position+dimensions)
- Text properties
- color
- colorBG
- colorHighlight
- iconDimensions
- iconOffset
- textOffset
- itemSpacer
- Xhair_Text
- Text displaying info about the player your crosshair is currently over.
- Properties
- Text properties
Properties
Property groups
- Base
- rect or position + dimension
- visible
- time
- horizontal
- Text
- font
- color
- textscale
- textstyle
- wrap
- monospaced
- tabstops
- Image
- image
- color
- colored
- flip
- rotate
- Decorate
- text or image properties
- visibleforfreefloats
- Percentage bar
- colorHigh
- colorMed
- colorLow
- flip
- medWatermark
- highWatermark
- horizontal
- image
- textalign
- rotate
- Number
- All Text properties, and
- colorHigh
- colorMed
- colorLow
- medWatermark
- highWatermark
All properties
- Color
- Color used to draw the element.
- Colored
- 0/1 flag indicating whether a color should be used.
- ColorBG
- Background color used for weaponlist, powerups list etc.
- ColorHighlight
- Highlight color used by the weaponlist and input elements.
- ColorHigh
- Color used by percentage bars for the high percentage values.
- ColorMed
- Color used by percentage bars for the medium percentage values.
- ColorLow
- Color used by percentage bars for the low percentage values.
- Dimensions
- Width and height of the element. In some cases, such as the input element, this is not directly the dimensions of the element itself, but of part of the element.
- flip
- X/Y/BOTH - allows you to flip images and percentage bars in either dimensions, or both at once.
- Font
- 0 - chain
- 1 - marine
- 2 - lowpixel
- 3 - profont
- 4 - chain_outline
- 5 - marine_outline
- 6 - lowpixel_outline
- 7 - profont_outline
- HighWatermark
- Percentage value to switch between medium and high colors - expressed as a value between 0 and 1 for percentage bars, and as the absolute value for numbers.
- Horizontal
- 0 - vertical orientation.
- 1 - horizontal orientation.
- Applies to percentage bars, weaponlist, powerups, and awards.
- IconDimensions
- Width and height of icons for elements that have both icons and text (weaponlist, awards etc)
- IconOffset
- In lists, offset of the icon relative to the top left of the item in the list.
- Image
- Path to an image to use - applies to progress bars, decorators etc. "_white" is a useful image if you want a solid color (combine with the color and colored properties).
- ItemSpacer
- In lists, the amount of space between items in the list. Note that its specified as "x y". If the list is in a horizontal orientation, only x will be used, while if vertical only y will be used.
- ListAlign
- Allows you to specify left/centre aligned on the various lists. This allows you to align it independently of the text alignment (so you can have left aligned list, but centred text)
- MarineColor
- Color used for the Marine team. This is a global value, so typically should only be placed in the !default element. Special tokens such as T/E/W cannot be used here.
- maxAwards
- Controls the number of awards before switching to a number instead of multiple images.
- MedWatermark
- Percentage value to switch between low and medium colors - expressed as a value between 0 and 1 for percentage bars, and as the absolute value for numbers.
- Monospaced
- 0/1 flag indicating whether the text should be printed in a monospaced font.
- Position
- X and Y coordinates of the element.
- Rect
- X, Y, Width and Height of the element. Duplicates the functionality of position and Dimensions keywords.
- rotate
- 0/90/180/270 - allows you to rotate images and percentage bars by the given amount. Note that only the 4 fixed values are used.
- StroggColor
- Color used for the Strogg team. This is a global value, so typically should only be placed in the !default element. Special tokens such as T/E/W cannot be used here.
- tabstops
- X coordinates, relative to the x/y coordinates of the element, to move to when reaching a tab in the output text. Mainly intended for the Team Overlay.
- Text
- Text value used by decorate_text elements.
- textalign
- L - left, C - centered, R - right
- TextOffset
- In lists, offset of the text relative to the top left of the item in the list.
- TextScale
- Scales the text. Values correspond to those in q4's .gui files - the values are not in pixels.
- textstyle
- 0 - Normal
- 1 - Shadowed
- 2 - Outline - Switches to the _outline font version, therefore font 4/5/6/7 + textstyle 2 are redundant.
- 3 - Ignore Colors
- 4 - Ignore Colors, Skip Icons
- Time
- Value indicates time (in milliseconds) that the element will be visible after the last update. Used to make elements appear only when they change.
- Visible
- Value is a bitmask which indicates whether the hud element is visible. By default, it will be 7 - ie, always visible.
- 0 - hidden
- 1 - visible in non team-game modes
- 2 - visible in team-games, excluding CTF
- 4 - visible in CTF
- VisibleForFreeFloats
- 0/1 selects whether this element is visible for freefloat spectators. This is only needed on decorators - all other elements automatically have sensible values.
- Wrap
- X Coordinate to wrap at, for text elements. Especially used in Chat elements. Can also be the Y coordinate to wrap vertical weaponlists to get multi-column lists.
Colors
The superhud uses "r g b a", which is red green blue alpha. Each channel can have values from 0-1.
Color "1 1 1 1" is white, full alpha
Color "0 0 0 0.5" is black, half transparent
Color "0.25 0.25 1 0.75" is blue, somewhat transparent
It is possible to set a different alpha value for a letter color code.
For example, Color "W 0.9" uses the weapon's color with 0.9 alpha.
Note that colors set in SuperHud do not override colors set elsewhere. For example if your ui_nick or ui_name is "^3hello" it will be yellow regardless. Text style 3 allows you to override colors stored in the string.
Team Color
Color T uses your team's color.
- By default, it will be the standard strogg/marine color depending on which side you are.
- If you have set new marineColor/stroggColor values, these will be used.
- If you are using hud_useTeamColors 1, T will match cg_teamColor.
Enemy Color
Color E uses your team's color.
- By default, it will be the standard strogg/marine color depending on which side you are.
- If you have set new marineColor/stroggColor values, these will be used.
- If you are using hud_useTeamColors 1, E will match cg_enemyColor.
Weapon Color
Color W uses your current weapon's color. This is used on the ammo bar.