Difference between revisions of "UI Implementation"

From Unvanquished
Jump to: navigation, search
(Data Sources (aka feeders))
(Clean up documentation some more.)
Line 1: Line 1:
User interface code runs in its own [[Virtual_machines|virtual machine]]. Source code for handling user interface controls and loading UI files may be found in <code>[https://github.com/Unvanquished/Unvanquished/tree/master/src/gamelogic/ui src/gamelogic/ui/]</code>; the actual UI content is controlled by configuration files found in <code>[https://github.com/Unvanquished/Unvanquished/tree/master/main/ui main/ui/]</code>. The list of menu files is found in <code>[https://github.com/Unvanquished/Unvanquished/tree/master/main/ui/menus.txt main/ui/menus.txt]</code>. The game will not run without this file present.
+
==Legacy==
  
==Weapon icons==
+
{{Note|content=
 +
Please be aware that the information in this section describes the legacy (menu file&ndash;based) GUI.
 +
}}
  
Weapon icons are controlled by the <code>icon</code> entry in the weapon's [[Exporting_Models#Weapons_2|configuration file]].
+
User interface code runs in its own [[Virtual_machines|virtual machine]]. Source code for handling user interface controls and loading UI files may be found in <code>[https://github.com/Unvanquished/Unvanquished/tree/master/src/gamelogic/ui src/gamelogic/ui/]</code>; the actual UI content is controlled by configuration files found in <code>[https://github.com/Unvanquished/Unvanquished/tree/master/main/ui main/ui/]</code>. The list of menu files is found in <code>[https://github.com/Unvanquished/Unvanquished/tree/master/main/ui/menus.txt main/ui/menus.txt]</code>. The game will not run without this file present.
  
==Editing tools==
+
===Editing tools===
  
 
There is a Quake 3 HUD editor called [http://plrf.org/q3cpmahudeditor/ q3cmpa hud editor] (which is no longer maintained), and a newer version called [http://plrf.org/superhudeditor/ SuperHud Editor], which appears to be built using wxWidgets.
 
There is a Quake 3 HUD editor called [http://plrf.org/q3cpmahudeditor/ q3cmpa hud editor] (which is no longer maintained), and a newer version called [http://plrf.org/superhudeditor/ SuperHud Editor], which appears to be built using wxWidgets.
  
==Troubleshooting==
+
===Troubleshooting===
  
===Game crashes for an unknown reason===
+
====Game crashes for an unknown reason====
  
 
Your <code>[https://github.com/Unvanquished/Unvanquished/tree/master/main/ui/menudef.h main/ui/menudef.h]</code> file may be out of date. <!-- TODO: add bt to where this usually happens -->
 
Your <code>[https://github.com/Unvanquished/Unvanquished/tree/master/main/ui/menudef.h main/ui/menudef.h]</code> file may be out of date. <!-- TODO: add bt to where this usually happens -->
  
==Transition to libRocket==
+
==Implementation-Independent GUI Behavior==
 +
 
 +
This information applies to both the legacy and libRocket GUI implementations.
 +
 
 +
===Weapon icons===
 +
 
 +
Weapon icons are controlled by the <code>icon</code> entry in the weapon's [[Exporting_Models#Weapons_2|configuration file]].
 +
 
 +
==libRocket GUI==
  
 
A move to use [http://librocket.com/ libRocket] has been planned with support underway. This middleware will allow creating the user interface using HTML and CSS. If you are interested in assisting with the transition, please [[Main_Page#Contributing|contact a member of the team]] to find out how to help.
 
A move to use [http://librocket.com/ libRocket] has been planned with support underway. This middleware will allow creating the user interface using HTML and CSS. If you are interested in assisting with the transition, please [[Main_Page#Contributing|contact a member of the team]] to find out how to help.
  
===libRocket Progress===
+
===libRocket Integration Progress===
 +
 
 
====General====
 
====General====
*Get libRocket to play nicely with q3 shaders
+
 
*Clean up the generic RocketElement class used to draw all the ownerdraws [50%]
+
* Get libRocket to play nicely with q3 shaders
*Remove ui_shared.c cgame dependence [10%]
+
* Clean up the generic RocketElement class used to draw all the ownerdraws [50%]
*Analyze potential of adding future animations [waaaaaaaaaay in the future, if at all]
+
* Remove ui_shared.c cgame dependence [10%]
 +
* Analyze potential of adding future animations [waaaaaaaaaay in the future, if at all]
  
 
====Data Sources (aka feeders)====
 
====Data Sources (aka feeders)====
*Resolutions - list of resolutions [done]
+
 
*VoIP Input - Input devices for OpenAL [done]
+
{| class="wikitable progress"
*AL Output - Output devices for OpenAL [done]
+
|-
*HUDS - List of HUDs to choose from
+
! Name
*Languages - List of languages [done]
+
! Description
*Mods - List of mods [done]
+
! Status
*Demos - List of demos [done]
+
|-
*Maps - List of maps
+
| Resolutions
*Players on team - List of players on each team
+
| list of resolutions
*Players - List of players. This and above can probably be combined.
+
| class="done" | Implemented
*Server status - Detailed information on a server // Probably can implement without a feeder.
+
|-
*Find player - Results for a multiserver player search.
+
| VoIP Input
*Team list - List of available teams
+
| Input devices for OpenAL
*Classes - List of classes per team
+
| class="done" | Implemented
*Items - List of available items per team
+
|-
*Armory items - List of items. Can probably be merged with above.
+
| AL Output
*Alien evo classes - List of classes that can be evo'd to.
+
| Output devices for OpenAL
*Buildable menu - List of buildables that can be built
+
| class="done" | Implemented
*Ignore - List of players/patterns player has ignored
+
|-
*Help - List of help topics
+
| HUDS
 +
| List of HUDs to choose from
 +
| class="none" | Not Implemented
 +
|-
 +
| Languages
 +
| List of languages
 +
| class="done" | Implemented
 +
|-
 +
| Mods
 +
| List of mods
 +
| class="done" | Implemented
 +
|-
 +
| Demos
 +
| List of demos
 +
| class="done" | Implemented
 +
|-
 +
| Maps
 +
| List of maps
 +
| class="none" | Not Implemented
 +
|-
 +
| Players on team
 +
| List of players on each team
 +
| class="none" | Not Implemented
 +
|-
 +
| Players
 +
| List of players. This and above can probably be combined.
 +
| class="none" | Not Implemented
 +
|-
 +
| Server status
 +
| Detailed information on a server // Probably can implement without a feeder.
 +
| class="none" | Not Implemented
 +
|-
 +
| Find player
 +
| Results for a multiserver player search.
 +
| class="none" | Not Implemented
 +
|-
 +
| Team list
 +
| List of available teams
 +
| class="none" | Not Implemented
 +
|-
 +
| Classes
 +
| List of classes per team
 +
| class="none" | Not Implemented
 +
|-
 +
| Items
 +
| List of available items per team
 +
| class="none" | Not Implemented
 +
|-
 +
| Armory items
 +
| List of items. Can probably be merged with above.
 +
| class="none" | Not Implemented
 +
|-
 +
| Alien evo classes
 +
| List of classes that can be evo'd to.
 +
| class="none" | Not Implemented
 +
|-
 +
| Buildable menu
 +
| List of buildables that can be built
 +
| class="none" | Not Implemented
 +
|-
 +
| Ignore
 +
| List of players/patterns player has ignored
 +
| class="none" | Not Implemented
 +
|-
 +
| Help
 +
| List of help topics
 +
| class="none" | Not Implemented
 +
|}
  
 
====Missing Elements====
 
====Missing Elements====
*Chat field - Field for chat.
+
* Chat field - Field for chat.
*Selectable datagrid - Selectable table, essentially. Warsow has this. Can probably port.
+
* Selectable datagrid - Selectable table, essentially. Warsow has this. Can probably port.
*Model view - Display a model. Low priority imo. Won't do unless there is demand.
+
* Model view - Display a model. Low priority imo. Won't do unless there is demand.
*Keyselect - Detect which key is pressed. For binds.
+
* Key select - Detect which key is pressed. For binds.
  
 
====Ownerdraws====
 
====Ownerdraws====
Line 83: Line 162:
 
}}
 
}}
  
*<btimer /> - Build timer display
+
{{UIElement
*<credits precision=(decimal places) /> - Credits/evos available.
+
|Name=btimer  
*<stamina /> - Available stamina
+
|Description=Displays a build timer.
*<boost /> - Boosted status and time remaining
+
}}
*<selected /> - Item selected
+
 
*<weapon />  - selected weapon icon
+
{{UIElement
*<wallclimb /> - Wall climbing status indicator
+
|Name=credits
*<alien_sense /> - Alien radar
+
|Description=Credits/evos available.
*<scanner /> - Human radar
+
|Attributes=
*<useable_buildable /> - Indicator that you are near a usable buildable
+
{{UIAttribute|Name=precision|Type=integer|Description=Determines the number of leading decimal places (?)}}
*<location /> - Player location text
+
}}
*<team_overlay /> - Team overlay which shows useful team info
+
 
*<fps /> - Frames per second
+
{{UIElement
*<timer /> - Time since game began
+
|Name=stamina
*<lagometer /> - Lagometer. Quality of connection
+
|Description=Available stamina
*<speedometer /> - Wheeee. Current speed.
+
}}
*<crosshair_name /> - Name of player in crosshair
+
 
*<stage_report /> - Stage report. % of mapcontrol needed for next stage
+
{{UIElement
*<demo /> - State of demo. eg, recording/playing
+
|Name=boost
 +
|Description=Displays the current status of the [[Glossary#boost|boost]] and the time remaining before it is lost.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=selected
 +
|Description=Displays the icon of the currently selected item.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=weapon  
 +
|Description=Displays the icon of the currently equipped weapon.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=wallclimb  
 +
|Description=Wall climbing status indicator.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=alien_sense
 +
|Description=Alien radar.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=scanner
 +
|Description=Human radar.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=useable_buildable
 +
|Description=Indicates to the player when they are within range of a usable buildable.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=location  
 +
|Description=Displays the name of the location in which the player is currently occupying, as set by the map author.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=team_overlay
 +
|Description=Team overlay which shows useful team info <!-- such as...? -->
 +
}}
 +
 
 +
{{UIElement
 +
|Name=fps
 +
|Description=Displays the current framerate, in frames per second.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=timer
 +
|Description=Displays the time since the game began.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=lagometer
 +
|Description=Displays a scrolling graph of the quality of the player's connection over time.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=speedometer
 +
|Description=Displays the player's current speed.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=crosshair_name
 +
|Description=Displays the name of the player currently in the crosshair, if it is appropriate to show.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=stage_report
 +
|Description=Indicates what percentage of map control is needed to advance to the next stage.
 +
}}
 +
 
 +
{{UIElement
 +
|Name=demo
 +
|Description=Displays the state of demo recording or playback.
 +
}}

Revision as of 22:04, 10 May 2013

Legacy

Information 48x48.png

Note

Please be aware that the information in this section describes the legacy (menu file–based) GUI.

User interface code runs in its own virtual machine. Source code for handling user interface controls and loading UI files may be found in src/gamelogic/ui/; the actual UI content is controlled by configuration files found in main/ui/. The list of menu files is found in main/ui/menus.txt. The game will not run without this file present.

Editing tools

There is a Quake 3 HUD editor called q3cmpa hud editor (which is no longer maintained), and a newer version called SuperHud Editor, which appears to be built using wxWidgets.

Troubleshooting

Game crashes for an unknown reason

Your main/ui/menudef.h file may be out of date.

Implementation-Independent GUI Behavior

This information applies to both the legacy and libRocket GUI implementations.

Weapon icons

Weapon icons are controlled by the icon entry in the weapon's configuration file.

libRocket GUI

A move to use libRocket has been planned with support underway. This middleware will allow creating the user interface using HTML and CSS. If you are interested in assisting with the transition, please contact a member of the team to find out how to help.

libRocket Integration Progress

General

  • Get libRocket to play nicely with q3 shaders
  • Clean up the generic RocketElement class used to draw all the ownerdraws [50%]
  • Remove ui_shared.c cgame dependence [10%]
  • Analyze potential of adding future animations [waaaaaaaaaay in the future, if at all]

Data Sources (aka feeders)

Name Description Status
Resolutions list of resolutions Implemented
VoIP Input Input devices for OpenAL Implemented
AL Output Output devices for OpenAL Implemented
HUDS List of HUDs to choose from Not Implemented
Languages List of languages Implemented
Mods List of mods Implemented
Demos List of demos Implemented
Maps List of maps Not Implemented
Players on team List of players on each team Not Implemented
Players List of players. This and above can probably be combined. Not Implemented
Server status Detailed information on a server // Probably can implement without a feeder. Not Implemented
Find player Results for a multiserver player search. Not Implemented
Team list List of available teams Not Implemented
Classes List of classes per team Not Implemented
Items List of available items per team Not Implemented
Armory items List of items. Can probably be merged with above. Not Implemented
Alien evo classes List of classes that can be evo'd to. Not Implemented
Buildable menu List of buildables that can be built Not Implemented
Ignore List of players/patterns player has ignored Not Implemented
Help List of help topics Not Implemented

Missing Elements

  • Chat field - Field for chat.
  • Selectable datagrid - Selectable table, essentially. Warsow has this. Can probably port.
  • Model view - Display a model. Low priority imo. Won't do unless there is demand.
  • Key select - Detect which key is pressed. For binds.

Ownerdraws

The health element

End tag: Required

Renders the player's current health.



The bar element

End tag: Required

Draws a progress bar.

item = cvar

The name of the cvar that determines the current value of the progress bar.


maxValue = cvar

The name of the cvar that specifies the maximum value of the progress bar; when item reaches this value, the progress bar will be rendered completely full.


img = string

If a solid bar is not desired, the image that will be used to render the bar.


direction = left|right|up|down

The direction that the bar decreases.


The ammo element

End tag: Required

Current ammo value.

type = all|clip

Determines whether to show current clip's ammo or total ammo.


The clips element

End tag: Required

Current number of clips



The btimer element

End tag: Required

Displays a build timer.



The credits element

End tag: Required

Credits/evos available.

precision = integer

Determines the number of leading decimal places (?)


The stamina element

End tag: Required

Available stamina



The boost element

End tag: Required

Displays the current status of the boost and the time remaining before it is lost.



The selected element

End tag: Required

Displays the icon of the currently selected item.



The weapon element

End tag: Required

Displays the icon of the currently equipped weapon.



The wallclimb element

End tag: Required

Wall climbing status indicator.



The alien_sense element

End tag: Required

Alien radar.



The scanner element

End tag: Required

Human radar.



The useable_buildable element

End tag: Required

Indicates to the player when they are within range of a usable buildable.



The location element

End tag: Required

Displays the name of the location in which the player is currently occupying, as set by the map author.



The team_overlay element

End tag: Required

Team overlay which shows useful team info



The fps element

End tag: Required

Displays the current framerate, in frames per second.



The timer element

End tag: Required

Displays the time since the game began.



The lagometer element

End tag: Required

Displays a scrolling graph of the quality of the player's connection over time.



The speedometer element

End tag: Required

Displays the player's current speed.



The crosshair_name element

End tag: Required

Displays the name of the player currently in the crosshair, if it is appropriate to show.



The stage_report element

End tag: Required

Indicates what percentage of map control is needed to advance to the next stage.



The demo element

End tag: Required

Displays the state of demo recording or playback.