Skip to content

Medigun Info

Matt Haynie edited this page Jan 2, 2018 · 13 revisions

The Medigun info module is broken up into two main parts: separated and embedded panels. Whichever one you choose to use (or both), it is recommended to download https://github.com/Wiethoofd/TF2-MedigunInfo. This will give you a starting point for the separated medigun panels, and includes icons for the different mediguns.

Separated Medigun Panels

Separated panels are free-floating panels with their own "stacking" abilities. Because they are in their own root panel (and other reasons), it is not possible to use PinToSibling to attach them to existing HUD panels. These panels can be configured by editing /tf/resource/ui/MedigunInfo.res.

Example

ConVars

ConCommands

Embedded Medigun Panels

Embedded medigun panels adds extra controls and makes additional data available to specgui player panels.

Example

ConVars

SpectatorTournament.res

In order to use embedded medigun panels, the /tf/resource/ui/spectatortournament.res must be modified to add support.

Medigun Icons

Enabling medigun icons is as simple as adding an ImagePanel named MedigunIconRed or MedigunIconBlue. Only one will ever be visible at a time. NOTE: For performance reasons, these names are case sensitive.

Medigun Charge Percentage Text

Medigun charge percentage text is already supported in the base game. Just add a CExLabel and use the dialog variable chargeamount:

NameDoesntMatter
{
    ControlName    CExLabel
    fieldname      NameDoesntMatter
    labelText      "%chargeamount%"
}

Medigun Progress Bars

We can re-use the chargeamount dialog variable to power our progress bars.

NameDoesntMatter
{	
    ControlName    ContinuousProgressBar
    fieldname      NameDoesntMatter
    variable       chargeamount
}
Clone this wiki locally